/* ============================================================================
   Summer Privileges — admin panel
   ========================================================================== */

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

:root {
    --ink:      #e9e6e0;
    --ink-dim:  #98918a;
    --surface:  #14120f;
    --surface-2:#1c1a16;
    --line:     rgba(255, 255, 255, 0.09);
    --gold:     #e0ab45;
    --gold-2:   #f6d98a;
    --ok:       #3ec27a;
    --warn:     #f0b23f;
    --danger:   #e0574f;
    --radius:   12px;
}

*, *::before, *::after { box-sizing: border-box; }

body.admin {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr);
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    background: #0b0a08;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--gold); }

/* ---------------------------------------------------------------- sidebar */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .brand { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.5rem; }
.sidebar .brand img { width: 38px; }
.sidebar .brand strong { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.3; }

.sidebar nav { display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 9px;
    color: var(--ink-dim);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.12s ease, color 0.12s ease;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.sidebar nav a.active {
    background: linear-gradient(90deg, rgba(224, 171, 69, 0.2), rgba(224, 171, 69, 0.04));
    color: #ffd98a;
    box-shadow: inset 2px 0 0 var(--gold);
}
.sidebar nav .group {
    margin: 0.9rem 0 0.25rem;
    padding: 0 0.75rem;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6d675f;
}

.sidebar .who {
    margin-top: auto;
    padding: 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
}
.sidebar .who span { color: var(--ink-dim); display: block; font-size: 0.7rem; }

/* ------------------------------------------------------------------- main */
.main { padding: 2rem 2.25rem 4rem; min-width: 0; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}
.page-head h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.page-head p { margin: 0.25rem 0 0; color: var(--ink-dim); font-size: 0.85rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.stat .value { font-size: 1.85rem; font-weight: 600; line-height: 1.1; }
.stat .label { color: var(--ink-dim); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.35rem; }
.stat.gold .value     { color: var(--gold-2); }
.stat.platinum .value { color: #9fc0ff; }

.box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.box > h2 {
    margin: 0 0 1.15rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.box > h2 .sub { color: var(--ink-dim); font-weight: 400; font-size: 0.8rem; margin-left: 0.5rem; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.data th, table.data td { padding: 0.75rem 0.85rem; text-align: left; vertical-align: middle; }
table.data thead th {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-dim);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.03em; }

/* ------------------------------------------------------------------ chips */
.chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.chip-gold     { background: rgba(224, 171, 69, 0.16); color: #f0c877; border: 1px solid rgba(224, 171, 69, 0.4); }
.chip-platinum { background: rgba(110, 160, 255, 0.14); color: #a8c6ff; border: 1px solid rgba(110, 160, 255, 0.38); }
.chip-active    { background: rgba(62, 194, 122, 0.14); color: #7fe0ab; border: 1px solid rgba(62, 194, 122, 0.38); }
.chip-suspended { background: rgba(224, 87, 79, 0.14); color: #f3a49e; border: 1px solid rgba(224, 87, 79, 0.38); }
.chip-expired   { background: rgba(150, 150, 150, 0.14); color: #bdb8b1; border: 1px solid rgba(150, 150, 150, 0.35); }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn-sm { padding: 0.32rem 0.65rem; font-size: 0.76rem; }
.btn-gold {
    background: linear-gradient(140deg, #d19f33, #f3cf72 50%, #d19f33);
    color: #2a1c02;
    font-weight: 600;
    border-color: transparent;
}
.btn-gold:hover { filter: brightness(1.07); background: linear-gradient(140deg, #d19f33, #f3cf72 50%, #d19f33); }
.btn-danger { border-color: rgba(224, 87, 79, 0.5); color: #f3a49e; }
.btn-danger:hover { background: rgba(224, 87, 79, 0.18); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.15rem;
}
.form-grid .full { grid-column: 1 / -1; }

label { display: block; font-size: 0.78rem; color: var(--ink-dim); }
label .req { color: var(--gold); }

input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="number"], input[type="search"],
input[type="tel"], select, textarea {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #0e0d0b;
    color: var(--ink);
    font: inherit;
    font-size: 0.88rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(224, 171, 69, 0.15);
}
textarea { resize: vertical; min-height: 5.5rem; }
select option { background: #14120f; }

.check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--ink);
    padding: 0.6rem 0;
}
.check input { margin-top: 0.25rem; }
.check small { display: block; color: var(--ink-dim); font-size: 0.76rem; }

.form-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.25rem;
}
.filters label { flex: 1 1 150px; max-width: 240px; }
.filters .btn { margin-bottom: 0.05rem; }

/* ----------------------------------------------------------------- alerts */
.alert { border-radius: 10px; padding: 0.85rem 1.1rem; margin-bottom: 1.25rem; font-size: 0.86rem; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-ok    { background: rgba(62, 194, 122, 0.12); border: 1px solid rgba(62, 194, 122, 0.4); color: #a5edc7; }
.alert-error { background: rgba(224, 87, 79, 0.12);  border: 1px solid rgba(224, 87, 79, 0.45); color: #f5b8b3; }
.alert-warn  { background: rgba(240, 178, 63, 0.12); border: 1px solid rgba(240, 178, 63, 0.45); color: #ffdca6; }
.alert-info  { background: rgba(110, 160, 255, 0.12); border: 1px solid rgba(110, 160, 255, 0.4); color: #c3d8ff; }

.muted { color: var(--ink-dim); font-size: 0.8rem; }

/* ------------------------------------------------------------- pagination */
.pager { display: flex; gap: 0.35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 0.4rem 0.75rem;
    border-radius: 7px;
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink-dim);
    font-size: 0.8rem;
}
.pager .current { background: var(--gold); color: #2a1c02; border-color: transparent; font-weight: 600; }

/* --------------------------------------------------------- sortable list */
.sortable { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.sortable li {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
}
.sortable .num {
    display: grid;
    place-items: center;
    width: 2.1rem; height: 2.35rem;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(150deg, #8a5f16, #f3cf72 45%, #d19f33);
    color: #241800;
    font-weight: 700;
    font-size: 0.8rem;
}
.sortable .off { opacity: 0.45; }

/* ------------------------------------------------------------ login page */
body.admin-login {
    display: grid;
    place-items: center;
    grid-template-columns: 1fr;
    min-height: 100vh;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(110% 70% at 12% 10%, rgba(255, 176, 48, 0.16) 0%, transparent 55%),
        radial-gradient(90% 60% at 90% 85%, rgba(255, 150, 20, 0.1) 0%, transparent 60%),
        #0b0a08;
}
.login-box {
    width: min(100%, 25rem);
    background: var(--surface);
    border: 1px solid rgba(224, 171, 69, 0.28);
    border-radius: 18px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}
.login-box img { width: 110px; margin: 0 auto 1.5rem; }
.login-box h1 { font-size: 1.15rem; margin: 0 0 1.5rem; font-weight: 600; }
.login-box label { text-align: left; margin-bottom: 1rem; }

@media (max-width: 860px) {
    body.admin { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar .who { margin-top: 1rem; }
    .main { padding: 1.5rem 1.15rem 3rem; }
}

@media print {
    .sidebar, .page-actions, .no-print { display: none !important; }
    body.admin { display: block; background: #fff; color: #000; }
}
