@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --sidebar-w: 260px;

    --bg-body: #1a1d24;
    --bg-card: #22262f;
    --bg-sidebar: #0e1118;
    --bg-sidebar-hover: #1a1e2a;
    --bg-sidebar-active: #252a38;
    --bg-input: #2a2f3a;
    --bg-input-focus: #2f3542;
    --bg-badge: #2d3240;

    --text-primary: #e4e6eb;
    --text-secondary: #9ba1b4;
    --text-tertiary: #6b7280;
    --text-sidebar: #9ba1b4;
    --text-sidebar-active: #ffffff;
    --text-on-accent: #ffffff;
    --text-link: #e8a94e;

    --accent: #d97b2b;
    --accent-hover: #e8923e;
    --accent-subtle: rgba(217,123,43,.1);
    --accent-border: rgba(217,123,43,.25);

    --border: #2d3240;
    --border-strong: #3a4050;
    --border-input: #3a4050;
    --border-focus: #d97b2b;

    --success: #34d399;
    --success-bg: rgba(52,211,153,.1);
    --error: #f87171;
    --error-bg: rgba(248,113,113,.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251,191,36,.1);
    --info: #60a5fa;
    --info-bg: rgba(96,165,250,.1);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,.25);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.3);
    --shadow-card: 0 1px 3px rgba(0,0,0,.15), 0 0 0 1px rgba(255,255,255,.03);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.6;
}

/* ===== LAYOUT ===== */

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

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 24px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-sidebar-active);
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-on-accent);
}

.sidebar-brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 16px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 550;
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.65;
    flex-shrink: 0;
}

.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,.06);
    font-size: 12px;
    color: var(--text-tertiary);
}

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 60px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

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

.content {
    padding: 28px 32px;
    max-width: 1280px;
}

/* ===== TYPOGRAPHY ===== */

h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 14px; font-weight: 600; }

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-mono { font-family: var(--font-mono); font-size: 13px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

/* ===== CARDS ===== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card-header {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 15px;
}

.card-body {
    padding: 22px;
}

.card-body-flush {
    padding: 0;
}

/* ===== STAT CARDS ===== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-card);
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* ===== TABLES ===== */

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(255,255,255,.03);
}

tbody tr {
    transition: background 0.2s var(--ease-out);
}

/* ===== BADGES ===== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 550;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-default { background: var(--bg-badge); color: var(--text-secondary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-accent { background: var(--accent-subtle); color: var(--accent); }

/* ===== BUTTONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 550;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--accent);
    color: var(--text-on-accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(217,123,43,.25);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255,255,255,.06);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}

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

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 12px;
}

/* ===== FORMS ===== */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 550;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    outline: none;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ba1b4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(217, 123, 43, .12);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input-mono {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: -0.02em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
}

/* ===== FILE UPLOAD ===== */

.file-drop {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out), transform 0.2s var(--ease-out);
    background: var(--bg-input);
}

.file-drop:hover,
.file-drop.dragover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: scale(1.01);
}

.file-drop-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    color: var(--text-tertiary);
}

.file-drop-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.file-drop-text strong {
    color: var(--accent);
    font-weight: 600;
}

.file-drop-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ===== EMPTY STATE ===== */

.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 6px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===== TABS ===== */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-sans);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ===== ALERTS ===== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(52,211,153,.15); }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(248,113,113,.15); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(251,191,36,.15); }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(96,165,250,.15); }

/* ===== KEY DISPLAY ===== */

.key-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-sidebar);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 12px 0;
}

.key-display code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #e8c97a;
    flex: 1;
    word-break: break-all;
}

.key-display .btn {
    flex-shrink: 0;
}

/* ===== AUDIT LOG ===== */

.audit-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 3px 8px;
    background: var(--bg-badge);
    border-radius: var(--radius-sm);
}

.audit-actor {
    display: flex;
    align-items: center;
    gap: 6px;
}

.audit-actor-avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.audit-time {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ===== MODAL ===== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-out);
    backdrop-filter: blur(2px);
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.3s var(--ease-out-expo), opacity 0.25s var(--ease-out);
}

.modal-backdrop.active .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-header {
    padding: 20px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 17px;
}

.modal-body {
    padding: 0 24px 24px;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border);
}

/* ===== SERVICE STATUS ===== */

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

.status-dot.healthy { background: var(--success); box-shadow: 0 0 0 3px rgba(26,154,92,.15); animation: statusPulse 3s ease-in-out infinite; }
.status-dot.unhealthy { background: var(--error); box-shadow: 0 0 0 3px rgba(217,59,59,.15); }
.status-dot.unknown { background: var(--text-tertiary); }

/* ===== LOGIN PAGE ===== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-sidebar);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(217,123,43,.08) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.4s var(--ease-out-expo) both;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.login-brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 20px;
    color: var(--text-on-accent);
}

.login-brand-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.login-title {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ===== LIVE EVENTS ===== */

.live-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 8px;
    animation: flashIn 0.3s ease;
    transition: opacity 0.5s ease;
}

.live-event svg {
    flex-shrink: 0;
    color: var(--accent);
}

.live-event.fade-out {
    opacity: 0;
}

/* ===== FLASH MESSAGE ===== */

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(26,154,92,.15);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: flashIn 0.3s ease;
}

.flash svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.flash span {
    flex: 1;
}

.flash-close {
    background: none;
    border: none;
    color: var(--success);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
    line-height: 1;
}

.flash-close:hover {
    opacity: 1;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(26,154,92,.15); }
    50% { box-shadow: 0 0 0 5px rgba(26,154,92,.08); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content > .card,
.content > .stats-grid,
.content > .alert,
.content > .grid-2 {
    animation: fadeInUp 0.35s var(--ease-out-expo) both;
}

.content > :nth-child(2) { animation-delay: 60ms; }
.content > :nth-child(3) { animation-delay: 120ms; }
.content > :nth-child(4) { animation-delay: 180ms; }

/* ===== UTILITIES ===== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.htmx-indicator {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* ===== COPY BUTTON ===== */

.copy-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-family: var(--font-sans);
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.7);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn {
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.1s var(--ease-out);
}

/* ===== VERSION PILL ===== */

.version-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    background: var(--accent-subtle);
    color: var(--accent);
    border-radius: var(--radius-sm);
}

/* ===== SECTION HEADER ===== */

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

.section-header h2 {
    font-size: 18px;
}

/* ===== SCROLLBAR ===== */

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.1);
    border-radius: 2px;
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== MOBILE MENU TOGGLE ===== */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    margin-right: 8px;
    flex-shrink: 0;
}

.menu-toggle svg {
    width: 22px;
    height: 22px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-open .sidebar-overlay {
        display: block;
    }

    .main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .topbar-title { font-size: 14px; }
    .content { padding: 20px 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }

    .card-header { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
    .card-body { padding: 16px; }

    table { font-size: 13px; }
    thead th { padding: 8px 12px; font-size: 11px; }
    tbody td { padding: 10px 12px; }

    .modal { margin: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; }

    .btn-sm { padding: 6px 12px; font-size: 13px; }

    .key-display { flex-direction: column; gap: 8px; }
    .key-display code { font-size: 11px; word-break: break-all; }

    .empty-state { padding: 32px 16px; }

    .audit-actor { gap: 6px; }
    .audit-actor-avatar { width: 24px; height: 24px; font-size: 11px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar-actions .btn { padding: 6px 10px; font-size: 12px; }
    .topbar-actions .btn svg { width: 14px; height: 14px; }
}
