/* ==========================================================
   SHELF SHOWDOWN — Admin Dashboard
   ========================================================== */
:root {
    --bg:        #1a1a2e;
    --bg-soft:   #24243e;
    --card:      #2b2b47;
    --border:    #3a3a5c;
    --text:      #f5f5f5;
    --muted:     #9aa0b4;
    --gold:      #f39c12;
    --red:       #e74c3c;
    --blue:      #3498db;
    --yellow:    #f1c40f;
    --green:     #27ae60;
}

* { box-sizing: border-box; }

body.admin {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', 'Arial', sans-serif;
    min-height: 100vh;
}

/* ---------- Header ---------- */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: var(--bg-soft);
    border-bottom: 2px solid var(--gold);
}
.admin-header h1 {
    margin: 0;
    font-size: 22px;
    color: var(--gold);
}
.admin-header h1 span {
    color: var(--muted);
    font-size: 16px;
    font-weight: 400;
    margin-left: 12px;
}

/* ---------- Flash ---------- */
.flash {
    margin: 16px 30px;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
}
.flash-success { background: #1e5c3a; border-left: 6px solid var(--green); }
.flash-error   { background: #5c1e1e; border-left: 6px solid var(--red); }

/* ---------- Layout ---------- */
.admin-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    padding: 20px 30px;
    align-items: start;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--bg-soft);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.sidebar h2 {
    margin: 0 0 16px;
    font-size: 18px;
    color: var(--gold);
    letter-spacing: 1px;
}
.sidebar h3 {
    font-size: 14px;
    color: var(--muted);
    margin: 20px 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sidebar hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.quiz-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.quiz-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--card);
}
.quiz-list li.active { background: #3d3d60; box-shadow: inset 3px 0 0 var(--gold); }
.quiz-list li a:first-child {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}
.quiz-list li a:first-child:hover { background: rgba(255,255,255,.05); }
.quiz-list .count {
    font-size: 12px;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}
.quiz-list .del {
    color: var(--red);
    text-decoration: none;
    padding: 8px 12px;
    font-weight: 900;
    font-size: 14px;
}
.quiz-list .del:hover { background: rgba(231,76,60,.2); }

.empty { color: var(--muted); font-style: italic; font-size: 14px; }

.stats {
    font-size: 13px;
    color: var(--muted);
}
.stats p { margin: 4px 0; }

/* ---------- Forms ---------- */
.form-inline {
    display: flex;
    gap: 8px;
}
.form-inline input {
    flex: 1;
    min-width: 0;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}
textarea { resize: vertical; }

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--gold);
    border-color: var(--gold);
}

label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .5px;
}
label > input,
label > textarea,
label > select {
    margin-top: 6px;
    font-weight: 400;
    color: var(--text);
}

/* ---------- Main ---------- */
.main { min-height: 100vh; }
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.main-header h2 {
    margin: 0;
    color: var(--gold);
    font-size: 26px;
}
.main-header .muted {
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.empty-main {
    text-align: center;
    padding: 100px 20px;
    background: var(--bg-soft);
    border-radius: 12px;
    border: 1px dashed var(--border);
    color: var(--muted);
}
.empty-main h2 { color: var(--text); }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.card h3 {
    margin: 0 0 20px;
    color: var(--gold);
    font-size: 18px;
    letter-spacing: 1px;
}

/* ---------- Question form ---------- */
.grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.opt-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.opt-label .opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-weight: 900;
    color: #1a1a2e;
    flex-shrink: 0;
}
.opt-a .opt-letter { background: var(--red); }
.opt-b .opt-letter { background: var(--blue); color: #fff; }
.opt-c .opt-letter { background: var(--yellow); }
.opt-d .opt-letter { background: var(--green); color: #fff; }
.opt-label input { flex: 1; }

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.btn:hover { background: #363659; border-color: var(--gold); }
.btn-gold {
    background: var(--gold);
    color: #1a1a2e;
    border-color: var(--gold);
}
.btn-gold:hover { background: #d68910; }
.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------- Question list ---------- */
.question-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.question-list li {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}
.question-list li:last-child { border-bottom: none; }
.q-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.q-content { flex: 1; }
.q-text {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.4;
}
.q-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--card);
    border: 1px solid var(--border);
}
.chip b {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    text-align: center;
    line-height: 18px;
    color: #1a1a2e;
    font-size: 11px;
}
.chip-a b { background: var(--red); }
.chip-b b { background: var(--blue); color: #fff; }
.chip-c b { background: var(--yellow); }
.chip-d b { background: var(--green); color: #fff; }
.chip-correct {
    border-color: var(--green);
    background: rgba(39,174,96,.18);
    color: #7ef0ad;
    font-weight: 700;
}
.q-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}