/* ============================================================
   KOQOI ADMIN — Golden Poison Frog Theme
   Phyllobates terribilis: bright gold on deep black jungle
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand: Rana Dorada */
    --gold:      #F5C518;
    --gold-deep: #D97706;
    --gold-pale: #FEF9C3;
    --gold-glow: rgba(245,197,24,.25);

    /* Jungle Dark (sidebar) */
    --jungle:    #0F1008;
    --jungle-2:  #1A1B0D;
    --jungle-3:  #252618;

    /* Light background */
    --bg:        #FAFAF5;
    --surface:   #FFFFFF;
    --surface2:  #F5F5E8;

    /* Borders & text */
    --border:    #E5E2C4;
    --border-2:  #D4D09A;
    --text:      #1A1A0E;
    --text-2:    #44403C;
    --muted:     #78716C;

    /* Status colors */
    --success:   #16A34A;
    --danger:    #DC2626;
    --warning:   #D97706;
    --info:      #0891B2;

    /* Primary = gold */
    --primary:   var(--gold-deep);
    --primary-h: #B45309;

    --radius:    12px;
    --sidebar-w: 256px;
    --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,.1);
}

/* ─── RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Menlo','Consolas',monospace; font-size:.88em; background: var(--gold-pale); color: var(--gold-deep); padding: 1px 6px; border-radius: 4px; }

/* ─── LAYOUT ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: var(--jungle);
    display: flex; flex-direction: column;
    position: fixed; height: 100vh; overflow-y: auto; z-index: 100;
}
.main { margin-left: var(--sidebar-w); flex: 1; padding: 36px; background: var(--bg); min-height: 100vh; }

/* ─── SIDEBAR ─────────────────────────────────────────── */
.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--jungle-3);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-logo img {
    width: 40px; height: 40px; object-fit: contain;
    border-radius: 10px; background: var(--gold-pale); padding: 3px;
}
.sidebar-logo-text h2 { font-size: 15px; font-weight: 700; color: var(--gold); line-height: 1.2; letter-spacing: -.3px; }
.sidebar-logo-text span { font-size: 11px; color: #6B6B4A; }

.sidebar-nav { padding: 16px 10px; flex: 1; }
.nav-section { font-size: 10px; font-weight: 700; color: #4A4A30; text-transform: uppercase; letter-spacing: 1.4px; padding: 16px 10px 5px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px;
    color: #B8B89A; font-size: 13.5px; margin-bottom: 1px;
    transition: all .18s; font-weight: 500;
}
.nav-item:hover { background: var(--jungle-3); color: var(--gold); text-decoration: none; }
.nav-item.active {
    background: linear-gradient(135deg, rgba(245,197,24,.18), rgba(245,197,24,.06));
    color: var(--gold); font-weight: 600; border-left: 3px solid var(--gold);
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--jungle-3); }
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: 10px; cursor: pointer; transition: background .18s;
}
.sidebar-user:hover { background: var(--jungle-3); text-decoration: none; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: var(--jungle);
    overflow: hidden; flex-shrink: 0; border: 2px solid var(--gold-deep);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info strong { font-size: 13px; display: block; color: #E8E8C0; }
.user-info small  { display: block; font-size: 11px; color: #6B6B4A; }

/* ─── PAGE HEADER ─────────────────────────────────────── */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 28px; padding-bottom: 24px; border-bottom: 2px solid var(--border);
}
.page-header h1 { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-top: 4px; }
.breadcrumb a { color: var(--gold-deep); }

/* ─── STAT CARDS ─────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); }
.stat-card .value { font-size: 36px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 500; }
.stat-card .stat-icon { position:absolute; right:18px; top:18px; font-size:30px; opacity:.15; }

/* ─── CARD ─────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between; background: var(--surface2); }
.card-header h3 { font-size: 15px; font-weight: 700; }

/* ─── TABLE ─────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--surface2); padding:11px 16px; text-align:left; font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.7px; border-bottom:2px solid var(--border); white-space:nowrap; }
td { padding:13px 16px; border-bottom:1px solid var(--border); vertical-align:middle; color:var(--text-2); }
tr:last-child td { border-bottom:none; }
tr:hover td { background: var(--gold-pale); }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge { display:inline-flex; align-items:center; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
.badge-draft    { background:#F5F5F0; color:#78716C; border:1px solid #D5D5C0; }
.badge-review   { background:#FEF9C3; color:#854D0E; border:1px solid #FDE68A; }
.badge-approved { background:#DCFCE7; color:#15803D; border:1px solid #BBF7D0; }
.badge-rejected { background:#FEE2E2; color:#B91C1C; border:1px solid #FECACA; }
.badge-outdated { background:#FFF7ED; color:#C2410C; border:1px solid #FED7AA; }
.badge-easy     { background:#DCFCE7; color:#15803D; border:1px solid #BBF7D0; }
.badge-medium   { background:#FEF9C3; color:#854D0E; border:1px solid #FDE68A; }
.badge-hard     { background:#FEE2E2; color:#B91C1C; border:1px solid #FECACA; }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn { display:inline-flex; align-items:center; gap:7px; padding:9px 20px; border-radius:9px; font-size:14px; font-weight:600; cursor:pointer; border:none; transition:all .18s; text-decoration:none; white-space:nowrap; font-family:inherit; }
.btn-primary { background:linear-gradient(135deg, var(--gold), var(--gold-deep)); color:var(--jungle); box-shadow:0 2px 8px var(--gold-glow); }
.btn-primary:hover { background:linear-gradient(135deg, #FBBF24, #B45309); box-shadow:0 4px 16px var(--gold-glow); text-decoration:none; color:var(--jungle); }
.btn-success { background:linear-gradient(135deg,#16A34A,#15803D); color:#fff; }
.btn-success:hover { background:linear-gradient(135deg,#15803D,#14532D); text-decoration:none; color:#fff; }
.btn-accent  { background:linear-gradient(135deg,#0891B2,#0E7490); color:#fff; }
.btn-accent:hover { background:linear-gradient(135deg,#0E7490,#155E75); text-decoration:none; color:#fff; }
.btn-danger  { background:linear-gradient(135deg,#EF4444,#DC2626); color:#fff; }
.btn-danger:hover { background:linear-gradient(135deg,#DC2626,#B91C1C); text-decoration:none; color:#fff; }
.btn-secondary { background:var(--surface2); border:1px solid var(--border-2); color:var(--text-2); }
.btn-secondary:hover { background:var(--border); text-decoration:none; }
.btn-ghost { background:transparent; border:1px solid var(--border-2); color:var(--muted); }
.btn-ghost:hover { background:var(--gold-pale); color:var(--gold-deep); border-color:var(--gold-deep); text-decoration:none; }
.btn-sm { padding:5px 12px; font-size:12px; border-radius:7px; }

/* ─── FORMS ─────────────────────────────────────────────── */
.form-grid   { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.form-grid-3 { grid-template-columns:1fr 1fr 1fr; }
.form-full   { grid-column:1/-1; }
.form-group  { display:flex; flex-direction:column; gap:6px; }
label { font-size:13px; font-weight:600; color:var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
    background:var(--surface); border:1.5px solid var(--border); border-radius:9px;
    color:var(--text); padding:10px 14px; font-size:14px; width:100%;
    transition:border-color .18s, box-shadow .18s; font-family:inherit;
}
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--gold-deep); box-shadow:0 0 0 3px rgba(217,119,6,.15); }
textarea { resize:vertical; min-height:90px; }
.form-actions { display:flex; gap:12px; justify-content:flex-end; margin-top:24px; padding-top:20px; border-top:1px solid var(--border); }
.form-hint { font-size:12px; color:var(--muted); margin-top:3px; }

/* ─── FORM CARD ─────────────────────────────────────────── */
.form-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:28px; margin-bottom:20px; box-shadow:var(--shadow); }

/* ─── SECTION TITLE ─────────────────────────────────────── */
.section-title { font-size:12px; font-weight:700; color:var(--gold-deep); text-transform:uppercase; letter-spacing:1px; margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.section-title::after { content:''; flex:1; height:1px; background:var(--border); }

/* ─── CHECKBOX GRID ──────────────────────────────────────── */
.check-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(165px,1fr)); gap:8px; }
.check-item { display:flex; align-items:center; gap:8px; padding:9px 12px; border:1.5px solid var(--border); border-radius:9px; cursor:pointer; transition:all .18s; font-size:13px; background:var(--surface); }
.check-item:hover { border-color:var(--gold-deep); background:var(--gold-pale); }
.check-item input[type=checkbox] { accent-color:var(--gold-deep); width:15px; height:15px; flex-shrink:0; }
.check-item.checked { border-color:var(--gold-deep); background:var(--gold-pale); }

/* ─── FLASH ─────────────────────────────────────────────── */
.flash { padding:14px 18px; border-radius:10px; margin-bottom:20px; font-size:14px; font-weight:500; display:flex; align-items:center; gap:8px; }
.flash-success { background:#DCFCE7; border:1px solid #BBF7D0; color:#15803D; }
.flash-error   { background:#FEE2E2; border:1px solid #FECACA; color:#B91C1C; }

/* ─── FILTERS ────────────────────────────────────────────── */
.filters { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:20px; padding:14px 16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.filters select, .filters input { width:auto; }
.filters .spacer { flex:1; }

/* ─── PAGINATION ────────────────────────────────────────── */
.pagination { display:flex; gap:4px; justify-content:center; padding:20px 16px; }
.page-link { padding:6px 13px; border-radius:8px; border:1px solid var(--border); color:var(--muted); font-size:13px; font-weight:500; transition:all .15s; }
.page-link:hover { background:var(--gold-pale); color:var(--gold-deep); border-color:var(--gold-deep); text-decoration:none; }
.page-link.active { background:var(--gold-deep); border-color:var(--gold-deep); color:#fff; }

/* ─── AUTH ──────────────────────────────────────────────── */
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:radial-gradient(ellipse at 50% -10%, rgba(245,197,24,.15) 0%, var(--bg) 55%); }
.auth-card { background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:48px; width:100%; max-width:420px; box-shadow:0 20px 60px rgba(0,0,0,.1); }
.auth-card h1 { font-size:28px; font-weight:800; margin-bottom:6px; color:var(--text); }
.auth-card p  { color:var(--muted); margin-bottom:28px; font-size:14px; }

/* ─── AVATAR UPLOAD ─────────────────────────────────────── */
.avatar-upload { display:flex; align-items:center; gap:18px; }
.avatar-preview { width:72px; height:72px; border-radius:50%; background:linear-gradient(135deg,var(--gold),var(--gold-deep)); display:flex; align-items:center; justify-content:center; font-size:28px; font-weight:700; color:var(--jungle); overflow:hidden; flex-shrink:0; border:3px solid var(--gold); }
.avatar-preview img { width:100%; height:100%; object-fit:cover; }

/* ─── DROP ZONE ─────────────────────────────────────────── */
.drop-zone { border:2px dashed var(--border-2); border-radius:16px; padding:52px 32px; text-align:center; cursor:pointer; transition:all .2s; background:var(--surface2); display:block; }
.drop-zone:hover, .drop-zone.dragover { border-color:var(--gold-deep); background:var(--gold-pale); }
.drop-zone .dz-icon { font-size:52px; display:block; margin-bottom:12px; }
.drop-zone .dz-main { font-size:16px; font-weight:700; color:var(--text); }
.drop-zone .dz-sub  { font-size:13px; color:var(--muted); margin-top:4px; }
.drop-zone .dz-file { font-size:14px; font-weight:600; color:var(--gold-deep); margin-top:12px; }

/* ─── REVIEW CARD ───────────────────────────────────────── */
.review-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:28px; margin-bottom:16px; box-shadow:var(--shadow); }
.review-card .q-text { font-size:17px; font-weight:600; color:var(--text); margin-bottom:16px; line-height:1.55; }
.review-options { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:16px; }
.review-option { padding:10px 14px; border:1.5px solid var(--border); border-radius:9px; font-size:14px; display:flex; align-items:center; gap:8px; color:var(--text-2); }
.review-option.correct { border-color:var(--success); background:#DCFCE7; color:#15803D; font-weight:600; }
.review-actions { display:flex; gap:10px; padding-top:16px; border-top:1px solid var(--border); }

/* ─── PROGRESS ──────────────────────────────────────────── */
.progress-wrap { height:6px; background:var(--border); border-radius:10px; overflow:hidden; margin-bottom:20px; }
.progress-bar  { height:100%; background:linear-gradient(90deg,var(--gold),var(--gold-deep)); border-radius:10px; transition:width .4s; }

/* ─── HELPERS ────────────────────────────────────────────── */
.two-col   { display:grid; grid-template-columns:1fr 360px; gap:24px; align-items:start; }
.three-col { display:grid; grid-template-columns:1fr 1fr 1fr; gap:24px; }
.mt-4  { margin-top:16px; }
.mb-4  { margin-bottom:16px; }

/* ─── MULTI-SELECT ─────────────────────────────────────── */
.multiselect { position:relative; }
.ms-control {
    display:flex; flex-wrap:wrap; align-items:center; gap:5px;
    background:var(--surface); border:1.5px solid var(--border); border-radius:9px;
    padding:7px 10px; cursor:text; min-height:44px;
    transition:border-color .18s, box-shadow .18s;
}
.ms-control:focus-within, .multiselect.open .ms-control {
    border-color:var(--gold-deep); box-shadow:0 0 0 3px rgba(217,119,6,.15);
}
.ms-tag {
    display:inline-flex; align-items:center; gap:4px;
    background:var(--gold-pale); border:1px solid var(--gold-deep);
    color:var(--gold-deep); border-radius:6px; padding:2px 8px;
    font-size:12px; font-weight:600; white-space:nowrap; user-select:none;
}
.ms-tag-x { cursor:pointer; font-size:15px; line-height:1; opacity:.65; }
.ms-tag-x:hover { opacity:1; }
.ms-search {
    border:none; outline:none; background:transparent; font-size:14px;
    color:var(--text); flex:1; min-width:110px; font-family:inherit; padding:1px 2px;
}
.ms-dropdown {
    position:absolute; top:calc(100% + 4px); left:0; right:0;
    background:var(--surface); border:1.5px solid var(--border-2); border-radius:10px;
    box-shadow:var(--shadow-md); max-height:260px; overflow-y:auto;
    z-index:300; display:none;
}
.multiselect.open .ms-dropdown { display:block; }
.ms-group { padding:8px 12px 2px; font-size:10px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:1px; }
.ms-item {
    padding:9px 14px; cursor:pointer; font-size:13.5px;
    color:var(--text-2); display:flex; align-items:center; gap:8px; transition:background .12s;
}
.ms-item:hover { background:var(--gold-pale); }
.ms-item.is-sel { background:var(--gold-pale); color:var(--gold-deep); font-weight:600; }
.ms-item.is-sel::after { content:'✓'; margin-left:auto; font-size:11px; }
.ms-item.is-hidden { display:none; }
.ms-empty { padding:14px; color:var(--muted); font-size:13px; text-align:center; font-style:italic; }
.ms-placeholder { color:var(--muted); font-size:14px; align-self:center; pointer-events:none; }

/* ─── DRAFT BANNER ──────────────────────────────────────── */
.draft-banner {
    display:flex; align-items:center; gap:10px; padding:12px 16px;
    background:#FEF9C3; border:1px solid #FDE68A; border-radius:10px;
    margin-bottom:20px; font-size:13px; font-weight:500; color:#854D0E;
}
.draft-banner button { margin-left:auto; background:none; border:1px solid #FDE68A; border-radius:7px; padding:4px 12px; cursor:pointer; font-size:12px; color:#854D0E; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1100px) { .form-grid-3 { grid-template-columns:1fr 1fr; } }
@media (max-width: 900px)  { .two-col, .three-col { grid-template-columns:1fr; } }
@media (max-width: 768px) {
    .sidebar { display:none; }
    .main { margin-left:0; padding:16px; }
    .form-grid, .form-grid-3 { grid-template-columns:1fr; }
    .stats-grid { grid-template-columns:1fr 1fr; }
    .review-options { grid-template-columns:1fr; }
}

