/* CVE OptiBot - Design Tokens */
:root {
    --primary: #1a1a2e;
    --bg: #ffffff;
    --surface: #f8f9fa;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --status-green: #22c55e;
    --status-yellow: #f59e0b;
    --status-red: #ef4444;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #e5e7eb;
    --radius-sm: 4px;
    --radius-md: 8px;
    --sidebar-width: 240px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: #ffffff;
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 0 24px 24px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s, background 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav .badge {
    margin-left: auto;
    background: var(--status-red);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-user {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 40px;
    max-width: 1200px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-muted);
    margin-top: 4px;
}

/* Summary counters */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.summary-card {
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.summary-card .count {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.summary-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.summary-card.green .count { color: var(--status-green); }
.summary-card.yellow .count { color: var(--status-yellow); }
.summary-card.red .count { color: var(--status-red); }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:hover {
    background: var(--surface);
}

.data-table a {
    color: var(--accent);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.green { background: var(--status-green); }
.status-dot.yellow { background: var(--status-yellow); }
.status-dot.red { background: var(--status-red); }
.status-dot.pending { background: var(--text-muted); }

.severity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical { background: #fef2f2; color: var(--status-red); }
.severity-badge.high { background: #fff7ed; color: #ea580c; }
.severity-badge.medium { background: #fffbeb; color: var(--status-yellow); }
.severity-badge.low { background: #f0fdf4; color: var(--status-green); }

/* Monospace for versions and CVE IDs */
.mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: #fef2f2;
    color: var(--status-red);
}

.btn-danger:hover {
    background: #fee2e2;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.04);
}

.upload-zone input[type="file"] {
    display: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Alerts/flash messages */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
}

.flash.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Auth pages (no sidebar) */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--surface);
}

.auth-card {
    background: var(--bg);
    padding: 40px;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.auth-card h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-card .auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-card .auth-link a {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 64px;
    }
    .sidebar-brand span,
    .sidebar-nav a span,
    .sidebar-user {
        display: none;
    }
    .sidebar-nav a {
        justify-content: center;
        padding: 12px;
    }
    .main-content {
        margin-left: 64px;
        padding: 24px;
    }
    .data-table .hide-tablet {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 56px;
        flex-direction: row;
        padding: 0;
    }
    .sidebar-brand,
    .sidebar-user {
        display: none;
    }
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        height: 100%;
    }
    .sidebar-nav a {
        flex-direction: column;
        gap: 2px;
        padding: 8px;
        font-size: 10px;
    }
    .sidebar-nav a span {
        display: block;
    }
    .main-content {
        margin-left: 0;
        margin-bottom: 56px;
        padding: 16px;
    }
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .data-table .hide-mobile {
        display: none;
    }
}

/* Skip to content (a11y) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    z-index: 200;
    transition: top 0.15s;
}

.skip-link:focus {
    top: 0;
}
