/* ==========================================================================
   Panel admin — tema gelap oranye
   ========================================================================== */

:root {
    --bg: #0a0a0c;
    --panel: #15151b;
    --panel-2: #1c1c24;
    --line: #2a2a34;
    --text: #f2f2f5;
    --muted: #9a9aa8;
    --orange: #ff6a00;
    --orange-2: #ff9d2e;
    --green: #23c55e;
    --blue: #3b82f6;
    --red: #e2231a;
    --gold: #ffd54a;
    --radius: 14px;
    --side-w: 236px;
    --shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

body.adm {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Sidebar ------------------------------------------------------ */

.side {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side-w);
    background: #101014;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.side.is-open { transform: translateX(0); }

.side__brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
}

.side__brand img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.side__brand span { font-size: 13px; font-weight: 800; line-height: 1.25; }
.side__brand small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.side__nav { padding: 10px 8px; overflow-y: auto; flex: 1; }

.side__link {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 11px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #cfcfda;
    border: 0;
    background: none;
    text-align: left;
    transition: background .16s, color .16s;
}

.side__link:hover { background: var(--panel-2); color: #fff; }
.side__link.is-active { background: linear-gradient(90deg, rgba(255, 106, 0, .22), transparent); color: var(--orange-2); box-shadow: inset 3px 0 0 var(--orange); }
.side__link .ico { font-size: 15px; }
.side__link--out { color: #ff9d9d; }

.side__badge {
    margin-left: auto;
    background: var(--orange);
    color: #fff;
    font-size: 10px; font-weight: 800;
    padding: 2px 7px; border-radius: 999px;
}

.side__foot { padding: 10px 8px; border-top: 1px solid var(--line); }

.side__overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 45;
    display: none;
}

.side__overlay.is-open { display: block; }

/* ---------- Topbar & konten ---------------------------------------------- */

.main { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: rgba(16, 16, 20, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.topbar__burger {
    width: 38px; height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: #fff; font-size: 16px;
}

.topbar__title { margin: 0; font-size: 16px; font-weight: 800; flex: 1; }
.topbar__right { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.content { padding: 16px 14px 40px; flex: 1; }

/* ---------- Kartu & panel ------------------------------------------------ */

.card-adm {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.card-adm__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-adm__title { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.card-adm__sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- KPI ---------------------------------------------------------- */

.kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }

.kpi__item {
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(160deg, #1b1b23, #121218);
    position: relative;
    overflow: hidden;
}

.kpi__item::after {
    content: "";
    position: absolute; right: -22px; top: -22px;
    width: 70px; height: 70px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 106, 0, .35), transparent 70%);
}

.kpi__key { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.kpi__val { font-size: clamp(17px, 4.6vw, 23px); font-weight: 900; margin-top: 6px; }
.kpi__val--orange { color: var(--orange-2); }
.kpi__val--green { color: #6ee7a0; }
.kpi__val--gold { color: var(--gold); }
.kpi__hint { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Grafik -------------------------------------------------------- */

.charts { display: grid; gap: 14px; margin-bottom: 16px; }
.chart-box { position: relative; height: 260px; }
.chart-box--sm { height: 230px; }

/* ---------- Tabel --------------------------------------------------------- */

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }

.table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #191920; color: var(--muted); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:hover { background: #1a1a21; }
.table tbody tr:last-child td { border-bottom: 0; }
.table__thumb { width: 42px; height: 56px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); }
.table__muted { color: var(--muted); font-size: 11px; }
.table__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.inline-form { display: inline; }

/* ---------- Tombol -------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px;
    border: 0; border-radius: 10px;
    font-size: 12.5px; font-weight: 700;
    transition: filter .16s, transform .12s;
    white-space: nowrap;
}

.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }

.btn--primary { background: linear-gradient(90deg, var(--orange), #ff8a1f); color: #fff; }
.btn--ghost { background: var(--panel-2); color: #e7e7f0; border: 1px solid var(--line); }
.btn--danger { background: rgba(226, 35, 26, .16); color: #ff9d95; border: 1px solid rgba(226, 35, 26, .5); }
.btn--ok { background: rgba(35, 197, 94, .16); color: #7ff0a8; border: 1px solid rgba(35, 197, 94, .5); }
.btn--sm { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--lg { padding: 12px 20px; font-size: 14px; }

/* ---------- Form ---------------------------------------------------------- */

.form-grid { display: grid; gap: 12px; }
.form-grid--2 { grid-template-columns: 1fr; }
.field { display: block; }
.field > span, .field__label { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.field__hint { font-size: 10.5px; color: #71717f; margin-top: 4px; }
.field--full { grid-column: 1 / -1; }

.input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #131319;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
}

.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 0, .15); }
.input::placeholder { color: #6a6a78; }
textarea.input { resize: vertical; min-height: 74px; }
.input--money { font-weight: 800; letter-spacing: .02em; }

.check { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #131319; }
.check input { width: 17px; height: 17px; accent-color: var(--orange); }

.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Alert & badge -------------------------------------------------- */

.alert { padding: 11px 13px; border-radius: 10px; font-size: 12.5px; margin-bottom: 14px; border: 1px solid transparent; line-height: 1.6; }
.alert--ok { background: rgba(35, 197, 94, .12); border-color: rgba(35, 197, 94, .4); color: #9ff0bd; }
.alert--bad { background: rgba(226, 35, 26, .12); border-color: rgba(226, 35, 26, .45); color: #ffb1ab; }
.alert--info { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .4); color: #a8ccff; }

.badge { font-size: 10px; font-weight: 800; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.badge--ok { background: rgba(35, 197, 94, .16); color: #7ff0a8; border: 1px solid rgba(35, 197, 94, .45); }
.badge--warn { background: rgba(255, 193, 7, .16); color: #ffd76a; border: 1px solid rgba(255, 193, 7, .45); }
.badge--info { background: rgba(59, 130, 246, .16); color: #93c0ff; border: 1px solid rgba(59, 130, 246, .45); }
.badge--bad { background: rgba(226, 35, 26, .16); color: #ffa79f; border: 1px solid rgba(226, 35, 26, .45); }
.badge--muted { background: #23232c; color: #b6b6c4; border: 1px solid var(--line); }

/* ---------- Filter & pagination -------------------------------------------- */

.filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.filter-bar .input:first-child { grid-column: 1 / -1; }

.pagination { margin-top: 14px; display: flex; justify-content: center; }
.pagination svg { width: 14px; height: 14px; }
.pagination nav > div:first-child { display: none; }
.pagination a, .pagination span[aria-current="page"] span {
    display: inline-grid; place-items: center;
    min-width: 32px; height: 32px; padding: 0 8px; margin: 0 3px;
    border-radius: 9px; border: 1px solid var(--line);
    background: var(--panel); font-size: 12.5px; color: #dcdce4;
}
.pagination span[aria-current="page"] span { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 800; }

/* ---------- Galeri gambar akun (admin) ------------------------------------- */

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }

.img-card { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #101014; }
.img-card.is-main { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 0, .18); }
.img-card__pic { aspect-ratio: 3 / 4; }
.img-card__pic img { width: 100%; height: 100%; object-fit: cover; }
.img-card__bar { display: flex; gap: 5px; padding: 7px; justify-content: space-between; align-items: center; }
.img-card__tag { font-size: 9.5px; font-weight: 800; color: var(--orange-2); text-transform: uppercase; }

.drop { border: 1px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; background: #131319; }
.drop p { margin: 0 0 8px; font-size: 12px; color: var(--muted); }

/* ---------- Login ---------------------------------------------------------- */

.login-page {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 20px;
    background:
        radial-gradient(70% 50% at 50% 0%, rgba(255, 106, 0, .25), transparent 65%),
        linear-gradient(180deg, #0d0d11, #08080a);
}

.login {
    width: 100%; max-width: 380px;
    padding: 26px 22px;
    border-radius: 18px;
    border: 1px solid rgba(255, 106, 0, .35);
    background: linear-gradient(180deg, #17171d, #101014);
    box-shadow: var(--shadow);
}

.login__brand { text-align: center; margin-bottom: 18px; }
.login__brand img { width: 68px; height: 68px; border-radius: 16px; margin: 0 auto 10px; object-fit: cover; box-shadow: 0 0 22px rgba(255, 106, 0, .45); }
.login__brand h1 { margin: 0; font-size: 17px; font-weight: 900; }
.login__brand p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- Responsif ------------------------------------------------------ */

@media (min-width: 620px) {
    .kpi { grid-template-columns: repeat(3, 1fr); }
    .form-grid--2 { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { grid-template-columns: 2fr 1fr 1fr auto; }
    .filter-bar .input:first-child { grid-column: auto; }
}

@media (min-width: 992px) {
    .side { transform: none; }
    .side__overlay { display: none !important; }
    .topbar__burger { display: none; }
    .main { margin-left: var(--side-w); }
    .content { padding: 20px 22px 46px; }
    .topbar { padding: 14px 22px; }
    .kpi { grid-template-columns: repeat(6, 1fr); }
    .charts { grid-template-columns: 2fr 1fr; }
    .charts--half { grid-template-columns: 1fr 1fr; }
}
