:root {
    --accent: #ffc83d;
    --bg: #f4f5fb;
    --card: #ffffff;
    --text: #1d1f33;
    --muted: #6b6f88;
    --line: #e4e6f0;
    --danger: #e5484d;
    --ok: #16a34a;
    --radius: 14px;
    --ink: #17152e;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3 { margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border: 0; border-radius: 10px; padding: .65rem 1.1rem;
    font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: transform .15s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--ink); box-shadow: 0 6px 18px -8px var(--accent); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { padding: .45rem .8rem; font-size: .85rem; }
.btn.xs { padding: .3rem .55rem; font-size: .8rem; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- Form ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 1rem; }
input:not([type=checkbox]):not([type=range]):not([type=color]), textarea, select {
    display: block; width: 100%; margin-top: .35rem;
    padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px;
    font: inherit; font-weight: 400; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }
input[type=file] { padding: .5rem; background: #fafbff; }
input[type=range] { width: 100%; accent-color: var(--accent); margin-top: .5rem; }
input[type=color] { display: block; width: 100%; height: 44px; margin-top: .35rem; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; }
.alert.ok { background: #e8f8ee; color: #11683a; }
.alert.err { background: #fdecec; color: #b42318; }

/* ---------- Layout admin ---------- */
.topnav {
    position: sticky; top: 0; z-index: 10;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .8rem clamp(1rem, 3vw, 2rem);
    background: var(--ink); color: #fff;
}
.topnav .brand { font-weight: 800; font-size: 1.1rem; display: flex; gap: .5rem; align-items: center; min-width: 0; }
.topnav .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav nav { display: flex; gap: .5rem; flex-shrink: 0; }
.topnav .btn.ghost { border-color: rgba(255,255,255,.2); }
.topnav .btn.ghost:hover { background: rgba(255,255,255,.08); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 4rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--card); border-radius: var(--radius); padding: 1rem 1.25rem; border: 1px solid var(--line); position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.stat b { display: block; font-size: 1.75rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: .85rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; overflow-y: hidden; }
.tabs a { padding: .7rem 1.1rem; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.card-head .actions { display: flex; gap: .5rem; }
.pill { display: inline-block; background: var(--bg); border-radius: 99px; padding: .1rem .6rem; font-size: .8rem; color: var(--muted); vertical-align: middle; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); margin: 0; }
.search { margin: 0 0 1rem !important; }

.table-wrap { max-height: 65vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; background: #fafbff; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); z-index: 1; }
tr:last-child td { border-bottom: 0; }
td.name { font-weight: 600; }
tr.struck td.name { text-decoration: line-through; color: var(--muted); }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.row-actions form { margin: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; }
.badge.win { background: #fff4d6; color: #8a5a00; }
.badge.lost { background: #f0f0f4; color: var(--muted); }

/* ---------- Pratinjau background ---------- */
.preview { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #120f2b; margin-bottom: .75rem; }
.preview > img, .preview > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-overlay { position: absolute; inset: 0; background: #07061a; opacity: var(--overlay, .55); }
.preview-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 1rem; }
.preview-text strong { font-size: clamp(1.1rem, 3vw, 2rem); font-weight: 800; color: var(--accent); }
.preview-text small { opacity: .85; margin-bottom: 1rem; }
.preview-reel { padding: .6rem 1.5rem; border: 2px solid var(--accent); border-radius: 10px; font-weight: 800; letter-spacing: .1em; background: rgba(0,0,0,.35); box-shadow: 0 0 24px -4px var(--accent); }

/* ---------- Aurora (background bawaan) ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse at bottom, #221a55 0%, #0b0920 70%); }
.aurora span { position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 16s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: #7c3aed; left: -10%; top: -20%; }
.aurora span:nth-child(2) { background: var(--accent); right: -15%; top: 20%; opacity: .3; animation-delay: -5s; }
.aurora span:nth-child(3) { background: #0ea5e9; left: 20%; bottom: -40%; animation-delay: -10s; }
@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 12%) scale(1.2); }
}

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: #0b0920; }
.login-page .aurora { position: fixed; }
.login-card {
    position: relative; width: 100%; max-width: 380px;
    background: rgba(255,255,255,.96); border-radius: 20px; padding: 2rem;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.login-logo { font-size: 2.5rem; width: 64px; height: 64px; display: grid; place-items: center; background: var(--ink); border-radius: 16px; margin-bottom: 1rem; box-shadow: 0 0 0 4px var(--accent); }
.login-card h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.login-card p { margin: 0 0 1.5rem; }

@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .row { grid-template-columns: 1fr; }
    .topnav .brand span { display: none; }
    .row-actions { flex-direction: column; align-items: flex-end; }
}
