:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-2: #242836;
    --border: #2e3348;
    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --green: #22c55e;
    --red: #ef4444;
    --gold: #eab308;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}
.admin-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.plate-logo {
    display: inline-block;
    background: #1e2028;
    color: #c8ccd4;
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.75rem 0.25rem;
    border-radius: 4px;
    border: 1px solid #3a3d48;
    line-height: 1.3;
}
a .plate-logo, a:visited .plate-logo, a:hover .plate-logo {
    color: #c8ccd4;
}
.admin-links { display: flex; gap: 1.5rem; }
.admin-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.admin-links a:hover, .admin-links a.active { color: var(--text); border-bottom-color: var(--accent); }
.admin-main { flex: 1; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }

h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.2rem; margin-bottom: 1rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.3rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.7rem 1rem; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); }
tr:hover { background: var(--surface-2); }

input[type="number"], input[type="text"], select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    outline: none;
}
input:focus { border-color: var(--accent); }

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: white; }
.btn-success { background: var(--green); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert { padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.alert-error { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

.histogram { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin: 1rem 0; }
.histogram-bar {
    flex: 1;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    min-width: 4px;
    transition: height 0.3s;
    position: relative;
}
.histogram-bar:hover { opacity: 0.8; }

.blazor-error-boundary { background: var(--red); padding: 1rem; color: white; border-radius: var(--radius); }
.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui { display: none; background: var(--red); color: white; padding: 0.5rem 1rem; position: fixed; bottom: 0; width: 100%; z-index: 100; text-align: center; }
