/* =====================================================================
   STARIS redesign, round 1 (Dec 2026). Loaded AFTER styles.css, so it only adds and overrides.
   styles.css (edited by Ryan on GitHub) is left untouched.
   ===================================================================== */

/* ---------- unit colours: dot · ring · chip background · chip text ---------- */
.u-TK {--c:#FFD700;--cr:#C9A000;--cb:#FFF6CC;--ci:#6B5600}
.u-SD {--c:#D7263D;--cr:#D7263D;--cb:#FBE7EA;--ci:#A01C2E}
.u-SMP{--c:#0A84D6;--cr:#0A84D6;--cb:#E3F1FB;--ci:#075E99}
.u-SMA{--c:#6B7685;--cr:#6B7685;--cb:#EEF0F3;--ci:#454D59}
.u-YYS{--c:#004889;--cr:#004889;--cb:#E8F0F8;--ci:#004889}
:root{--warn:#9A5B00;--warn-bg:#FFF4E5;--warn-line:#F5C98B;--tabbar-h:76px}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.grow{flex:1}
.vstack{display:flex;flex-direction:column;gap:12px;min-width:0}
.phone-only{display:none}

/* ---------- global sizes (§7): 16 px inputs stop iPhone zoom, 44 px touch targets ---------- */
.field label,.flab,.flabel2{font-size:14px;font-weight:600;color:var(--ink)}
.field input,.field select,.field textarea,.facitem input,.psearch,.toolbar select,.dateinput,
.pubin input,.panel select,.panel input[type=text]{font-size:16px;min-height:46px;padding:10px 14px;border-radius:10px}
.field textarea{min-height:88px}
.field input[type=date],.field input[type=time]{padding-block:8px}
.field input[aria-invalid="true"]{border-color:var(--danger);outline:3px solid var(--danger-bg);outline-offset:0}
.hint,.help{font-size:13.5px;color:var(--muted);line-height:1.45}
.help{display:block}
.btn{min-height:44px;padding:10px 16px;font-size:14.5px}
.btn.primary{font-weight:600}
.navbtn{width:44px;min-width:44px}
.iconclose{width:44px;height:44px;padding:0;font-size:18px}
.check{min-height:44px;font-size:14.5px}
.check input{width:20px;height:20px}
.check.big{font-size:15px;font-weight:600}
.docopt{padding:14px;border-radius:12px;gap:12px}
.docopt input{width:20px;height:20px}
.docopt b{font-size:15px}
.docopt small{font-size:13px;margin-top:2px}
.linkbtn.big{min-height:44px;font-size:14.5px;padding:0 2px}
.linkbtn.red{color:var(--danger)}
.err{font-size:14px}
.dateinput{border:1px solid var(--line-strong);background:var(--surface)}
.nav{min-height:44px}
.sheet{gap:16px}
.sheet h2{font-size:19px}
.seg{border-radius:10px}
.seg button{min-height:38px;padding:6px 16px;font-size:14px}
.seg button[aria-pressed="true"]{background:var(--accent);color:#fff}

/* ---------- toolbar + unit filter (option A) ---------- */
.toolbar{gap:10px 16px}
.ufilter{display:flex;align-items:center;gap:10px;min-width:0;flex-wrap:wrap}
.uf-label{font-size:14px;font-weight:600;color:var(--muted)}
.chips{gap:8px}
.chip{height:40px;padding:0 14px;font-size:14px;gap:7px;border-color:var(--line);background:#fff;color:var(--ink);position:relative}
.chip::after{content:"";position:absolute;inset:-2px 0}            /* 44 px touch area */
.chip .dot{width:9px;height:9px;background:var(--c);box-shadow:0 0 0 1px var(--cr,var(--c))}
.chip .tick{font-weight:700}
.chip[aria-pressed="false"]{color:var(--ink);background:#fff}
.chip[aria-pressed="false"] .dot{background:var(--c);box-shadow:0 0 0 1px var(--cr,var(--c));opacity:1}
.chip.on{background:var(--cb);color:var(--ci);border-color:var(--cr)}
.chip.off{background:var(--sunk);color:#6B7685}
.chip.off .dot{opacity:.35}
.chip-all[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#fff}
.chip-all[aria-pressed="false"]{border-color:var(--line-strong)}
.chip-kind.on{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
.facsel{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--muted)}
.facsel select{min-height:44px;font-size:15px;color:var(--ink);font-weight:500}
.alert-pill{min-height:40px;padding:6px 14px;font-size:13.5px}

/* ---------- Kalender ---------- */
.vhead{gap:8px 10px}
.vhead h2{font-size:20px}
.bang-pill{display:inline-flex;align-items:center;gap:3px;background:var(--danger);color:#fff;border-radius:999px;padding:1px 7px;font-size:11px;font-weight:700;line-height:1.5;white-space:nowrap}
.legend .bang-pill{margin-right:6px}
.ev{background:var(--cb);color:var(--ci);border-left:0;border-radius:6px;padding:3px 7px;font-weight:600;display:flex;align-items:center;gap:5px}
.ev .edot{width:7px;height:7px;border-radius:50%;background:var(--c);box-shadow:0 0 0 1px var(--cr,var(--c));flex:none}
.ev b{color:var(--ci)}
.ev .t{color:var(--ci);opacity:.8;margin-right:0}
.ev.clash{background:var(--danger-bg);color:var(--danger);box-shadow:inset 0 0 0 1px var(--danger)}
.ev.libur{background:#FFF4F4;color:#A01C2E}
.daylist .ev{display:flex;flex-wrap:wrap;min-height:44px}
.fas-flag{width:9px;height:9px;border-radius:50%;background:#E08A00;flex:none;margin-left:auto;box-shadow:0 0 0 2px #fff}
.fas-flag.red{background:var(--danger)}
.dnum{gap:4px}

/* ---------- first-time guide ---------- */
.guide{background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:20px 22px;display:flex;flex-direction:column;gap:14px;border-top:4px solid var(--accent)}
.guide h2{margin:2px 0 4px;font-size:20px}
.guide p{margin:0;color:var(--muted);max-width:70ch}
.guide-prog{display:flex;align-items:center;gap:10px;font-size:13.5px;color:var(--muted);margin-top:10px}
.bar-bg{width:160px;height:8px;border-radius:999px;background:var(--sunk);overflow:hidden}
.bar-fg{height:100%;background:var(--accent);border-radius:999px}
.guide-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.guide-steps li{display:flex;align-items:center;gap:14px;border:1px solid var(--line);border-radius:12px;padding:12px 14px;flex-wrap:wrap}
.guide-steps li.done{background:var(--ok-bg);border-color:#BFE3CC}
.gnum{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-weight:700;background:var(--accent-soft);color:var(--accent);flex:none}
.done .gnum{background:var(--ok);color:#fff}
.gtxt{flex:1;min-width:200px}
.gt{font-weight:700}
.gd{font-size:13.5px;color:var(--muted)}
.guide .linkbtn{align-self:flex-start;min-height:44px}

/* ---------- Jadwal Fasilitas (desktop day): 06–21 fits the width, 68 px rows ---------- */
.fgrid{min-width:640px}
.frow{grid-template-columns:170px minmax(0,1fr)}
.ftrack{background-image:none;position:relative;min-height:68px;cursor:default}
.ftrack::before{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:repeating-linear-gradient(90deg,var(--line) 0 1px,transparent 1px calc(100% / 15))}
.ftrack.can{cursor:pointer}
.fhead .ftrack{min-height:34px}
.fhead .ftrack::before{display:none}
.fhead .hr{transform:translateX(3px)}
.bar{height:26px;border-left:0;background:var(--cb);color:var(--ci);font-weight:600;display:flex;align-items:center;gap:6px;padding:3px 8px;z-index:2}
.bar b{color:var(--ci)}
.bar .bt{font-family:var(--mono);font-size:11px;opacity:.85;margin-left:auto}
.bar.dim{opacity:.4}
.bar.clash{color:var(--danger)}
.fghost{min-width:max-content;position:absolute;top:6px;bottom:6px;border:1.5px dashed var(--accent);border-radius:8px;background:var(--accent-soft);color:var(--accent);font-size:12.5px;font-weight:700;display:flex;align-items:center;padding:0 8px;white-space:nowrap;overflow:hidden;pointer-events:none;z-index:1}
.lg-ghost,.lg-clash{display:inline-block;width:16px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.lg-ghost{border:1.5px dashed var(--accent);background:var(--accent-soft)}
.lg-clash{background:repeating-linear-gradient(135deg,#FDECEC 0 3px,#fff 3px 6px);box-shadow:inset 0 0 0 1px var(--danger)}
/* week */
.fweek-wrap{background:#fff;border:1px solid var(--line);border-radius:var(--r);overflow-x:auto;box-shadow:var(--shadow)}
.fweek{width:100%;border-collapse:collapse;table-layout:fixed;min-width:760px}
.fweek th,.fweek td{border-bottom:1px solid var(--line);border-right:1px solid var(--line);padding:8px;vertical-align:top;text-align:left}
.fweek thead th{font-size:13px;color:var(--muted);font-weight:600;background:#fff}
.fweek tbody th{width:170px;font-weight:600}
.fweek th small{display:block;color:var(--muted);font-weight:400;font-size:12px}
.fweek td{cursor:pointer;height:68px}
.fweek td:hover{background:var(--accent-soft)}
.fweek .today{background:#F5F9FD}
.wk-item{display:flex;align-items:center;gap:4px;width:100%;border:0;border-radius:6px;background:var(--cb);color:var(--ci);font-size:12px;font-weight:600;padding:4px 6px;margin-bottom:4px;cursor:pointer;text-align:left;min-height:28px}
.wk-item.clash{background:var(--danger-bg);color:var(--danger);box-shadow:inset 0 0 0 1px var(--danger)}
.wk-item.dim{opacity:.4}
.wk-item .mono{font-size:11px}

/* phone: one card per facility */
.faccards{display:flex;flex-direction:column;gap:10px}
.faccard{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:8px}
.fc-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.fc-head b{font-size:16px}
.fc-head span{font-size:13px;color:var(--muted)}
.fc-bar{position:relative;height:14px;border-radius:999px;background:#E9F6EE;overflow:hidden}
.fc-bar span{position:absolute;top:0;bottom:0;background:#9AA6B6}
.fc-bar span.clash{background:var(--danger)}
.fc-ticks{display:flex;justify-content:space-between;font-family:var(--mono);font-size:11px;color:var(--muted);margin-top:-4px}
.fc-busy{display:flex;flex-direction:column;gap:4px}
.fc-item{display:block;width:100%;text-align:left;border:0;border-radius:8px;background:var(--cb);color:var(--ci);font-size:13.5px;padding:8px 10px;min-height:40px;cursor:pointer}
.fc-item.clash{background:var(--danger-bg);color:var(--danger)}
.fc-free{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:13.5px;color:var(--muted)}
.freechip{display:inline-flex;align-items:center;min-height:40px;padding:0 12px;border-radius:999px;border:1px solid #BFE3CC;background:var(--ok-bg);color:var(--ok);font-weight:700;font-size:14px;cursor:pointer;font-family:inherit}
.freechip.ro{cursor:default;min-height:32px}
button.freechip:hover{border-color:var(--ok)}

/* ---------- Agenda: week strip + grouped cards ---------- */
.agenda{gap:14px}
.wkstrip{display:none;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:6px}
.wkd{height:56px;border:0;border-radius:12px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer;color:var(--ink);font-family:inherit}
.wkd .wd{font-size:11.5px;font-weight:600}
.wkd .wn{font-size:16px;font-weight:700}
.wkd .wdot{width:5px;height:5px;border-radius:50%}
.wkd .wdot.on{background:var(--accent)}
.wkd.sun{color:var(--danger)}
.wkd.sel{background:var(--accent);color:#fff}
.wkd.sel .wdot.on{background:#fff}
.agenda-filters{gap:4px 18px}
.cards{display:flex;flex-direction:column;gap:10px}
.glabel{font-size:13px;font-weight:700;color:var(--muted);margin-top:6px}
.acard{display:flex;gap:12px;padding:12px 14px;background:#fff;border:1px solid var(--line);border-radius:12px;cursor:pointer;color:var(--ink);min-height:44px}
.acard:hover{border-color:var(--line-strong);background:#FBFCFE}
.abar{flex:none;width:4px;border-radius:4px;background:var(--c)}
.abody{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.at{font-size:15.5px;font-weight:600}
.am{font-size:13px;color:var(--muted)}
.am .mono{font-size:12.5px}
.atags{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.ubadge2{flex:none;align-self:flex-start;font-size:12px;font-weight:700;padding:3px 8px;border-radius:999px;background:var(--cb);color:var(--ci)}
.place-belum{color:var(--warn);font-weight:700}
.place-belum.red{color:var(--danger)}

/* ---------- Pengaturan / Lainnya ---------- */
.lainnya{display:flex;flex-direction:column;gap:18px;max-width:640px}
.lgl{font-size:12px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);margin:0 0 8px}
.lgroup{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.lrow{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:0 16px;border:0;border-top:1px solid #EEF1F5;background:#fff;text-align:left;font-family:inherit;font-size:15px;color:var(--ink);cursor:pointer}
.lrow:first-child{border-top:0}
.lrow:hover{background:var(--accent-soft)}
.lrow .lt{flex:1;font-weight:600}
.lrow .lh{color:var(--muted);font-size:13.5px}
.lrow .lch{color:var(--muted);font-size:20px}
.lrow.red .lt{color:var(--danger)}
.lcard{background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px;flex-direction:column;gap:14px;align-items:center}
.l-logo{height:56px;width:auto}
.l-user{display:flex;align-items:center;gap:12px;align-self:stretch;border-top:1px solid var(--line);padding-top:12px}
.l-user .avatar{width:40px;height:40px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:700}
.howto{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:10px;font-size:15px}

/* ---------- side panel with pinned footer (Kegiatan form) ---------- */
.sheet.panel{padding:0;gap:0;width:min(480px,100%);overflow:hidden}
.p-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(12px + env(safe-area-inset-top,0px)) 16px 12px 24px;border-bottom:1px solid var(--line);flex:none}
.p-body{flex:1;overflow-y:auto;padding:20px 24px 28px;-webkit-overflow-scrolling:touch}
.p-foot{flex:none;display:flex;gap:10px;justify-content:flex-end;padding:14px 24px calc(14px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);background:#fff}
.p-foot .btn{min-height:46px;padding-inline:20px;font-size:15px}
.kform{display:flex;flex-direction:column;gap:18px}
.chips.pick{flex-wrap:wrap}
.row3{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:10px}
.switch{display:flex;align-items:center;justify-content:space-between;min-height:44px;font-size:15px;font-weight:500;cursor:pointer;position:relative}
.switch input{position:absolute;opacity:0;width:46px;height:28px;right:0;margin:0;cursor:pointer}
.switch .sw{width:46px;height:28px;border-radius:999px;background:#CBD3DE;position:relative;flex:none;transition:background .15s}
.switch .sw::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgb(0 0 0/.2);transition:left .15s}
.switch input:checked+.sw{background:var(--accent)}
.switch input:checked+.sw::after{left:21px}
.switch input:focus-visible+.sw{outline:2px solid var(--accent);outline-offset:2px}
.fas-sec{border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:14px;background:#FAFBFD}
.fas-sec h3{margin:0;font-size:16px}
.fopts{display:flex;flex-direction:column;gap:8px}
.fopt{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:48px;padding:6px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:15px;font-weight:600;cursor:pointer}
.fopt input{width:20px;height:20px;margin:0;accent-color:var(--accent)}
.fopt .fo-s{font-weight:400;color:var(--muted);font-size:13px}
.fopt.on{border:1.5px solid var(--accent);background:var(--accent-soft);color:var(--accent)}
.bk-block{display:flex;flex-direction:column;gap:12px;border-top:1px dashed var(--line-strong);padding-top:14px}
.bk-block:first-child{border-top:0;padding-top:0}
.bk-n{font-weight:700;font-size:14px;color:var(--accent)}
.bk-actions{display:flex;justify-content:space-between;align-items:center}
.avail{padding:10px 12px;border-radius:10px;font-size:14px;font-weight:600}
.avail.good{background:var(--ok-bg);color:var(--ok)}
.avail.bad{background:var(--danger-bg);color:var(--danger)}
.belum-hint{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn);border-radius:10px;padding:10px 12px}

/* ---------- detail ---------- */
.dmeta{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.dsub{margin:4px 0 -6px;font-size:15px}
.bk-list{display:flex;flex-direction:column;gap:8px}
.bk-item{border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:4px}
.bk-item.clash{border-color:#F4C7C7}
.bk-t{font-weight:700}
.bk-m{display:flex;flex-wrap:wrap;gap:4px 12px;color:var(--muted);font-size:13.5px}
.belum-box{border:1px solid var(--warn-line);background:var(--warn-bg);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.belum-box h3{margin:0;font-size:16px;color:var(--warn)}
.belum-box p{margin:0;font-size:14px;color:var(--ink)}
.belum-box.red{background:var(--danger-bg);border-color:#F4C7C7}
.belum-box.red h3{color:var(--danger)}
.bb-free{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:13.5px;color:var(--muted)}
.bb-actions{display:flex;flex-direction:column;gap:8px}
.bb-actions .btn{width:100%}

/* ---------- login ---------- */
.pw-wrap{position:relative;display:flex}
.pw-wrap input{padding-right:84px}
.pw-show{position:absolute;right:4px;top:50%;transform:translateY(-50%);min-height:40px;min-width:44px;padding:0 10px;border:0;background:transparent;color:var(--accent);font-weight:700;font-size:14px;cursor:pointer;border-radius:8px;font-family:inherit}
.pw-show:hover{background:var(--accent-soft)}
#pw-err:empty{display:none}
.gate-foot{gap:0 18px}
.gate-foot a{display:inline-flex;align-items:center;min-height:44px}
.gate-card .btn.primary{min-height:48px;font-size:15.5px}

/* ---------- phone tab bar + round "+" ---------- */
.tabbar,.fab{display:none}

@media (max-width:760px){
  .phone-only{display:flex}
  /* bottom tab bar replaces the drawer */
  .sidebar,.sb-scrim,#sb-toggle{display:none!important}
  .main{margin-left:0}
  .tabbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:20;background:#fff;border-top:1px solid var(--line);
    height:calc(var(--tabbar-h) + env(safe-area-inset-bottom,0px));padding:0 0 calc(10px + env(safe-area-inset-bottom,0px))}
  .tabbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;background:none;font-family:inherit;font-size:12px;font-weight:600;color:var(--muted);cursor:pointer;min-height:44px}
  .tb-ic{width:44px;height:28px;border-radius:999px;display:grid;place-items:center}
  .tb-ic .ic{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  .tabbar button[aria-current="page"]{color:var(--accent);font-weight:700}
  .tabbar button[aria-current="page"] .tb-ic{background:var(--accent-soft)}
  .fab{display:grid;place-items:center;position:fixed;right:16px;bottom:calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom,0px));z-index:21;width:60px;height:60px;border-radius:50%;border:0;
    background:var(--accent);color:#fff;font-size:30px;line-height:1;box-shadow:0 6px 16px rgb(0 72 137/.35);cursor:pointer;font-family:inherit}
  .fab[hidden]{display:none}
  .main .wrap{padding:14px 16px calc(var(--tabbar-h) + 96px)}
  .main .topbar{padding:12px 16px;padding-top:calc(12px + env(safe-area-inset-top,0px))}
  #btn-add{display:none!important}
  .page-title h1{font-size:21px}
  /* filter: one row, scrolls sideways */
  .toolbar{flex-wrap:nowrap;flex-direction:column;align-items:stretch;gap:8px}
  .toolbar .spacer{display:none}
  .ufilter{flex-wrap:nowrap}
  .uf-label{display:none}
  .ufilter .chips{flex-wrap:nowrap;overflow-x:auto;margin-right:-16px;padding-right:16px;scrollbar-width:none;padding-block:2px}
  .ufilter .chips::-webkit-scrollbar{display:none}
  .chip{flex:none;height:40px}
  .alert-pill{align-self:flex-start}
  .wkstrip{display:grid}
  .vhead h2{font-size:18px;min-width:0}
  .vhead .seg{order:5}
  /* full-screen form, pinned buttons */
  .sheet,.sheet.panel{width:100%}
  .p-body{padding:16px 16px 24px}
  .p-head{padding-left:16px}
  .p-foot{padding-inline:16px}
  .p-foot .btn{flex:1}
  .row3{grid-template-columns:1fr 1fr}
  .row3 .field:first-child{grid-column:1/-1}
  .lainnya{max-width:none}
  .lcard{display:flex}
  .guide{padding:16px}
  .guide-steps .btn{width:100%}
  .toast{bottom:calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom,0px))}
}
@media (prefers-reduced-motion:reduce){.switch .sw,.switch .sw::after{transition:none}}
.ev .etl{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.daylist .ev .etl{white-space:normal}
.fas-flag{margin-left:0}
/* round 2 (3 Dec 2026) */
.aneeds{font-size:13px;color:var(--ink)}
.aneeds b{font-weight:600;color:var(--muted)}
.req{color:var(--danger)}
