:root {
    --radius: 10px;
}

[data-theme="onyx_blue"] {
    --bg: #020202;
    --surface: #0A0A0C;
    --surface-2: #101014;
    --border: #1C1C22;
    --text: #EDEFF5;
    --text-muted: #8B93A7;
    --accent: #B2D5E5;
    --accent-text: #0B2A38;
    --accent-bg: #152A33;
    --danger: #FF5C7A;
    --warning: #FFB020;
}

[data-theme="onyx_green"] {
    --bg: #020202;
    --surface: #0A0A0A;
    --surface-2: #101010;
    --border: #1C1C1C;
    --text: #EAEAEA;
    --text-muted: #8A8A8A;
    --accent: #13EC80;
    --accent-text: #02170C;
    --accent-bg: #0A2216;
    --danger: #E5484D;
    --warning: #F5A524;
}

[data-theme="night_warm"] {
    --bg: #020202;
    --surface: #0F0D0A;
    --surface-2: #151210;
    --border: #28231D;
    --text: #EDE6DA;
    --text-muted: #A69C8D;
    --accent: #E0A458;
    --accent-text: #2E1C08;
    --accent-bg: #3A2A16;
    --danger: #C97064;
    --warning: #D9B36C;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

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

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

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar nav { flex: 1; }

.sidebar-bottom {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-restart {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-weight: 500;
    text-align: left;
}

.btn-restart:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.sidebar .brand {
    font-weight: 600;
    font-size: 16px;
    padding: 0 8px 20px;
}

.sidebar nav a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text);
    margin-bottom: 2px;
}

.sidebar nav a:hover { background: var(--surface-2); }
.sidebar nav a.active { background: var(--accent-bg); color: var(--accent); }
.sidebar nav a.disabled { color: var(--text-muted); cursor: default; }

.nav-item-tickets {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-bottom: 6px !important;
}

.ticket-alert {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 6px 8px;
    margin: 0 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    animation: ticket-pulse 1.8s ease-in-out infinite;
}
.ticket-alert[hidden] { display: none !important; }

.ticket-alert-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    animation: ticket-pulse 1.8s ease-in-out infinite;
}
.ticket-alert-dot[hidden] { display: none !important; }

@keyframes ticket-pulse {
    0%, 100% { opacity: .45; box-shadow: 0 0 2px var(--accent); }
    50% { opacity: 1; box-shadow: 0 0 16px var(--accent); }
}

.main { flex: 1; padding: 28px 32px; }

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.topbar form { margin: 0; }

select, input, textarea, button {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13px;
}

button, .btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    cursor: pointer;
    font-weight: 600;
}

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    position: relative;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.metric-value { font-size: 24px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-muted); font-weight: 500; text-transform: uppercase; font-size: 11px; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; background: var(--accent-bg); color: var(--accent); }
.badge-danger { background: #3A0A18; color: var(--danger); }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
}

.auth-card h1 { font-size: 18px; margin: 0 0 20px; }
.auth-card label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card input { width: 100%; }
.auth-card button { width: 100%; padding: 10px; margin-top: 6px; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.hint { color: var(--text-muted); font-size: 12px; margin-top: 14px; }
