/* =====================================================================
   Kerangka admin bergaya MaterialM (WrapPixel) untuk Ghomamah
   Dipakai index.html (pricelist), jamaah.html (data jamaah) dan lacak.html.
   Warna utama diisi otomatis dari Branding (warna 1) oleh shell.js.
   ===================================================================== */
:root{
  --ui-font:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --bg:#F8FAFD; --surface:#FFFFFF; --surface-2:#F4F7FB; --ink:#111C2D; --muted:#5D6B7A; --line:#E0E6EB;
  --accent:#A52222; --accent-ink:#FFFFFF; --accent-soft:#F8E9E9; --gold:#B8913A;
  --ok:#00A88F; --ok-soft:#D9F7F2; --danger:#E5487A; --danger-soft:#FFE4EC; --warn-soft:#FFF1CC;
  --shell-bg:#FFFFFF; --r:18px; --shadow:0 1px 4px rgba(133,146,173,.2);
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#111A24; --surface:#1A2531; --surface-2:#202D3B; --ink:#E7EDF3; --muted:#9AA8B6; --line:#2C3A49;
  --ok:#3FD6BE; --ok-soft:#173A36; --danger:#FF8AAE; --danger-soft:#3B1E29; --warn-soft:#3A2E12;
  --shell-bg:#0C131B; --shadow:0 1px 4px rgba(0,0,0,.35); color-scheme:dark }}
:root[data-theme="dark"]{
  --bg:#111A24; --surface:#1A2531; --surface-2:#202D3B; --ink:#E7EDF3; --muted:#9AA8B6; --line:#2C3A49;
  --ok:#3FD6BE; --ok-soft:#173A36; --danger:#FF8AAE; --danger-soft:#3B1E29; --warn-soft:#3A2E12;
  --shell-bg:#0C131B; --shadow:0 1px 4px rgba(0,0,0,.35); color-scheme:dark }

/* ---------- dasar & komponen (berlaku dengan atau tanpa sidebar) ---------- */
body{font-family:var(--ui-font);background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased}
h1,h2,h3{letter-spacing:-.01em}
.card{border:0;border-radius:var(--r);box-shadow:var(--shadow);padding:24px;gap:14px}
.card h2{font-size:18px;font-weight:600}
.card h3{font-size:15px;font-weight:600}
.hint{color:var(--muted)}
.btn{border-radius:30px;font-weight:600;font-size:13.5px;padding:9px 18px;transition:box-shadow .15s,background .15s,color .15s}
.btn:hover{box-shadow:0 2px 8px rgba(17,28,45,.10)}
.btn.small{padding:6px 12px;font-size:12.5px}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.primary:hover{box-shadow:0 4px 14px color-mix(in srgb,var(--accent) 35%,transparent)}
.btn.danger{background:transparent}
input,select,textarea{background:var(--surface);border-color:var(--line);border-radius:8px;font-size:14px}
input:hover,select:hover,textarea:hover{border-color:color-mix(in srgb,var(--ink) 25%,var(--line))}
input:focus,select:focus,textarea:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px var(--accent-soft)}
.field label,.flabel{font-weight:600;font-size:13px;color:var(--ink)}
fieldset{border-color:var(--line);border-radius:12px}
.chip{border-radius:30px;background:var(--surface);font-weight:600}
.chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.item,.doc,.jrow,.person,.stat{border-color:var(--line);border-radius:12px}
.jrow{box-shadow:var(--shadow);border-color:transparent}
.jrow:hover{box-shadow:0 4px 14px rgba(133,146,173,.28)}
.stat{background:var(--surface);border:0;box-shadow:var(--shadow);padding:14px 16px}
.empty{border-radius:14px;background:var(--surface)}
.table-wrap{border-radius:12px;background:var(--surface)}
table.ops th{background:var(--surface-2);color:var(--muted);font-weight:600;text-transform:none}
.tag{border-radius:30px}
.notice{border-radius:12px}
.status.err{color:var(--danger)}
.badge.ok{color:var(--ok)}
.savebar,.bulkbar{border-radius:var(--r)}
.journey{border-radius:14px}
.now{border-radius:14px}
.pill{border-radius:30px}
:focus-visible{outline-color:var(--accent)}

/* ---------- kerangka admin (aktif setelah login) ---------- */
.sb,.sb-backdrop,.sb-burger{display:none}
body.shell-on{background:var(--shell-bg)}
body.shell-on .sb{display:flex;position:fixed;inset:0 auto 0 0;width:270px;flex-direction:column;background:var(--shell-bg);z-index:50;box-shadow:7px 7px 10px rgba(0,0,0,.03)}
.sb-logo{display:flex;align-items:center;gap:12px;padding:22px 24px 18px;min-height:78px}
.sb-logo .mk{width:40px;height:40px;border-radius:12px;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font-family:var(--arab,"Amiri"),serif;font-size:22px;flex:none;overflow:hidden}
.sb-logo .mk.img{background:#FFFFFF;border:1px solid var(--line)}
.sb-logo .mk img{max-width:86%;max-height:86%}
.sb-logo b{display:block;font-size:16px;font-weight:700;line-height:1.2;color:var(--ink)}
.sb-logo span{font-size:12px;color:var(--muted)}
.sb-nav{flex:1;overflow-y:auto;padding:0 16px 16px;scrollbar-width:thin}
.sb-h{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:18px 12px 8px;border-top:1px dashed var(--line);margin-top:6px}
.sb-h:first-child{border-top:0;margin-top:0;padding-top:4px}
.sb-a{display:flex;align-items:center;gap:13px;min-height:44px;padding:0 16px;margin:0 0 4px;border-radius:30px;color:color-mix(in srgb,var(--ink) 82%,transparent);text-decoration:none;font-size:14.5px;font-weight:500;transition:background .15s,color .15s}
.sb-a svg{width:21px;height:21px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.sb-a:hover{color:var(--accent);background:color-mix(in srgb,var(--accent-soft) 60%,transparent)}
.sb-a.on{background:var(--accent-soft);color:var(--accent);font-weight:600}
.sb-a:focus-visible{outline:3px solid var(--accent);outline-offset:1px}
.sb-a[hidden]{display:none}
.sb-user{margin:12px 16px 16px;padding:12px;border-radius:16px;background:var(--accent-soft);display:flex;align-items:center;gap:10px}
.sb-av{width:40px;height:40px;border-radius:50%;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;font-weight:700;font-size:14px;flex:none}
.sb-user .who{flex:1;min-width:0}
.sb-user .who b{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink)}
.sb-user .who span{font-size:12px;color:var(--muted)}
.sb-ib{width:34px;height:34px;border-radius:50%;border:0;background:var(--surface);color:var(--ink);display:grid;place-items:center;cursor:pointer;flex:none}
.sb-ib:hover{color:var(--accent)}
.sb-ib svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.shell-on .wrap{max-width:none;margin:16px 16px 16px 270px;padding:8px max(24px,calc((100% - 1240px) / 2)) 48px;background:var(--bg);border-radius:24px;min-height:calc(100vh - 32px)}
body.shell-on nav.tabs{display:none!important}
body.shell-on #userBox{display:none!important}
body.shell-on header.top{position:sticky;top:0;z-index:30;min-height:70px;padding:10px 0;background:var(--bg);margin-bottom:4px}
body.shell-on header.top .brand-mark{display:none}
body.shell-on header.top h1{font-size:22px;font-weight:700}
/* tombol "Lihat situs utama" di bar atas (hanya setelah login) */
.site-link{display:none}
body.shell-on header.top .site-link{display:inline-flex;align-items:center;gap:7px;margin-left:auto;text-decoration:none;white-space:nowrap;flex:none}
.site-link svg{width:17px;height:17px;flex:none}
@media (max-width:560px){ body.shell-on header.top .site-link span{display:none} body.shell-on header.top .site-link{padding:8px 10px} }
.sb-burger{width:40px;height:40px;border-radius:50%;border:0;background:var(--surface);box-shadow:var(--shadow);color:var(--ink);place-items:center;cursor:pointer;flex:none}
.sb-burger svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
@media (max-width:1099px){
  body.shell-on .sb{transform:translateX(-100%);transition:transform .2s ease;box-shadow:none}
  body.shell-on.sb-open .sb{transform:none;box-shadow:0 0 40px rgba(0,0,0,.25)}
  body.shell-on.sb-open .sb-backdrop{display:block;position:fixed;inset:0;background:rgba(17,28,45,.35);z-index:45}
  body.shell-on .wrap{margin:8px;padding:4px 16px 40px;border-radius:18px;min-height:calc(100vh - 16px)}
  body.shell-on .sb-burger{display:grid}
  body.shell-on header.top{flex-wrap:nowrap;justify-content:flex-start}
}
/* layar login / pricelist publik: tanpa sidebar, kartu login di tengah */
body:not(.shell-on) #panel-login .card{box-shadow:0 10px 40px rgba(133,146,173,.25);max-width:420px;width:100%;margin:32px auto 0;padding:32px}
body:not(.shell-on) #panel-login .btn.primary{width:100%;justify-content:center;padding:12px 18px}
body:not(.shell-on):has(#panel-login:not([hidden])) header.top{justify-content:center;margin-top:5vh}
body:not(.shell-on):has(#panel-login:not([hidden])) header.top .brand{flex-direction:column;text-align:center}
body:not(.shell-on):has(#panel-login:not([hidden])) header.top .brand-mark{width:56px;height:56px;font-size:30px;border-radius:16px}

/* ---------- Dashboard ---------- */
.dash-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.dstat{border-radius:var(--r);padding:20px;display:flex;flex-direction:column;gap:10px;background:var(--surface);box-shadow:var(--shadow);min-width:0}
.dstat .ic{width:44px;height:44px;border-radius:14px;display:grid;place-items:center}
.dstat .ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dstat .lb{font-size:13px;color:var(--muted);font-weight:500}
.dstat .vl{font-size:28px;font-weight:700;line-height:1.1;overflow-wrap:anywhere}
.dstat .sub{font-size:12.5px;color:var(--muted)}
.dstat.c1 .ic{background:var(--accent-soft);color:var(--accent)}
.dstat.c2 .ic{background:#E5F5FF;color:#0085D6}
.dstat.c3 .ic{background:var(--ok-soft);color:var(--ok)}
.dstat.c4 .ic{background:#FFF1CC;color:#B07800}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .dstat.c2 .ic{background:#13314A;color:#7CC8FF} :root:not([data-theme="light"]) .dstat.c4 .ic{background:#3A2E12;color:#F2CF7A} }
:root[data-theme="dark"] .dstat.c2 .ic{background:#13314A;color:#7CC8FF}
:root[data-theme="dark"] .dstat.c4 .ic{background:#3A2E12;color:#F2CF7A}
.dash-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:980px){ .dash-grid{grid-template-columns:1fr} }
.dk-row{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px 0;border-bottom:1px solid var(--line)}
.dk-row:last-child{border-bottom:0}
.dk-date{border-radius:14px;background:var(--accent-soft);color:var(--accent);text-align:center;padding:8px 4px;line-height:1.1}
.dk-date b{display:block;font-size:20px}
.dk-date span{font-size:11px;font-weight:700;text-transform:uppercase}
.dk-main{min-width:0}
.dk-main b{display:block;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dk-main small{color:var(--muted);font-size:12.5px}
.meters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:8px}
.meter{font-size:11.5px;color:var(--muted)}
.meter .bar{height:6px;border-radius:4px;background:var(--surface-2);overflow:hidden;margin-top:4px}
.meter .bar i{display:block;height:100%;background:var(--accent);border-radius:4px}
.meter.ok .bar i{background:var(--ok)}
.att{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);font-size:13.5px}
.att:last-child{border-bottom:0}
.att b{display:block;font-size:14px}
.att small{color:var(--muted)}
.att button{flex:none}

/* ---------- sidebar diciutkan: hanya ikon (layar lebar saja; di HP/tablet menu tetap lewat tombol ☰) ---------- */
.sb-mini-btn{margin-left:auto;background:transparent}
.sb-nm{min-width:0}
@media (max-width:1099px){ .sb-mini-btn{display:none!important} }
@media (min-width:1100px){
  body.shell-on .sb{transition:width .2s ease}
  body.shell-on .wrap{transition:margin-left .2s ease}
  body.shell-on.sb-mini .sb{width:78px}
  body.shell-on.sb-mini .wrap{margin-left:78px}
  body.shell-on.sb-mini .sb-logo{flex-direction:column;gap:8px;padding:18px 0 12px;min-height:0}
  body.shell-on.sb-mini .sb-nm{display:none}
  body.shell-on.sb-mini .sb-mini-btn{margin:0}
  body.shell-on.sb-mini .sb-nav{padding:0 12px 16px}
  body.shell-on.sb-mini .sb-h{font-size:0;padding:6px 0 4px;margin-top:6px}
  body.shell-on.sb-mini .sb-h:first-child{padding:0}
  body.shell-on.sb-mini .sb-a{justify-content:center;padding:0;gap:0}
  body.shell-on.sb-mini .sb-a span{display:none}
  body.shell-on.sb-mini .sb-user{flex-direction:column;margin:10px 8px 14px;padding:10px 6px;gap:8px}
  body.shell-on.sb-mini .sb-user .who{display:none}
}