* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    line-height: 1.5;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #111118;
    border-bottom: 1px solid #1e1e2e;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #7c8aff;
}

.nav-links a {
    color: #888;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #e0e0e0;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #f0f0f0;
}

h2 {
    font-size: 1.1rem;
    margin: 2rem 0 1rem;
    color: #c0c0c0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: #111118;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    border-top: 3px solid #333;
}

.summary-card.critical { border-top-color: #ff4466; }
.summary-card.high { border-top-color: #ff8844; }
.summary-card.medium { border-top-color: #ffbb33; }
.summary-card.low { border-top-color: #44aaff; }
.summary-card.pass { border-top-color: #44dd88; }

.summary-value {
    font-size: 2rem;
    font-weight: 700;
}

.summary-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.scan-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111118;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #888;
}

#scan-btn {
    background: #2a2a4a;
    color: #7c8aff;
    border: 1px solid #3a3a6a;
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

#scan-btn:hover:not(:disabled) {
    background: #3a3a6a;
}

#scan-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scan-status {
    background: #111118;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.scan-status.scanning { border-color: #ffbb33; color: #ffbb33; }
.scan-status.success { border-color: #44dd88; color: #44dd88; }
.scan-status.error { border-color: #ff4466; color: #ff4466; }

.text-pass { color: #44dd88; }
.text-warn { color: #ffbb33; }
.text-fail { color: #ff4466; }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.result-card {
    display: block;
    background: #111118;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
    border-left: 3px solid #333;
}

.result-card:hover {
    border-color: #3a3a5a;
    border-left-color: inherit;
}

.result-card.critical { border-left-color: #ff4466; }
.result-card.high { border-left-color: #ff8844; }
.result-card.medium { border-left-color: #ffbb33; }
.result-card.low { border-left-color: #44aaff; }
.result-card.info { border-left-color: #44dd88; }

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e0e0e0;
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.pass { background: #0a2a1a; color: #44dd88; }
.badge.warn { background: #2a2a0a; color: #ffbb33; }
.badge.fail { background: #2a0a0a; color: #ff4466; }
.badge.completed { background: #0a2a1a; color: #44dd88; }
.badge.running { background: #2a2a0a; color: #ffbb33; }
.badge.error { background: #2a0a0a; color: #ff4466; }

.badge-sev {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-sev.critical { background: #2a0a0a; color: #ff4466; }
.badge-sev.high { background: #2a1a0a; color: #ff8844; }
.badge-sev.medium { background: #2a2a0a; color: #ffbb33; }
.badge-sev.low { background: #0a1a2a; color: #44aaff; }
.badge-sev.info { background: #0a2a1a; color: #44dd88; }

.result-message {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-time {
    font-size: 0.75rem;
    color: #555;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #1e1e2e;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.history-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #141420;
    color: #999;
}

.history-table tr:hover td {
    color: #ccc;
}

.nowrap {
    white-space: nowrap;
}

.back-link {
    display: inline-block;
    color: #7c8aff;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-badges {
    display: flex;
    gap: 0.5rem;
}

.detail-message {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #111118;
    border-radius: 8px;
    border: 1px solid #1e1e2e;
}

.detail-block {
    margin-bottom: 1.5rem;
}

.detail-block h3 {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-block pre {
    background: #0d0d14;
    border: 1px solid #1e1e2e;
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.8rem;
    color: #999;
    overflow-x: auto;
    max-height: 400px;
}

.settings-form {
    max-width: 600px;
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #111118;
    border: 1px solid #1e1e2e;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #3a3a6a;
}

.btn-save {
    background: #2a2a4a;
    color: #7c8aff;
    border: 1px solid #3a3a6a;
    border-radius: 6px;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-save:hover {
    background: #3a3a6a;
}

.settings-section {
    margin-top: 2rem;
    padding: 1rem;
    background: #111118;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
}

.settings-section p {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.settings-section code {
    background: #0d0d14;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #7c8aff;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.toast.success {
    background: #0a2a1a;
    border: 1px solid #1a4a2a;
    color: #44dd88;
}

@media (max-width: 640px) {
    nav {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    .scan-bar {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
    main {
        padding: 1rem;
    }
}

.delta-banner {
    background: #111118;
    border: 1px solid #1e1e2e;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #44dd88;
}

.delta-banner.delta-improved {
    border-left-color: #44dd88;
    background: #0a1a12;
}

.delta-banner.delta-worsened {
    border-left-color: #ff4466;
    background: #1a0a0e;
}

.delta-banner.delta-unchanged {
    border-left-color: #ffbb33;
    background: #1a1a0a;
}

.delta-verdict {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.delta-improved .delta-verdict {
    color: #44dd88;
}

.delta-worsened .delta-verdict {
    color: #ff4466;
}

.delta-unchanged .delta-verdict {
    color: #ffbb33;
}

.delta-details {
    font-size: 0.85rem;
    color: #999;
}

.delta-green {
    color: #44dd88;
    font-weight: 600;
}

.delta-red {
    color: #ff4466;
    font-weight: 600;
}
