/* ============ Snappsy — clean UI ============ */
:root {
  --bg: #FAF8FF;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --text: #0F0B1A;
  --text-2: #2E2645;
  --muted: #6B6480;
  --brand: #7C3AED;
  --brand-600: #4B21B7;
  --brand-50: #F5F0FF;
  --brand-100: #E9D5FF;
  --brand-grad: linear-gradient(135deg, #9F67FF 0%, #7C3AED 45%, #4B21B7 100%);
  --sun: #FBBF24;
  --sun-2: #F59E0B;
  --ok: #12b76a;
  --ok-50: #ecfdf3;
  --warn: #f79009;
  --warn-50: #fffaeb;
  --err: #f04438;
  --err-50: #fef3f2;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px -2px rgba(16, 24, 40, .08), 0 2px 6px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -8px rgba(16, 24, 40, .16);
  --sidebar: 248px;
  /* Brand Snappsy */
  --electric: #7C3AED;
  --violet: #4B21B7;
  --lavender: #E9D5FF;
  --midnight: #0F0B1A;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.center { text-align: center; justify-content: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 22px; height: 22px; }

.logo { display: inline-flex; align-items: center; flex: none; }
.logo img { height: 34px; width: auto; display: block; mix-blend-mode: multiply; }
.logo.sm img { height: 28px; }
.sidebar .logo img { height: 32px; }
.topbar .logo img { height: 28px; }
.logo-white { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 24px; letter-spacing: -.03em; }
.logo-white:hover { color: #fff; }
.logo-white img { height: 36px; width: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.18)); }
.logo-white i { font-style: normal; color: var(--sun); }

/* ---------- buttons & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-50); border-color: #fda29b; }
.btn.ok { color: #027a48; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); }

label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.field { position: relative; }
.field .hint { margin-top: 5px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.field .hint:empty { display: none; }
.field .hint.err { color: var(--err); }
.field .hint.ok { color: #039855; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], select {
  width: 100%; height: 44px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 14px; font: inherit;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #98a2b3; }
input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; box-shadow: none; }
select { width: auto; min-width: 200px; }
input:focus, select:focus { outline: none; border-color: #a4bcfd; box-shadow: 0 0 0 4px var(--brand-100); }
input.invalid { border-color: #fda29b; }
input.invalid:focus { box-shadow: 0 0 0 4px #fee4e2; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--surface-2); }
.strength { display: flex; gap: 4px; margin-top: 7px; }
.strength span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.strength.s1 span:nth-child(-n+1) { background: var(--err); }
.strength.s2 span:nth-child(-n+2) { background: var(--warn); }
.strength.s3 span:nth-child(-n+3) { background: #66c61c; }
.strength.s4 span { background: var(--ok); }
input[type=range] { width: 100%; accent-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text-2); font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; background: var(--err-50); color: #b42318; border: 1px solid #fecdca; }
.alert.ok { background: var(--ok-50); color: #027a48; border-color: #abefc6; }
.alert.info { background: var(--brand-50); color: #3538cd; border-color: var(--brand-100); }
.alert.warn { background: var(--warn-50); color: #b54708; border-color: #fedf89; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-50); color: #027a48; }
.badge.warn { background: var(--warn-50); color: #b54708; }
.badge.err { background: var(--err-50); color: #b42318; }
.badge.brand { background: var(--brand-50); color: var(--brand-600); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; }
.progress > div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.progress.alt > div { background: var(--ok); }
.prog { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-2); }
.prog > span:first-child { width: 150px; flex: none; display: flex; gap: 8px; align-items: center; }
.prog > span:last-child { width: 90px; text-align: right; flex: none; color: var(--muted); }

.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; flex: none; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { min-height: 60vh; display: grid; place-items: center; }

.tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin: 8px 0 20px; max-width: 100%; overflow-x: auto; }
.tabs button { display: inline-flex; gap: 8px; align-items: center; background: none; border: none; color: var(--muted); height: 36px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 9px; white-space: nowrap; }
.tabs button.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; user-select: none; transition: all .15s; }
.chip:hover { border-color: var(--line-2); background: var(--surface-2); }
.chip.active { color: var(--brand-600); background: var(--brand-50); border-color: var(--brand-100); }
.chip .n { color: var(--muted); font-weight: 400; }

details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv[open] { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
details.adv[open] summary { margin-bottom: 10px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 500; margin: 0; }
.toggle input { display: none; }
.toggle .sw { width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.toggle input:checked + .sw { background: var(--brand); }
.toggle input:checked + .sw::after { transform: translateX(16px); }
.toggle input:disabled + .sw { opacity: .45; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.auth-side { background: radial-gradient(circle at 15% 0%, #9F67FF 0%, transparent 55%), radial-gradient(circle at 100% 100%, #3A1890 0%, transparent 60%), #7C3AED; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }

.auth-side h2 { color: #fff; font-size: 34px; max-width: 440px; letter-spacing: -.035em; line-height: 1.15; font-weight: 800; }
.auth-side .deco { position: absolute; width: 360px; right: -90px; bottom: 90px; opacity: .12; transform: rotate(-12deg); pointer-events: none; }
.auth-side p { color: #E9D5FF; max-width: 420px; font-size: 16px; }
.auth-side .pts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-side .pts li { display: flex; gap: 10px; align-items: center; color: #F5F0FF; font-size: 15px; font-weight: 500; }
.auth-side .pts li svg { color: var(--sun); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 30px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 22px; }
.auth-box #msg:not(:empty) { margin-bottom: 14px; }
.auth-box form > * + * { margin-top: 14px; }
.auth-box form > .btn { margin-top: 20px; }
.auth-box form .check { margin-top: 16px; }
.auth-mobile-logo { display: none; margin-bottom: 28px; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; }
.sidebar .logo { padding: 0 10px 22px; }
.nav-sec { font-size: 11.5px; font-weight: 600; color: #98a2b3; text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.navlink { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px; }
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink.active { background: var(--brand-50); color: var(--brand-600); }
.navlink .count { margin-left: auto; font-size: 12px; background: var(--surface-2); color: var(--text-2); padding: 1px 8px; border-radius: 99px; }
.navlink.active .count { background: var(--brand-100); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.usercard { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.usercard .meta { min-width: 0; flex: 1; }
.usercard .meta div { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard .meta small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--brand-50); color: var(--brand-600); flex: none; }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.content { max-width: 1160px; margin: 0 auto; padding: 32px 36px 100px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 12px; }
#bottom-nav { display: none; }

/* ---------- dashboard ---------- */
.banner { display: flex; gap: 18px; align-items: center; padding: 20px 22px; border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); margin-bottom: 24px; }
.banner .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--brand); display: grid; place-items: center; flex: none; box-shadow: var(--shadow-sm); }
.banner h3 { margin: 0 0 2px; }
.banner p { margin: 0; color: var(--text-2); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: block; color: inherit; }
a.stat:hover { border-color: var(--line-2); color: inherit; }
.stat .lbl { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.stat .val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; color: var(--text); }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.quick { display: grid; gap: 10px; }
.quick a { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--text-2); font-weight: 500; }
.quick a:hover { background: var(--surface-2); color: var(--text); }
.quick a .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.ev-mini { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; }
.ev-mini:last-child { border-bottom: none; }
.ev-mini:hover { color: inherit; }
.ev-mini .th { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2) center/cover; flex: none; }
.ev-mini .t { font-weight: 600; font-size: 14px; }

/* ---------- search ---------- */
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow); }
.searchbar:focus-within { border-color: #a4bcfd; box-shadow: 0 0 0 4px var(--brand-100); }
.searchbar > svg { color: var(--muted); }
.searchbar input { border: none !important; box-shadow: none !important; height: 44px; padding: 0 4px; font-size: 16px; flex: 1; min-width: 0; background: transparent; }
.filters { margin: 16px 0 14px; }
.faces-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.faces-pick canvas { border-radius: 12px; cursor: pointer; border: 3px solid transparent; box-shadow: var(--shadow-sm); }
.faces-pick canvas.sel { border-color: var(--brand); }

/* ---------- gallery ---------- */
.sec-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 4px; }
.sec-title h2 { margin: 0; font-size: 18px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.ph { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: pointer; outline: none; }
.ph:focus-visible { box-shadow: 0 0 0 3px var(--brand); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s, opacity .3s; opacity: 0; display: block; }
.ph img.ok { opacity: 1; }
.ph:hover img { transform: scale(1.04); }
.ph .score { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); color: var(--text); padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-sm); }
.ph .scene { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); color: var(--text-2); padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; box-shadow: var(--shadow-sm); }
.ph .cap { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px 10px 9px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(16,24,40,.8)); opacity: 0; transition: opacity .2s; }
.ph .cap span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph:hover .cap, .ph:focus .cap { opacity: 1; }
.ph .fb { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; z-index: 2; }
.ph .fb button { flex: 1; height: 32px; border-radius: 8px; border: none; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; box-shadow: var(--shadow); }
.ph .fb .yes { background: #fff; color: #027a48; }
.ph .fb .no { background: #fff; color: #b42318; }
.ph .fb button:hover { filter: brightness(.96); }
.ph.with-fb .cap { display: none; }
.ph.sk { cursor: default; background: linear-gradient(90deg, var(--surface-2) 0%, #e9ecf1 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ic { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
#more-wrap { margin-top: 24px; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(12,17,29,.96); display: flex; flex-direction: column; animation: fade .15s; color: #fff; }
@keyframes fade { from { opacity: 0; } }
.lb-top { display: flex; align-items: center; padding: 14px 18px; color: #98a2b3; font-size: 13px; }
.lb-top .icon-btn { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
.lb-main { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 64px; }
.lb .imgbox { position: relative; max-width: 100%; max-height: 100%; }
.lb img { max-width: 100%; max-height: calc(100vh - 200px); display: block; border-radius: 10px; }
.lb .fbox { position: absolute; border: 2.5px solid #fff; border-radius: 8px; box-shadow: 0 0 0 2px var(--brand); }
.lb-info { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 22px 22px; flex-wrap: wrap; max-width: 1100px; width: 100%; margin: 0 auto; }
.lb-info .meta { flex: 1; min-width: 240px; font-size: 14px; }
.lb-info .meta p { color: #98a2b3; margin: 4px 0 0; font-size: 13px; }
.lb-info .badge { background: rgba(255,255,255,.1); color: #fff; }
.lb .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #fff; box-shadow: none; }
.lb .btn:hover { background: rgba(255,255,255,.16); }
.lb .btn.primary { background: #fff; color: var(--text); border-color: #fff; }
.lb .navbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.08); border: none; color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb .navbtn:hover { background: rgba(255,255,255,.18); }
.lb .prev { left: 10px; } .lb .next { right: 10px; }

/* ---------- event ---------- */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.event-card { padding: 0; overflow: hidden; color: inherit; transition: box-shadow .15s, border-color .15s; display: flex; flex-direction: column; }
.event-card:hover { color: inherit; box-shadow: var(--shadow); border-color: var(--line-2); }
.event-card .cover { height: 150px; background: var(--surface-2) center/cover; }
.event-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.event-card .prog > span:first-child { width: 130px; }
.form-grid { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 14px; align-items: end; }
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 240px; box-shadow: var(--shadow-lg); }
.menu-list button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: none; color: var(--text-2); padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; }
.menu-list button:hover { background: var(--surface-2); color: var(--text); }
.menu-list button.danger { color: var(--err); }
.menu-list hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- verify / liveness ---------- */
.ref-faces { display: flex; gap: 8px; flex-wrap: wrap; }
.dropzone { display: block; border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; color: var(--muted); margin: 0; transition: all .15s; font-weight: 500; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.cam-wrap { position: relative; width: 100%; max-width: 400px; aspect-ratio: 3/4; margin: 0 auto; border-radius: 24px; overflow: hidden; background: #0c111d; }
.cam-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-mask { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 36% 34% at 50% 45%, transparent 98%, rgba(12,17,29,.7) 100%); }
.cam-ring { position: absolute; left: 14%; right: 14%; top: 11%; height: 68%; border-radius: 50%; border: 4px solid rgba(255,255,255,.4); transition: border-color .2s; }
.cam-ring.good { border-color: var(--ok); }
.cam-arrow { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); font-size: 80px; font-weight: 800; color: rgba(255,255,255,.9); text-shadow: 0 2px 12px rgba(0,0,0,.5); pointer-events: none; }
.cam-msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.75)); font-weight: 700; font-size: 18px; color: #fff; }
.cam-msg .warn { color: #fec84b; font-size: 14px; font-weight: 600; }
.steps { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.steps .s { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); color: var(--muted); font-size: 18px; font-weight: 700; background: var(--surface); }
.steps .s.cur { border-color: var(--brand); color: var(--brand); }
.steps .s.done { border-color: var(--ok); background: var(--ok-50); color: var(--ok); }

/* ---------- indexing pill & toast ---------- */
#idx-pill { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 12px 16px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 48px); font-size: 14px; }
#idx-pill .txt { min-width: 0; }
#idx-pill b { font-weight: 600; }
#toasts { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; gap: 8px; align-items: center; background: var(--text); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: drop .2s; transition: opacity .4s, transform .4s; }
.toast.ok svg { color: #6ce9a6; }
.toast.err svg { color: #fda29b; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-logo { display: inline-flex; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; height: 60px; padding: 0 16px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .content { padding: 20px 16px 110px; }
  #bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  #bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
  #bottom-nav a.active { color: var(--brand); }
  #idx-pill { bottom: 80px; right: 12px; left: 12px; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .ph { border-radius: 6px; aspect-ratio: 1; }
  .ph .cap, .ph .scene, .ph .score { display: none; }
  .ph .fb { left: 4px; right: 4px; bottom: 4px; }
  .ph .fb button { height: 28px; font-size: 0; gap: 0; }
  .ph .fb button svg { width: 16px; height: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .lb-main { padding: 0; }
  .lb .navbtn { display: none; }
  .prog > span:first-child { width: 120px; }
  .events { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 16px; }
  .stat .val { font-size: 24px; }
  h1 { font-size: 24px; }
}

/* ---------- app: billing, share, tabel ---------- */
.share-row { display: flex; gap: 8px; }
.share-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); }
.radio { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; color: var(--text-2); cursor: pointer; }
.radio input { accent-color: var(--brand); }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.mini-stat { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--brand); }
.mini-stat b { display: block; color: var(--text); font-size: 18px; letter-spacing: -.02em; }
.mini-stat span { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: none; }
.usage { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.usage span { display: inline-flex; gap: 6px; align-items: center; }
.plan-now { display: flex; gap: 10px; align-items: center; font-size: 20px; letter-spacing: -.02em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
@media (max-width: 820px) { .mini-stats { grid-template-columns: 1fr 1fr; } .share-row { flex-direction: column; } }

/* ---------- v2: password rules, segmen, notifikasi ---------- */
.pw-rules { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.pw-rules li { display: flex; gap: 6px; align-items: center; }
.pw-rules li svg { color: var(--line-2); }
.pw-rules li.ok { color: #027a48; }
.pw-rules li.ok svg { color: var(--ok); }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; margin-bottom: 16px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { display: none; }
.seg span { display: inline-flex; gap: 6px; align-items: center; height: 34px; padding: 0 14px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.qr-row { display: flex; gap: 16px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.qr-row img { border: 1px solid var(--line); border-radius: 8px; flex: none; }
.bell { position: relative; }
.dot-n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.usercard .icon-btn { width: 36px; height: 36px; }
.notif-pop { position: fixed; z-index: 80; width: 340px; max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.notif-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.notif { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
.notif:hover { background: var(--surface-2); color: var(--text); }
.notif.unread { background: var(--brand-50); }
.notif span { color: var(--muted); }
.notif small { color: #98a2b3; font-size: 11.5px; }

/* ---------- admin ---------- */
.grid-adm { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.period-sel { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 10px; }
.period-sel button { border: none; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer; }
.period-sel button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.funnel { display: grid; gap: 10px; }
.fn-row { display: grid; grid-template-columns: 130px 1fr 64px 48px; gap: 12px; align-items: center; font-size: 13.5px; }
.fn-l { color: var(--text-2); }
.fn-bar { height: 22px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: var(--electric); border-radius: 0 4px 4px 0; }
.fn-v { text-align: right; font-variant-numeric: tabular-nums; }
.fn-c { color: var(--muted); font-size: 12px; text-align: right; }
.queue { display: grid; gap: 8px; }
.queue a { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-2); font-size: 14px; }
.queue a span { flex: 1; }
.queue a:hover { background: var(--surface-2); color: var(--text); }
.t-warn { color: #b54708; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar path { fill: var(--electric); }
.chart .bar.on path { fill: var(--violet); }
.chart .bar { cursor: default; }
.tip { position: absolute; top: 0; width: 120px; background: var(--midnight); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; pointer-events: none; display: grid; }
.tip span { color: #c9c2dc; }
.chart-table { margin-top: 8px; }
.table.compact th, .table.compact td { padding: 8px 10px; }
.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); font-size: 11.5px; margin-left: 4px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--surface-2); }
.checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks li.ok svg { color: var(--ok); }
.checks li.no svg { color: var(--err); }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.proof-th { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.proof-th img { width: 100%; max-height: 360px; object-fit: contain; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 12px 0; }
.codes code, .secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: 6px; padding: 6px 10px; font-size: 13.5px; letter-spacing: .04em; }
.secret { display: block; word-break: break-all; }
.mfa-qr { display: grid; place-items: center; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; width: fit-content; margin: 0 auto 12px; }
.ai-ic-sm { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(15,11,26,.45); display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); }
.table select, .table input { height: 34px; font-size: 13px; min-width: 120px; }

@media (max-width: 1000px) { .grid-adm { grid-template-columns: 1fr; } .fn-row { grid-template-columns: 100px 1fr 52px 40px; } }
@media (max-width: 640px) { .pw-rules, .codes { grid-template-columns: 1fr; } }

/* ---------- pengaturan akun ---------- */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.settings-nav a { display: flex; gap: 10px; align-items: center; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-nav a.on { background: var(--brand-50); color: var(--brand-600); }
.settings section { scroll-margin-top: 24px; }
.profile-row { display: flex; gap: 16px; align-items: center; }
.profile-row b { font-size: 17px; }
.avatar.xl { width: 64px; height: 64px; font-size: 24px; }
.sub-h { font-size: 15px; margin: 0 0 12px; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }
.danger-zone { margin-top: 24px; border: 1px solid #fecdca; border-radius: 12px; overflow: hidden; }
.dz-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 18px; flex-wrap: wrap; }
.dz-row + .dz-row { border-top: 1px solid #fee4e2; }
.dz-row > div { flex: 1; min-width: 240px; }
.dz-row p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.usercard-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; border-radius: 10px; padding: 2px; }
.usercard-link:hover { background: var(--surface-2); color: inherit; }
.avatar-link { width: 34px; height: 34px; font-size: 13px; }
.avatar-link:hover { color: var(--brand-600); }
.info-strip { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.info-strip svg { color: var(--brand); margin-top: 2px; flex: none; }
#top-bell { display: inline-flex; gap: 8px; align-items: center; }
@media (max-width: 900px) {
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
  .settings-nav a { white-space: nowrap; height: 36px; }
  #pf.form-grid { grid-template-columns: 1fr !important; }
  #pf .btn { margin-top: 0 !important; }
}
