:root {
    --bg-dark: #0b1021;
    --bg-card: rgba(15, 18, 38, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.02);
    --accent-primary: #f8d04b;
    --accent-secondary: #d89b00;
    --accent-glow: rgba(248, 208, 75, 0.3);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #f87171;
    --border-color: rgba(255, 255, 255, 0.08);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 20px 70px rgba(0, 0, 0, 0.5);
    --font-main: "Space Grotesk", system-ui, -apple-system, sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Compatibility aliases used by older page-local styles. */
    --accent: var(--accent-primary);
    --accent-primary-rgb: 248, 208, 75;
    --muted: var(--text-muted);
    --primary: var(--accent-primary);
    --radius: var(--radius-md);
    --text: var(--text-main);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    background: radial-gradient(circle at 20% 20%, #1d2b64, #090b27 35%), var(--bg-dark);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

.skip-link {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 1000;
    padding: 10px 14px;
    background: var(--accent-primary);
    color: #0b0a16;
    border-radius: var(--radius-sm);
}

.skip-link:focus { top: 12px; }

:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 3px;
}

/* Layout Utilities */
.shell {
    width: min(1200px, 95%);
    margin: 32px auto;
    padding: 0 16px;
    flex: 1;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

/* Components */
.card {
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 14px;
    gap: 8px;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: #0b0a16;
    box-shadow: 0 4px 14px 0 var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

/* Forms */
label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

form {
    display: grid;
    gap: 18px;
}

form .grid {
    gap: 16px;
}

button:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: #0b0a16;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--accent-glow);
    transition: var(--transition);
}

button:not(.btn):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--accent-glow);
}

button:not(.btn):active {
    transform: translateY(0);
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 16, 33, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.nav-content {
    width: min(1200px, 95%);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand span {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    background-clip: text;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

@media (max-width: 900px) {
    .nav-content { align-items: flex-start; gap: 12px; }
    .nav-links { flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
    .shell { width: 100%; margin: 18px auto; padding: 0 12px; }
    .card { padding: 16px; }
    .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
    .flex-between { align-items: flex-start; flex-wrap: wrap; }
}

@media (max-width: 560px) {
    .nav-content { display: block; }
    .nav-brand { margin-bottom: 10px; }
    .nav-links { justify-content: flex-start; }
    .nav-links .badge-neutral { display: none; }
    .title { font-size: 24px; }
    input, select, textarea, button, .btn { min-height: 44px; }
    th, td { padding: 12px 10px; }
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    padding: 8px 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 99px;
    box-shadow: 0 0 10px var(--accent-primary);
}

/* Dashboard items */
.stat-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: var(--transition);
    text-decoration: none;
}

.stat-card:hover {
    border-color: rgba(94, 234, 212, 0.3);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    transform: translateY(-2px);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin: 8px 0;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(94, 234, 212, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--accent-primary);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-neutral {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: start;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: #34d399;
}
