/* ShortClip admin — premium dark, Space Grotesk, glassmorphism. */

:root {
    --bg: #0c0a0b;
    --bg-2: #100d0f;
    --surface: rgba(255, 255, 255, .045);
    --surface-high: rgba(255, 255, 255, .075);
    --line: rgba(255, 255, 255, .12);
    --line-soft: rgba(255, 255, 255, .07);
    --accent: #e8281e;
    --accent-2: #ff5240;
    --accent-dim: #9e1b14;
    --gold: #e9c89a;
    --gold-dim: #b9945f;
    --text: #fbf7f6;
    --text-2: #cdc1bd;
    --text-3: #a39591;
    --success: #4ade80;
    --error: #f15a43;
    --warning: #fbbf24;
    --radius: 18px;
    --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --shadow: 0 18px 46px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.admin {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
    background-color: var(--bg);
    background-image:
        radial-gradient(60rem 40rem at 110% -10%, rgba(232, 40, 30, .22), transparent 60%),
        radial-gradient(50rem 34rem at -20% 20%, rgba(233, 200, 154, .10), transparent 62%),
        radial-gradient(46rem 40rem at 50% 120%, rgba(158, 27, 20, .28), transparent 65%),
        linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* jaring halus di atas gradien */
body.admin::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(120% 90% at 50% 0%, #000 25%, transparent 85%);
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: 1040px;
    margin: 0 auto;
    padding: 18px 16px 56px;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff; }

code, .key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .84em;
    background: rgba(0, 0, 0, .42);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 3px 7px;
    word-break: break-all;
    color: var(--gold);
}

/* ---------- header ---------- */
.brand, .topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0 20px;
}

.topbar { justify-content: space-between; }
.topbar .brand { padding: 0; }

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(232, 40, 30, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.brand-mark.sm { width: 40px; height: 40px; border-radius: 12px; }

.brand-text { display: block; }

.logo {
    display: block;
    font-weight: 700;
    letter-spacing: .18em;
    font-size: 1.12rem;
    line-height: 1.1;
}

.tagline {
    display: block;
    font-size: .64rem;
    letter-spacing: .3em;
    color: var(--accent-2);
    font-weight: 700;
}

/* ---------- kartu (glass) ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 20px 18px;
    margin-bottom: 18px;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.card h1 { font-size: 1.45rem; font-weight: 700; margin: 0 0 14px; letter-spacing: -.01em; }
.card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 14px;
    letter-spacing: .01em;
}

.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.login-card { max-width: 430px; margin: 8vh auto; }

label {
    display: block;
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-3);
    margin: 14px 0 7px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
    width: 100%;
    padding: 13px 14px;
    background: rgba(0, 0, 0, .38);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px; /* mencegah auto-zoom di iOS */
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input::placeholder { color: rgba(163, 149, 145, .7); }

input:focus {
    outline: none;
    border-color: rgba(232, 40, 30, .75);
    background: rgba(0, 0, 0, .55);
    box-shadow: 0 0 0 4px rgba(232, 40, 30, .16);
}

.row-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.row-form .field { flex: 1 1 200px; min-width: 0; }

/* ---------- tombol: glass ---------- */
.btn {
    display: inline-block;
    width: auto;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: 13px 26px;
    font-family: var(--font);
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: .12em;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(232, 40, 30, .85), rgba(158, 27, 20, .55));
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 12px 30px rgba(232, 40, 30, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn-primary { text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }

.btn-mini {
    background: var(--surface-high);
    border: 1px solid var(--line);
    color: var(--text-2);
    border-radius: 10px;
    padding: 7px 11px;
    font-family: var(--font);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    margin: 2px 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color .16s ease, color .16s ease, transform .16s ease;
}

.btn-mini:hover { border-color: rgba(233, 200, 154, .55); color: var(--text); transform: translateY(-1px); }
.btn-mini.danger { color: var(--error); }
.btn-mini.danger:hover { border-color: rgba(241, 90, 67, .6); }
.btn-mini.ok { color: var(--success); }
.btn-mini.ok:hover { border-color: rgba(74, 222, 128, .55); }

/* ---------- statistik ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.stat {
    background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    color: var(--text-3);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-weight: 600;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 30px rgba(0, 0, 0, .3);
}

.stat .num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    background: linear-gradient(180deg, #fff, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- tabel ---------- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: rgba(0, 0, 0, .25);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th, td {
    text-align: left;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
    font-size: .9rem;
}

th {
    font-size: .66rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-3);
    font-weight: 700;
    background: rgba(255, 255, 255, .04);
}

tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(255, 255, 255, .045); }
tbody tr:last-child td { border-bottom: none; }

.actions form { display: inline-block; }

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-active { color: var(--success); }
.badge-revoked { color: var(--error); }
.badge-suspended { color: var(--warning); }
.badge-expired { color: var(--error); }

/* ---------- notifikasi ---------- */
.alert {
    border-radius: 14px;
    padding: 13px 15px;
    margin: 0 0 14px;
    font-size: .9rem;
    border: 1px solid;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.alert-ok { background: rgba(74, 222, 128, .12); border-color: rgba(74, 222, 128, .4); color: var(--success); }
.alert-error { background: rgba(241, 90, 67, .14); border-color: rgba(241, 90, 67, .45); color: var(--error); }
.alert-warn { background: rgba(251, 191, 36, .13); border-color: rgba(251, 191, 36, .4); color: var(--warning); }

.hint { color: var(--text-3); font-size: .84rem; margin: 10px 0 0; }
.muted { color: var(--text-3); }

.search { display: flex; gap: 8px; align-items: center; }
.search input { max-width: 220px; }

details summary {
    cursor: pointer;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: .02em;
}

.foot {
    margin-top: 26px;
    color: var(--text-3);
    font-size: .76rem;
    text-align: center;
    letter-spacing: .04em;
}

@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr; }
    .row-form .field { flex: 1 1 100%; }
    .btn { width: 100%; }
    .card { padding: 18px 14px; }
}
