@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --ink: #080a0f;
    --surface: #10141d;
    --surface-2: #161c28;
    --line: rgba(255, 255, 255, 0.08);
    --line-light: rgba(255, 255, 255, 0.15);
    --text: #f3f4f6;
    --muted: #94a3b8;
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --ok: #10b981;
}

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

body {
    background: var(--ink);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    line-height: 1.6;
}

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

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

.sidebar {
    width: 250px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 28px 18px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 32px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar .brand .brand-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold) 0%, #ea580c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 900;
    font-size: 0.8rem;
}
.sidebar .brand span { color: var(--gold); }

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: var(--surface-2);
    color: #ffffff;
    border-left: 3px solid var(--gold);
}

.sidebar .logout {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.main {
    flex: 1;
    padding: 40px 48px;
    max-width: 1100px;
}

.main h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: #ffffff;
}

.main .subtitle {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 0.96rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

table { width: 100%; border-collapse: collapse; }
table th, table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}
table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .main { padding: 24px 16px; }
    .sidebar { width: 70px; padding: 16px 8px; }
    .sidebar .brand span, .sidebar nav a span { display: none; }
}

label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=file],
input[type=url],
textarea,
select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.94rem;
    transition: all 0.2s ease;
}

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

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--gold);
    color: #080a0f;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn:hover {
    background: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.btn.secondary {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
}
.btn.secondary:hover {
    border-color: var(--gold);
    color: #ffffff;
}
.btn.danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.btn.danger:hover {
    background: var(--danger);
    color: #ffffff;
}
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--line);
}
.badge.on {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}
.badge.off {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 22px;
    font-size: 0.94rem;
}
.alert.ok {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}
.alert.err {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--line-light);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

