:root {
    --color-bg: #0a0a0a;
    --color-surface: #111111;
    --color-surface-2: #1a1a1a;
    --color-border: #1f1f1f;
    --color-accent: #dc2626;
    --color-accent-hover: #b91c1c;
    --color-text: #e5e5e5;
    --color-muted: #6b7280;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #dc2626; }

::selection { background: rgba(220, 38, 38, 0.35); color: #fff; }

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    background-color: #dc2626;
    color: #fff;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background-color 0.15s, transform 0.1s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover { background-color: #b91c1c; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    background-color: transparent;
    color: #e5e5e5;
    border: 1px solid #2a2a2a;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: border-color 0.15s, color 0.15s, transform 0.1s;
    cursor: pointer;
    text-decoration: none;
}
.btn-secondary:hover { border-color: #dc2626; color: #dc2626; transform: translateY(-1px); }

/* Nav links */
.nav-link {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s, background-color 0.15s;
    text-decoration: none;
}
.nav-link:hover { color: #fff; background-color: #1a1a1a; }
.nav-link.active { color: #dc2626; background-color: rgba(220, 38, 38, 0.1); }

/* Cards */
.cyber-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cyber-card:hover {
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.08);
}

/* Difficulty badges */
.diff-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-easy   { background: rgba(34, 197, 94, 0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-medium { background: rgba(234, 179, 8, 0.15);  color: #facc15; border: 1px solid rgba(234,179,8,0.3); }
.badge-hard   { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.badge-insane { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }

/* Category badge */
.cat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Form inputs */
.form-input {
    width: 100%;
    background-color: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    color: #e5e5e5;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.form-input::placeholder { color: #4b5563; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.375rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Flash messages */
.flash-msg {
    animation: slideIn 0.25s ease-out;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero-bg {
    background:
        radial-gradient(ellipse 60% 50% at 50% -10%, rgba(220,38,38,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(124,58,237,0.08) 0%, transparent 60%),
        #0a0a0a;
}

.glitch {
    position: relative;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
}
.glitch::before {
    color: #dc2626;
    animation: glitch1 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
    transform: translate(-2px, 0);
    opacity: 0.7;
}
.glitch::after {
    color: #7c3aed;
    animation: glitch2 2.5s infinite linear alternate-reverse;
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    transform: translate(2px, 0);
    opacity: 0.5;
}
@keyframes glitch1 {
    0%,90%,100% { transform: translate(-2px,0) skewX(0deg); }
    91%,93%     { transform: translate(-4px,0) skewX(-2deg); }
    92%         { transform: translate(4px,0) skewX(2deg); }
}
@keyframes glitch2 {
    0%,88%,100% { transform: translate(2px,0) skewX(0deg); }
    89%,92%     { transform: translate(4px,0) skewX(1deg); }
    90%         { transform: translate(-4px,0) skewX(-1deg); }
}

/* Pulse dot */
.pulse-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50%     { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

/* Three.js canvas — standalone (map.php) */
#ctf-map-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}
#ctf-map-canvas:active { cursor: grabbing; }

/* Challenge card */
.challenge-card {
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.challenge-card:hover {
    border-color: rgba(220, 38, 38, 0.3) !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(220,38,38,0.08);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Modal */
#node-modal {
    backdrop-filter: blur(4px);
}

/* Scoreboard podium */
.rank-gold   { color: #fbbf24; }
.rank-silver { color: #94a3b8; }
.rank-bronze { color: #d97706; }

/* Solved challenge overlay */
.solved-overlay {
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34,197,94,0.5);
    border-radius: 9999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    color: #4ade80;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    background: #111;
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid #1f1f1f;
}
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #141414;
    color: #d1d5db;
    vertical-align: middle;
}
.data-table tr:hover td { background-color: rgba(255,255,255,0.02); }
.data-table tr.current-user td { background-color: rgba(220,38,38,0.06); }

/* Code / flag input */
.flag-input {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.03em;
}

/* Loading spinner */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Flag input shake on wrong answer */
@keyframes flag-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.flag-shake { animation: flag-shake 0.45s ease; }

/* ═══════════════════════════════════════════════════════════
   LAB PANEL
   ═══════════════════════════════════════════════════════════ */

.lab-panel {
    border: 1px solid #2a2a2a;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #080808;
}

.lab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background: #0d0d0d;
    border-bottom: 1px solid #1f1f1f;
}

.lab-status-active {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #4ade80;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 9999px;
    padding: 0.1rem 0.6rem;
    animation: lab-pulse 2s infinite;
}
.lab-status-solved {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #4ade80;
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.4);
    border-radius: 9999px;
    padding: 0.1rem 0.6rem;
}
@keyframes lab-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

.lab-address-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: #0a0a0a;
    border-bottom: 1px solid #141414;
}

/* Workspace — where the simulated app lives */
.lab-workspace {
    padding: 1.5rem;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lab-app-container {
    width: 100%;
    max-width: 380px;
}

.lab-app-card {
    background: #0f0f0f;
    border: 1px solid #222;
    border-radius: 0.75rem;
    padding: 2rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lab-app-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.lab-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    background: transparent;
}

.lab-input-group { display: flex; flex-direction: column; gap: 0.3rem; }

.lab-label {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lab-input {
    width: 100%;
    background: #080808;
    border: 1px solid #2a2a2a;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: #e5e5e5;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: border-color 0.15s;
}
.lab-input:focus { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,0.12); }

.lab-submit-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: #1a0a0a;
    color: #dc2626;
    border: 1px solid #3a1212;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 0.25rem;
}
.lab-submit-btn:hover { background: #220c0c; border-color: #dc2626; }
.lab-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* XSS lab */
.lab-xss-app {
    width: 100%;
    background: #0f0f0f;
    border: 1px solid #222;
    border-radius: 0.75rem;
    overflow: hidden;
}
.lab-xss-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #1a1a1a;
}
.lab-xss-results {
    min-height: 80px;
    padding: 0.875rem 1rem;
    border-top: 1px solid #141414;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}
.lab-reflect-safe   { color: #9ca3af; }
.lab-reflect-xss    { }
.lab-xss-popup {
    display: inline-block;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    color: #ef4444;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    animation: xss-flash 0.4s ease;
}
@keyframes xss-flash {
    0%,100% { opacity:1; }
    25%      { opacity:0; }
    75%      { opacity:0; }
}
.lab-xss-payload { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: #f97316; }

/* CMD lab */
.lab-cmd-app {
    width: 100%;
    background: #050505;
    border: 1px solid #1a2a1a;
    border-radius: 0.5rem;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
}
.lab-cmd-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0a140a;
    border-bottom: 1px solid #1a2a1a;
}

/* SSTI output */
.lab-ssti-result {
    padding: 0.75rem;
    background: #0a0a1a;
    border: 1px solid #1a1a3a;
    border-radius: 0.375rem;
    text-align: center;
}

/* Console */
.lab-console {
    border-top: 1px solid #141414;
    background: #050505;
}
.lab-console-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid #0d0d0d;
}
.lab-console-body {
    padding: 0.75rem 1rem;
    max-height: 220px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.6;
}
.lab-console-line { display: block; white-space: pre-wrap; word-break: break-all; }

/* Solved banner */
.lab-solved-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }

/* ═══════════════════════════════════════════════════════════
   SIMULATION / TERMINAL AESTHETIC
   ═══════════════════════════════════════════════════════════ */

/* Terminal dot indicators */
.t-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.t-dot-red    { background: #ff5f57; }
.t-dot-yellow { background: #ffbd2e; }
.t-dot-green  { background: #28ca41; }

/* Terminal output line types */
.t-line { display: block; font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.t-ok    { color: #4ade80; }
.t-err   { color: #f87171; }
.t-info  { color: #60a5fa; }
.t-warn  { color: #facc15; }
.t-muted { color: #2d2d2d; }
.t-input { color: #6b7280; }

@keyframes awaiting-blink { 0%,49%{opacity:1} 50%,100%{opacity:0.45} }
.flag-awaiting-blink { animation: awaiting-blink 1.4s infinite; }

/* ─── Simulation Challenge Cards ─────────────────────────── */
.sim-card {
    background: #050505;
    border: 1px solid #141414;
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.sim-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--cat-color, #dc2626);
    opacity: 0.2;
    transition: opacity 0.2s, box-shadow 0.2s;
}
.sim-card:hover {
    border-color: rgba(220,38,38,0.18);
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
    transform: translateY(-1px);
    text-decoration: none;
}
.sim-card:hover::after { opacity: 1; box-shadow: 0 0 12px var(--cat-color, #dc2626); }
.sim-card.solved-card  { border-color: rgba(34,197,94,0.1); }
.sim-card.solved-card::after { background: #22c55e; opacity: 0.45; }
.sim-card.solved-card:hover::after { opacity: 1; box-shadow: 0 0 12px #22c55e; }

.sim-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.875rem 0.375rem 0.875rem;
    background: #080808;
    border-bottom: 1px solid #0d0d0d;
    font-family: 'JetBrains Mono', monospace;
    gap: 0.5rem;
    min-height: 0;
}
.sim-card-num  { font-size: 0.58rem; color: #222; font-weight: 700; flex-shrink: 0; }
.sim-card-cat  { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; flex: 1; }

.sim-card-body { padding: 0.75rem 0.875rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.sim-card-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #c9c9c9;
    line-height: 1.35;
    transition: color 0.15s;
}
.sim-card:hover .sim-card-title { color: #fff; }
.solved-card .sim-card-title    { color: #86efac; }
.sim-card-desc { font-size: 0.68rem; color: #2e2e2e; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sim-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.875rem;
    border-top: 1px solid #0d0d0d;
    background: #080808;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
}
.sim-pts          { color: #facc15; font-weight: 700; font-size: 0.68rem; }
.sim-solve-count  { color: #222; font-size: 0.6rem; }
.sim-status-badge { font-size: 0.55rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 2px; letter-spacing: 0.06em; }
.sim-solved { color: #4ade80; background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.18); }
.sim-locked { color: #1e1e1e; background: #070707; border: 1px solid #111; }

/* ─── CTF Page Header (terminal style) ───────────────────── */
.ctf-page-header {
    background: #050505;
    border: 1px solid #141414;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.ctf-page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.875rem;
    background: #080808;
    border-bottom: 1px solid #0e0e0e;
}
.ctf-page-header-body { padding: 0.75rem 1rem 0.875rem; }

/* ─── Category Filter Chips ──────────────────────────────── */
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.625rem;
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.15s;
    background: #080808;
    color: #3a3a3a;
    border: 1px solid #111;
    white-space: nowrap;
    line-height: 1.5;
}
.cat-chip:hover  { color: #9ca3af; border-color: #222; background: #0d0d0d; }
.cat-chip.active { color: #dc2626; background: rgba(220,38,38,0.07); border-color: rgba(220,38,38,0.28); }
.cat-chip-count  { color: #1e1e1e; font-size: 0.58rem; }
.cat-chip.active .cat-chip-count { color: rgba(220,38,38,0.4); }

/* ─── Flag Terminal ───────────────────────────────────────── */
.flag-terminal {
    background: #030303;
    border: 1px solid #141414;
    border-radius: 0.5rem;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
}
.flag-terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: #070707;
    border-bottom: 1px solid #0e0e0e;
}
.flag-terminal-titlename { font-size: 0.63rem; color: #333; margin-left: 0.375rem; }
.flag-terminal-output {
    padding: 0.625rem 1rem;
    min-height: 2.5rem;
    max-height: 130px;
    overflow-y: auto;
}
.flag-terminal-prompt {
    display: flex;
    align-items: center;
    padding: 0.2rem 0.875rem 0.625rem;
    border-top: 1px solid #0a0a0a;
    gap: 0;
}
.flag-prompt-user   { color: #4ade80; font-size: 0.76rem; font-weight: 600; }
.flag-prompt-at     { color: #1e1e1e; font-size: 0.76rem; }
.flag-prompt-host   { color: #60a5fa; font-size: 0.76rem; }
.flag-prompt-sep    { color: #1a1a1a; font-size: 0.76rem; }
.flag-prompt-path   { color: #818cf8; font-size: 0.76rem; }
.flag-prompt-dollar { color: #4b5563; font-size: 0.76rem; margin: 0 0.4rem 0 0.1rem; }
.flag-terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e5e5e5;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    caret-color: #dc2626;
    min-width: 0;
}
.flag-terminal-input::placeholder { color: #191919; }
.flag-terminal-submit {
    flex-shrink: 0;
    margin-left: 0.5rem;
    padding: 0.28rem 0.75rem;
    background: #0d0202;
    color: #dc2626;
    border: 1px solid #1c0606;
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.15s;
}
.flag-terminal-submit:hover { background: #160404; border-color: #dc2626; box-shadow: 0 0 8px rgba(220,38,38,0.2); }
.flag-terminal-submit:disabled { opacity: 0.3; cursor: not-allowed; }
.flag-format-hint-line { padding: 0 1rem 0.5rem; font-size: 0.63rem; font-family: 'JetBrains Mono', monospace; }

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════ */

.admin-sidebar {
    width: 216px;
    min-width: 216px;
    background: #0a0a0a;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.475rem 1.25rem;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    letter-spacing: 0.01em;
}
.admin-nav-link:hover  { color: #d1d5db; background: rgba(255,255,255,0.03); text-decoration: none; }
.admin-nav-link.active { color: #dc2626; background: rgba(220,38,38,0.07); border-left-color: #dc2626; }
.admin-nav-link svg { flex-shrink: 0; opacity: 0.5; transition: opacity 0.15s; }
.admin-nav-link:hover svg { opacity: 0.9; }
.admin-nav-link.active svg { opacity: 1; }

.admin-main { flex: 1; padding: 1.5rem 2rem; overflow: auto; min-width: 0; }

.admin-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid #1a1a1a;
}
.admin-page-title    { font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; font-weight: 700; color: #e5e5e5; }
.admin-page-subtitle { font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; color: #6b7280; margin-top: 0.2rem; }

.admin-stat-card {
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    border-radius: 0.375rem;
    padding: 1.125rem 1.25rem;
    position: relative;
    overflow: hidden;
}
.admin-stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent, #dc2626) 50%, transparent);
    opacity: 0.4;
}
.admin-stat-value { font-family: 'JetBrains Mono', monospace; font-size: 1.875rem; font-weight: 700; color: #e5e5e5; line-height: 1; letter-spacing: -0.02em; }
.admin-stat-label { font-family: 'JetBrains Mono', monospace; font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: #6b7280; margin-top: 0.5rem; }
.admin-stat-bg-icon { position: absolute; right: 0.875rem; top: 50%; transform: translateY(-50%); opacity: 0.06; }

.admin-card { background: #0d0d0d; border: 1px solid #1a1a1a; border-radius: 0.375rem; overflow: hidden; }
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6875rem 1.25rem;
    border-bottom: 1px solid #141414;
    background: #111111;
}
.admin-card-title { font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.09em; }
.admin-card-body  { padding: 1.125rem 1.25rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.admin-table thead th {
    padding: 0.5rem 1rem;
    background: #111111;
    color: #6b7280;
    font-size: 0.58rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid #1a1a1a;
    text-align: left;
    white-space: nowrap;
}
.admin-table tbody tr { border-bottom: 1px solid #141414; transition: background 0.1s; }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.admin-table tbody td { padding: 0.575rem 1rem; color: #9ca3af; vertical-align: middle; }

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.57rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.admin-badge-active   { color: #4ade80; background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2); }
.admin-badge-inactive { color: #6b7280; background: #111; border: 1px solid #1f1f1f; }
.admin-badge-admin    { color: #a78bfa; background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.2); }
.admin-badge-user     { color: #6b7280; background: #111; border: 1px solid #1f1f1f; }
.admin-badge-ok       { color: #4ade80; }
.admin-badge-fail     { color: #f87171; }

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.22rem 0.6rem;
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
}
.admin-btn-edit    { background: #111; color: #9ca3af; border-color: #1f1f1f; }
.admin-btn-edit:hover { color: #e5e5e5; border-color: #374151; text-decoration: none; }
.admin-btn-on      { background: #0a160a; color: #4ade80; border-color: #14281e; }
.admin-btn-on:hover  { border-color: rgba(34,197,94,0.4); }
.admin-btn-off     { background: #160a0a; color: #f87171; border-color: #2a1414; }
.admin-btn-off:hover { border-color: rgba(248,113,113,0.4); }
.admin-btn-danger  { background: #130303; color: #ef4444; border-color: #2a0808; }
.admin-btn-danger:hover { border-color: rgba(220,38,38,0.5); }
.admin-btn-primary { background: #1a0606; color: #dc2626; border-color: #2d0b0b; }
.admin-btn-primary:hover { border-color: #dc2626; box-shadow: 0 0 8px rgba(220,38,38,0.15); text-decoration: none; }

.admin-action-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: #111;
    border: 1px solid #1a1a1a;
    border-radius: 0.375rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s;
}
.admin-action-link:hover { color: #d1d5db; border-color: #2a2a2a; background: #161616; text-decoration: none; }
.admin-action-link .a-icon { color: #374151; transition: color 0.15s; flex-shrink: 0; }
.admin-action-link:hover .a-icon { color: #dc2626; }

.admin-activity-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid #111; font-size: 0.75rem; }
.admin-activity-row:last-child { border-bottom: none; padding-bottom: 0; }

.admin-form-section { background: #0d0d0d; border: 1px solid #1a1a1a; border-radius: 0.375rem; overflow: hidden; margin-bottom: 1.25rem; }
.admin-form-section-header { padding: 0.6rem 1.25rem; border-bottom: 1px solid #141414; background: #111; font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.09em; }
.admin-form-body { padding: 1.25rem; display: grid; gap: 1rem; }

.admin-filter-input {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 2px;
    padding: 0.35rem 0.75rem;
    color: #d1d5db;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    outline: none;
    transition: border-color 0.15s;
}
.admin-filter-input:focus { border-color: rgba(220,38,38,0.4); }
