:root {
    --bg: #eaeefb;
    --card: #ffffff;
    --blue: #2a46e8;
    --blue-700: #1b31bd;
    --ink: #17224f;
    --border: #1f2b60;
    --muted: #747e9b;
    --tint: #eaeefc;
    --green: #18a45f;
    --red: #e8514f;
    --amber-bg: #fff2cf;
    --amber: #b47900;
    /* elevasi lembut mengambang (chunk datang dari border tebal, bukan garis keras) */
    /* efek 3D: tepi bawah pekat (chunky) + bayangan ambient */
    --shadow: 0 4px 0 rgba(29, 42, 94, .16), 0 10px 20px rgba(23, 36, 92, .14);
    --shadow-sm: 0 3px 0 rgba(29, 42, 94, .14), 0 6px 13px rgba(23, 36, 92, .11);
    --radius: 22px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------- topbar tipis (branding utama ada di hero) ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; max-width: 540px; margin: 0 auto; padding: 14px 20px 2px; }
.brand .logo {
    width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border);
    object-fit: cover; box-shadow: var(--shadow-sm); display: block; background: var(--card);
}
.topbar nav { display: flex; align-items: center; gap: 12px; }
.topbar nav a { color: var(--blue); font-weight: 700; font-size: .9rem; }

main { max-width: 540px; margin: 0 auto; padding: 12px 18px 72px; }

h1 { font-family: 'Oxanium', sans-serif; font-size: 1.45rem; font-weight: 800; margin: 6px 0 6px; letter-spacing: .4px; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; }
.desc { color: var(--muted); margin: 0 0 16px; }
.back { color: var(--blue); font-weight: 700; font-size: .9rem; display: inline-block; margin-bottom: 10px; }
.empty-note { color: var(--muted); background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.empty-note a { color: var(--blue); font-weight: 700; }

/* ---------- hero (kartu biru) ---------- */
.hero {
    background: linear-gradient(165deg, #3350f2 0%, #1d35c4 100%);
    color: #fff;
    border: 2px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 12px 26px rgba(26, 46, 160, .28);
    padding: 30px 22px 24px;
    text-align: center;
    margin-bottom: 22px;
}
.hero-logo {
    width: 86px; height: 86px; margin: 0 auto 14px;
    background: #fff; color: var(--blue);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .20);
    overflow: hidden;
}
.hero-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.hero-title { font-family: 'Oxanium', sans-serif; font-size: 2.05rem; font-weight: 800; letter-spacing: 6px; margin: 0; text-indent: 6px; line-height: 1; }
.hero-tag { font-family: 'Oxanium', sans-serif; font-weight: 600; letter-spacing: 4px; font-size: .66rem; color: rgba(255, 255, 255, .8); margin: 8px 0 16px; }
.status {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; color: var(--ink); border: 2px solid var(--border);
    border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: .76rem; letter-spacing: 1px;
    box-shadow: var(--shadow-sm);
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(24, 164, 95, .22); }

/* ---------- chips kategori ---------- */
.chips { display: flex; flex-wrap: nowrap; gap: 9px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; white-space: nowrap;
    padding: 9px 18px; background: var(--card); border: 2px solid var(--border); border-radius: 999px;
    color: var(--ink); font-size: .84rem; font-weight: 700; box-shadow: var(--shadow-sm); transition: .14s;
}
.chip:hover { transform: translateY(-1px); }
.chip.on { background: var(--blue); border-color: var(--border); color: #fff; }

/* pencarian + urutkan */
.searchbar { display: flex; gap: 9px; margin-bottom: 16px; }
.searchbar input[type=search] { flex: 1; border-radius: 999px; }
.searchbar select { width: auto; border-radius: 999px; font-weight: 700; }

/* aman untuk notch / tepi layar Android & iOS */
@supports (padding: max(0px)) {
    main { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); padding-bottom: max(72px, env(safe-area-inset-bottom)); }
    .topbar { padding-top: max(14px, env(safe-area-inset-top)); }
}

/* ---------- daftar koleksi (baris berikon) ---------- */
.rows { display: flex; flex-direction: column; gap: 13px; }
.row {
    display: flex; align-items: center; gap: 13px;
    background: var(--card); border: 2px solid var(--border); border-radius: 18px;
    padding: 12px 14px; box-shadow: var(--shadow); transition: .14s;
}
.row:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(29, 42, 94, .18), 0 16px 26px rgba(23, 36, 92, .2); }
.row:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(29, 42, 94, .16), 0 4px 10px rgba(23, 36, 92, .14); }
.row-ic {
    flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; overflow: hidden;
    background: var(--tint); color: var(--blue); border: 1.5px solid #d4daf0;
    display: flex; align-items: center; justify-content: center;
}
.row-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-ic svg { width: 26px; height: 26px; }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-title { font-weight: 700; font-size: 1rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.pill { background: var(--tint); color: var(--blue); border: 1.5px solid #c4ccee; border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: .78rem; min-width: 32px; text-align: center; }
.pill.lock { background: var(--amber-bg); color: var(--amber); border-color: #e7c875; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; }
.pill.lock svg { width: 15px; height: 15px; }
.row-end .chev { color: #aab4d4; }

/* ---------- halaman koleksi: grid media ---------- */
.grid { display: grid; gap: 13px; }
.grid.media { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 540px) { .grid.media { grid-template-columns: repeat(3, 1fr); } }
.tile {
    position: relative; aspect-ratio: 1; background: var(--tint);
    border: 2px solid var(--border); border-radius: 16px; overflow: hidden; cursor: pointer; display: block; box-shadow: var(--shadow-sm);
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: .2s; }
.tile:hover img { transform: scale(1.05); }
.tile .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--blue); }
.vbadge { position: absolute; left: 9px; bottom: 9px; background: var(--blue); color: #fff; border-radius: 999px; padding: 4px 8px; display: flex; box-shadow: var(--shadow-sm); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag { background: var(--tint); color: var(--blue); font-weight: 700; border-radius: 999px; padding: 5px 13px; font-size: .8rem; border: 1.5px solid #c4ccee; }

/* ---------- unlock & login ---------- */
.unlock {
    max-width: 420px; margin: 6vh auto; text-align: center;
    background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 34px 26px;
}
.lock-big {
    width: 78px; height: 78px; margin: 0 auto 12px; background: var(--tint); color: var(--blue);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid #d4daf0;
}
.unlock h1 { font-family: 'Oxanium', sans-serif; letter-spacing: 1px; }
.unlock form { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.error { color: var(--red); font-weight: 700; }

/* ---------- form & admin ---------- */
input, textarea, select, button { font: inherit; }
input, textarea, select {
    width: 100%; padding: 12px 14px; background: #fff; border: 2px solid var(--border); border-radius: 14px; color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #9aa2b8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 70, 232, .18); }
button {
    padding: 13px 20px; background: var(--blue); color: #fff; border: 2px solid var(--border); border-radius: 14px;
    cursor: pointer; font-weight: 800; letter-spacing: .5px;
    box-shadow: 0 5px 0 var(--blue-700), 0 10px 16px rgba(42, 70, 232, .3); transition: .1s;
}
button:hover { background: var(--blue-700); }
button:active { transform: translateY(5px); box-shadow: 0 0 0 var(--blue-700), 0 3px 8px rgba(42, 70, 232, .3); }
.linkbtn { background: none; color: var(--muted); border: none; box-shadow: none; padding: 0 4px; font-weight: 600; letter-spacing: 0; width: auto; }
.linkbtn:hover { color: var(--ink); background: none; transform: none; }
.linkbtn:active { transform: none; box-shadow: none; }
.linkbtn.danger:hover { color: var(--red); }

.admin-grid > .panel { margin-bottom: 16px; }

/* ringkasan data dashboard */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 980px) { .stats { grid-template-columns: repeat(7, 1fr); } }
.stat { background: var(--card); border: 2px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 14px 13px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.stat-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.stat-ic svg { width: 20px; height: 20px; }
.stat-n { font-family: 'Oxanium', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-l { font-size: .74rem; color: var(--muted); font-weight: 600; }
.panel { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { font-family: 'Oxanium', sans-serif; letter-spacing: .5px; }
.panel form { display: flex; flex-direction: column; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 9px; }
.check { width: auto; display: flex; align-items: center; gap: 6px; color: var(--ink); background: var(--tint); border-radius: 999px; padding: 6px 13px; font-size: .85rem; font-weight: 700; border: 1.5px solid #c4ccee; }
.check input { width: auto; }
.hint { color: var(--muted); font-size: .82rem; margin: 10px 0 0; }
.notice { background: #e6f7ee; color: #0f7a46; border: 1.5px solid #a7e0c2; border-radius: 12px; padding: 11px 15px; font-weight: 700; margin-bottom: 14px; }
.fl { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; font-weight: 700; color: var(--muted); }
input[type=color] { height: 46px; padding: 4px; cursor: pointer; }
.collist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.collist li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--tint); border: 1.5px solid #d4daf0; border-radius: 14px; }
.collist li a { font-weight: 700; color: var(--ink); }
.collist li .sub { margin-right: auto; color: var(--muted); font-size: .82rem; }
.collist li .rowform { flex: 1; }
.rowform, .panel form.rowform { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.rowform input { flex: 1; min-width: 0; }
.rowform button { width: auto; flex: 0 0 auto; }
.tilewrap { position: relative; }
.tiledel { position: absolute; top: 7px; right: 7px; margin: 0; }
.xbtn { width: 32px; height: 32px; padding: 0; border-radius: 10px; background: rgba(232, 81, 79, .95); color: #fff; border: 1.5px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); letter-spacing: 0; }
.xbtn:hover { background: var(--red); transform: none; }
.tilebar { position: absolute; top: 7px; right: 7px; display: flex; gap: 6px; }
.tilebar form { margin: 0; }
.tbtn { width: 40px; height: 40px; padding: 0; border-radius: 11px; background: rgba(255, 255, 255, .97); color: var(--ink); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); letter-spacing: 0; cursor: pointer; }
.tbtn svg { width: 21px; height: 21px; }
.tbtn:hover { background: #fff; transform: none; }
.tbtn:active { transform: translateY(2px); box-shadow: none; }
.tbtn.danger { background: rgba(232, 81, 79, .95); color: #fff; border-color: #fff; }
.tbtn.danger:hover { background: var(--red); }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; background: rgba(13, 20, 50, .95); display: flex; flex-direction: column; z-index: 100; }
.lb[hidden] { display: none; }
.lb-mid { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 66px 10px 54px; box-sizing: border-box; }
.lb-stage { flex: 1 1 auto; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .14); }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; z-index: 2; }
.lb-count { color: #fff; font-weight: 700; font-size: .9rem; background: rgba(255, 255, 255, .16); padding: 9px 16px; border-radius: 999px; }
.lb-actions { display: flex; gap: 10px; }
.lb-ico { width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.lb-ico:hover { background: var(--blue); }
.lb-nav { flex: 0 0 auto; width: 66px; height: 66px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: var(--blue); }
.lb-cap { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: 86vw; color: #fff; font-size: .85rem; background: rgba(0, 0, 0, .55); padding: 7px 15px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .lb-nav { width: 54px; height: 54px; } .lb-ico { width: 50px; height: 50px; } .lb-mid { gap: 4px; padding: 64px 3px 52px; } }

/* ---------- desktop: manfaatkan lebar layar ---------- */
@media (min-width: 760px) {
    .topbar, main { max-width: 980px; }
    .hero { padding: 30px 24px 26px; }
    .rows { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
    .grid.media { grid-template-columns: repeat(4, 1fr); }
    .admin-grid { column-count: 2; column-gap: 16px; }
    .admin-grid > .panel { break-inside: avoid; }
}
@media (min-width: 1120px) {
    .rows { grid-template-columns: repeat(3, 1fr); }
    .grid.media { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- animasi muat konten ---------- */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.cover:not(.empty):not(.locked), .row-ic:not(.empty):not(.lock), .tile:not(:has(.ph)) {
    background-image: linear-gradient(100deg, var(--tint) 30%, #f2f5ff 50%, var(--tint) 70%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}
.cover:has(img.loaded), .row-ic:has(img.loaded), .tile:has(img.loaded) { animation: none; background-image: none; background: var(--tint); }
.cover img, .row-ic img, .tile img { opacity: 0; transition: opacity .35s ease; }
img.loaded { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 4px solid rgba(42, 70, 232, .2); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.lb-spin { position: absolute; top: calc(50% - 20px); left: calc(50% - 20px); width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; }

/* ---------- overlay upload ---------- */
.uploading { position: fixed; inset: 0; background: rgba(10, 16, 40, .62); backdrop-filter: blur(3px); z-index: 200; display: flex; align-items: center; justify-content: center; }
.uploading[hidden] { display: none; }
.up-box { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; text-align: center; width: 300px; max-width: 86vw; }
.up-label { font-weight: 700; margin: 14px 0 12px; }
.up-track { height: 10px; background: var(--tint); border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.up-bar { height: 100%; width: 0; background: var(--blue); transition: width .2s ease; }
.up-pct { margin-top: 10px; font-weight: 800; color: var(--blue); }

/* progress bar navigasi halaman */
.navbar-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--blue); z-index: 300; opacity: 0; }
.navbar-progress.on { width: 90%; opacity: 1; transition: width 10s cubic-bezier(.08,.8,.1,1); }
