/* =============================================================================
   Aegis AI — Premium Light Theme
   Clean, minimal, white-first enterprise dashboard
   ============================================================================= */

:root {
    --bg-primary: #f7f8fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f9;
    --bg-active: #eef0f8;
    --border: #e5e7ef;
    --border-light: #d4d8e8;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --accent: #FF5722;
    --accent-light: #FF7043;
    --accent-bg: rgba(255, 87, 34, 0.08);

    --green: #059669;
    --green-bg: rgba(5, 150, 105, 0.08);
    --green-dot: #10b981;
    --red: #dc2626;
    --red-bg: rgba(220, 38, 38, 0.07);
    --red-dot: #ef4444;
    --yellow: #d97706;
    --yellow-bg: rgba(217, 119, 6, 0.07);
    --blue: #2563eb;
    --blue-bg: rgba(37, 99, 235, 0.07);
    --purple: #7c3aed;
    --purple-bg: rgba(124, 58, 237, 0.07);

    --sidebar-width: 230px;
    --radius: 8px;
    --radius-sm: 5px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --transition: 0.15s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }

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

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar-brand {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.brand-logo { flex-shrink: 0; }
.brand-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--accent);
}

.nav-section-label {
    padding: 16px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.nav-links {
    list-style: none;
    padding: 4px 8px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 1px;
}

.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-link.active {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}

.nav-svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.sidebar-version { font-size: 11px; color: var(--text-muted); }
.nav-link.external { font-size: 12px; color: var(--text-muted); }
.nav-link.external:hover { color: var(--text-secondary); }

/* ─── Main Content ─── */
.main-content { flex: 1; margin-left: var(--sidebar-width); }

.top-bar {
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.top-bar-actions { display: flex; gap: 8px; align-items: center; }

.env-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--green-bg);
    color: var(--green);
    font-weight: 600;
}

.version-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.content { padding: 28px 48px; max-width: 1400px; margin: 0 auto; }

/* ─── Stat Cards (with icons) ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-sm); }

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }

.stat-body { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); margin-bottom: 2px; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--text-primary); }

/* Legacy stat cards (security, costs pages) */
.stat-card.accent { box-shadow: 0 2px 8px rgba(79,70,229,0.12); }
.stat-card.danger { box-shadow: 0 2px 8px rgba(220,38,38,0.12); }

/* ─── System Status ─── */
.status-grid {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.status-item:last-child { border-bottom: none; }
.status-item:hover { background: var(--bg-hover); }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.online { background: var(--green-dot); box-shadow: 0 0 0 3px var(--green-bg); }
.status-dot.offline { background: var(--red-dot); box-shadow: 0 0 0 3px var(--red-bg); }

.status-info { flex: 1; }
.status-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.status-desc { display: block; font-size: 11px; color: var(--text-muted); }

.status-label {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.status-label.online { background: var(--green-bg); color: var(--green); }
.status-label.offline { background: var(--red-bg); color: var(--red); }

/* ─── Sections ─── */
.section { margin-bottom: 28px; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 14px; }
.section-desc a { color: var(--accent); font-weight: 500; }
.section-desc a:hover { text-decoration: underline; }

.text-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}
.text-link:hover { text-decoration: underline; }
.text-muted { color: var(--text-muted); }

/* ─── Tables ─── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.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.4px;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

.mono, code.mono {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 2px 5px;
    border-radius: 3px;
}

/* ─── Badges ─── */
.severity-badge, .action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.severity-badge.critical { background: var(--red-bg); color: var(--red); }
.severity-badge.high { background: var(--yellow-bg); color: var(--yellow); }
.severity-badge.medium { background: var(--blue-bg); color: var(--blue); }
.severity-badge.low { background: var(--green-bg); color: var(--green); }

.action-badge.blocked { background: var(--red-bg); color: var(--red); }
.action-badge.warned { background: var(--yellow-bg); color: var(--yellow); }
.action-badge.passed { background: var(--green-bg); color: var(--green); }

/* ─── Filters ─── */
.filters { display: flex; gap: 4px; }
.filter-btn {
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ─── Action Cards (Quick Actions) ─── */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
    cursor: pointer;
}
.action-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }

.action-icon {
    width: 36px;
    height: 36px;
    color: var(--accent);
    background: var(--accent-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 8px;
}
.action-icon svg { width: 20px; height: 20px; }

.action-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.action-desc { display: block; font-size: 11px; color: var(--text-muted); }

/* ─── Generic Cards ─── */
.card-grid, .link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.model-card, .agent-card, .recommendation-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}

.model-card:hover, .agent-card:hover, .recommendation-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-light);
}

.model-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.model-meta { color: var(--text-muted); font-size: 12px; }

.agent-icon, .rec-icon { font-size: 20px; margin-bottom: 8px; }
.agent-card h3, .recommendation-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.agent-card p, .recommendation-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.agent-card code {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    padding: 6px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    word-break: break-all;
    font-family: 'SF Mono', monospace;
}

/* ─── Info cards ─── */
.info-card {
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.info-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.info-value {
    font-size: 14px;
    color: var(--accent);
    background: var(--bg-secondary);
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: inline-block;
    font-weight: 500;
    font-family: 'SF Mono', monospace;
}

/* ─── Checklist ─── */
.checklist { display: flex; flex-direction: column; gap: 6px; }
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.check-item:hover { background: var(--bg-hover); }
.check-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 36px 20px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-icon { width: 32px; height: 32px; color: var(--text-muted); margin-bottom: 10px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.empty-desc { font-size: 12px; color: var(--text-muted); }
.empty-desc a { color: var(--accent); font-weight: 500; }

.findings-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.provider-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-bg);
    color: var(--accent);
    text-transform: capitalize;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .action-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
    --bg-primary: #0f1117;
    --bg-secondary: #171923;
    --bg-card: #1e2030;
    --bg-hover: #252840;
    --bg-active: #2d3150;
    --border: #2d3148;
    --border-light: #3d4268;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-bg: rgba(255, 87, 34, 0.12);
    --green-bg: rgba(16, 185, 129, 0.12);
    --red-bg: rgba(239, 68, 68, 0.12);
    --yellow-bg: rgba(245, 158, 11, 0.12);
    --blue-bg: rgba(59, 130, 246, 0.12);
    --purple-bg: rgba(139, 92, 246, 0.12);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

/* ─── Theme Toggle ─── */
.theme-toggle {
    background: none; border: 1px solid var(--border); cursor: pointer;
    width: 32px; height: 32px; border-radius: 6px; display: flex;
    align-items: center; justify-content: center;
    transition: all var(--transition); color: var(--text-secondary);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* ─── Auto-Refresh Dot ─── */
.refresh-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green-dot); display: inline-block;
    transition: transform 0.3s;
}
.refresh-dot.pulse { animation: pulse-anim 1s ease; }
@keyframes pulse-anim {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50% { transform: scale(1.3); box-shadow: 0 0 0 6px rgba(16,185,129,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ─── Modal ─── */
.modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--bg-card); border-radius: 12px; padding: 28px;
    width: 90%; max-width: 520px; box-shadow: var(--shadow-md);
    max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.form-input {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
    font-family: inherit; font-size: 13px; background: var(--bg-primary); color: var(--text-primary);
    outline: none; box-sizing: border-box;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.btn {
    padding: 8px 16px; border-radius: 6px; font-family: inherit;
    font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--bg-primary); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-xs { padding: 2px 8px; font-size: 10px; }

/* ─── Chart Containers ─── */
.chart-container { position: relative; height: 280px; margin-bottom: 16px; }
.chart-container-sm { position: relative; height: 180px; }
.chart-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-xs);
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }

/* ─── Date Filter Bar ─── */
.filter-bar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 16px;
}
.filter-bar label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.filter-bar input[type="date"], .filter-bar input[type="text"], .filter-bar select {
    padding: 6px 10px; border: 1px solid var(--border); border-radius: 5px;
    font-family: inherit; font-size: 12px; background: var(--bg-primary); color: var(--text-primary);
    outline: none;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); }

/* ─── Pagination ─── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.page-btn {
    padding: 6px 12px; border-radius: 5px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border);
    cursor: pointer; transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Trace Detail ─── */
.trace-header {
    display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
    padding: 16px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 16px;
}
.trace-meta-item { display: flex; flex-direction: column; }
.trace-meta-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.trace-meta-value { font-size: 14px; font-weight: 500; color: var(--text-primary); }

/* Span Tree */
.span-tree { margin-bottom: 16px; }
.span-node {
    border-left: 2px solid var(--accent); margin-left: 16px; padding: 8px 0 8px 16px;
    position: relative;
}
.span-node::before {
    content: ''; position: absolute; left: -2px; top: 16px;
    width: 10px; height: 2px; background: var(--accent);
}
.span-node:first-child { margin-left: 0; border-left-color: var(--green); }
.span-node:first-child::before { background: var(--green); }
.span-header {
    display: flex; gap: 10px; align-items: center; padding: 8px 12px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
    cursor: pointer; transition: all var(--transition);
}
.span-header:hover { border-color: var(--accent); }
.span-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.span-type { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: var(--accent-bg); color: var(--accent); font-weight: 600; text-transform: uppercase; }
.span-duration { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.span-bar { height: 3px; background: var(--accent); border-radius: 2px; margin-top: 4px; opacity: 0.5; }
.span-body {
    margin-top: 8px; padding: 12px; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: 6px; display: none;
}
.span-body.open { display: block; }
.span-body pre {
    font-family: 'SF Mono', monospace; font-size: 12px; white-space: pre-wrap;
    word-break: break-word; color: var(--text-secondary); max-height: 300px; overflow-y: auto;
}
.span-body .prompt-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; margin-bottom: 4px; }

/* ─── Clickable row ─── */
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--accent-bg); }

/* ─── Two Column Layout ─── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ─── Progress Bars ─── */
.progress-bar { height: 6px; background: var(--bg-primary); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.progress-fill.green { background: var(--green); }
.progress-fill.yellow { background: var(--yellow); }
.progress-fill.red { background: var(--red); }
.progress-fill.blue { background: var(--accent); }

/* ─── F#35: Toast Notifications ─── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 20px; border-radius: 10px; font-size: 13px; font-weight: 500;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15); opacity: 0; transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); max-width: 360px;
    display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
.toast-info { background: var(--accent); color: #fff; }

/* ─── F#34: Search Box ─── */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.top-bar-actions { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-input {
    width: 240px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card); color: var(--text-primary); font-size: 13px; font-family: inherit;
    transition: border-color 0.2s, width 0.3s;
}
.search-input:focus { outline: none; border-color: var(--accent); width: 320px; }
.search-results {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 1000; display: none; max-height: 300px; overflow-y: auto;
}
.search-result { display: flex; align-items: center; gap: 8px; padding: 10px 12px; text-decoration: none; color: var(--text-primary); font-size: 13px; border-bottom: 1px solid var(--border); }
.search-result:hover { background: var(--accent-bg); }
.search-type { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--accent-bg); color: var(--accent); }
.env-badge { font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; background: var(--green); color: #fff; letter-spacing: 0.5px; }

/* ─── F#33: Mobile Menu ─── */
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-primary); padding: 8px; }
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); position: fixed; z-index: 999; height: 100vh; transition: transform 0.3s ease; }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.2); }
    .mobile-menu-btn { display: block; }
    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .search-input { width: 160px; }
    .search-input:focus { width: 200px; }
}

/* ─── Section header with button ─── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.text-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.text-link:hover { text-decoration: underline; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── Extra button sizes ─── */
.btn-xs { font-size: 11px; padding: 4px 8px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.85; }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-icon { width: 48px; height: 48px; color: var(--text-muted); opacity: 0.4; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-desc { font-size: 13px; }

/* ─── Nav group label ─── */
.nav-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 16px 16px 6px; opacity: 0.6; }

/* ─── Filters ─── */
.filters { display: flex; gap: 4px; }
.filter-btn { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; text-decoration: none; color: var(--text-muted); background: transparent; transition: all 0.2s; }
.filter-btn:hover, .filter-btn.active { background: var(--accent-bg); color: var(--accent); }

/* ─── Sidebar controls ─── */
.sidebar-controls { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.refresh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.refresh-dot.pulse { animation: pulse 0.6s ease; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }

