/* ============ RESET & TOKENS ============ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
html{overflow-x:hidden}
body{overscroll-behavior-y:none;overflow-x:hidden;width:100%}
img,svg{max-width:100%}
:root{
  --radius-sm:8px; --radius:14px; --radius-lg:20px;
  --font-display:'Sora',system-ui,sans-serif;
  --font-body:'Inter',system-ui,sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,monospace;
  --brand:#1B4332; --brand2:#2F7D5E; --gold:#C9A227; --gold-ink:#C9A227;
  --danger:#D64545; --success:#2F9E6B; --warn:#D9A404;
  --shadow:0 10px 30px -12px rgba(0,0,0,.5);
  --shadow-sm:0 4px 14px -6px rgba(0,0,0,.4);
}
html[data-theme="dark"]{
  --bg:#0F1216; --bg-soft:#14181E; --surface:#191E25; --surface2:#20262F;
  --border:#2E3540; --text:#F3F5F7; --text-dim:#AEB6C2; --text-faint:#828C98;
  --overlay:rgba(6,8,10,.72);
}
html[data-theme="light"]{
  --bg:#F3F2EE; --bg-soft:#ECEAE4; --surface:#FFFFFF; --surface2:#F3F1EA;
  --border:#D8D4C8; --text:#15171A; --text-dim:#4A4F55; --text-faint:#5E6469;
  --overlay:rgba(20,18,14,.45);
  --gold-ink:#7C5C0C; --success:#1F7A50; --danger:#B4302F; --warn:#8A6608;
}
body{
  background:var(--bg); color:var(--text); font-family:var(--font-body);
  min-height:100vh; -webkit-font-smoothing:antialiased; line-height:1.45;
  transition:background .25s ease,color .25s ease;
}
h1,h2,h3,h4{font-family:var(--font-display);font-weight:700;letter-spacing:-.01em}
button{font-family:inherit;cursor:pointer;color:inherit;background:none;border:0;text-align:inherit}
input,select,textarea{font-family:inherit;color:var(--text)}
a{color:inherit}
::selection{background:var(--gold);color:#141414}
.num{font-family:var(--font-mono)}
.scrim{position:fixed;inset:0;background:var(--overlay);backdrop-filter:blur(3px);z-index:40}
.hidden{display:none !important}
@media (prefers-reduced-motion:reduce){*{animation-duration:.001ms !important;transition-duration:.001ms !important}}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:20px}
::-webkit-scrollbar-track{background:transparent}

/* ============ APP ROOT / SPLASH ============ */
#app{min-height:100vh;position:relative}
.splash{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:26px;padding:24px;text-align:center}
.seal{width:78px;height:78px;border-radius:50%;border:2.5px solid var(--gold);display:flex;align-items:center;justify-content:center;position:relative;animation:pulseSeal 2.2s ease-in-out infinite}
.seal::before{content:'';position:absolute;inset:6px;border:1px dashed var(--gold);border-radius:50%;opacity:.5}
.seal svg{width:34px;height:34px}
@keyframes pulseSeal{0%,100%{box-shadow:0 0 0 0 rgba(201,162,39,.25)}50%{box-shadow:0 0 0 10px rgba(201,162,39,0)}}
.splash h1{font-size:26px}
.splash .tag{color:var(--text-dim);font-size:13.5px;max-width:320px}
.progress-wrap{width:min(320px,80vw);height:5px;background:var(--surface2);border-radius:20px;overflow:hidden;border:1px solid var(--border)}
.progress-bar{height:100%;width:0%;background:linear-gradient(90deg,var(--brand2),var(--gold));border-radius:20px;transition:width .25s ease}
.progress-label{font-family:var(--font-mono);font-size:11.5px;color:var(--text-faint);letter-spacing:.04em}

/* ============ GATE ============ */
.gate{min-height:calc(100vh - 56px);display:flex;align-items:center;justify-content:center;padding:24px}
.page-toolbar{display:flex;justify-content:flex-end;align-items:center;padding:12px 16px 0;max-width:1180px;margin:0 auto;width:100%}
.gate-card{width:min(400px,100%);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:34px 30px;box-shadow:var(--shadow)}
.gate-brand{display:flex;align-items:center;gap:10px;margin-bottom:22px}
.gate-brand .mark{width:38px;height:38px;border-radius:9px;background:linear-gradient(145deg,var(--brand2),var(--brand));display:flex;align-items:center;justify-content:center;color:#EFE8D2;font-family:var(--font-display);font-weight:800;font-size:16px}
.gate-brand div b{display:block;font-family:var(--font-display);font-size:15px}
.gate-brand div span{font-size:11.5px;color:var(--text-faint)}
.gate h2{font-size:20px;margin-bottom:6px}
.gate p.sub{color:var(--text-dim);font-size:13px;margin-bottom:22px}
.pin-boxes{display:flex;gap:9px;margin-bottom:8px}
.pin-boxes input{width:100%;aspect-ratio:1/1;text-align:center;font-family:var(--font-mono);font-size:22px;font-weight:600;background:var(--surface2);border:1.5px solid var(--border);border-radius:10px;color:var(--text);outline:none;transition:border-color .15s}
.pin-boxes input:focus{border-color:var(--gold)}
.gate-error{color:var(--danger);font-size:12.5px;min-height:16px;margin-top:6px}
.hint-box{margin-top:16px;padding:12px 14px;background:var(--surface2);border:1px dashed var(--border);border-radius:10px;font-size:12px;color:var(--text-dim)}
.hint-box b{color:var(--text)}
.btn{border:none;border-radius:10px;padding:12px 18px;font-weight:600;font-size:14px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:transform .1s,filter .15s,background .15s}
.btn:active{transform:scale(.97)}
.btn-primary{background:linear-gradient(145deg,var(--brand2),var(--brand));color:#F3EFE1;width:100%;margin-top:18px;padding:13px}
.btn-primary:hover{filter:brightness(1.08)}
.btn-ghost{background:transparent;border:1px solid var(--border);color:var(--text)}
.btn-ghost:hover{background:var(--surface2)}
.btn-danger{background:var(--danger);color:#fff}
.btn-gold{background:var(--gold);color:#1c1706}
.btn-sm{padding:8px 12px;font-size:12.5px;border-radius:8px}
.btn-icon{width:38px;height:38px;padding:0;border-radius:9px;background:var(--surface2);border:1px solid var(--border);color:var(--text);display:flex;align-items:center;justify-content:center}
.btn-icon:hover{background:var(--border)}

/* theme toggle floating */
.theme-toggle{position:fixed;top:16px;right:16px;z-index:30;display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--border);border-radius:30px;padding:5px;box-shadow:var(--shadow-sm)}
.theme-toggle.inline{position:static;top:auto;right:auto;z-index:auto;box-shadow:none;flex-shrink:0}
.theme-toggle button{width:32px;height:32px;border-radius:50%;border:none;background:transparent;color:var(--text-dim);display:flex;align-items:center;justify-content:center}
.theme-toggle button.active{background:var(--brand);color:#F3EFE1}
.install-btn{position:fixed;bottom:18px;right:18px;z-index:30}

/* ============ HUB ============ */
.hub{max-width:1180px;margin:0 auto;padding:22px 18px 50px;width:100%}
.hub-top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.hub-brand{display:flex;align-items:center;gap:12px;min-width:0}
.hub-brand .mark{width:44px;height:44px;flex-shrink:0;border-radius:10px;background:linear-gradient(145deg,var(--brand2),var(--brand));display:flex;align-items:center;justify-content:center;color:#EFE8D2;font-family:var(--font-display);font-weight:800}
.hub-brand h1{font-size:19px;line-height:1.2}
.hub-brand span{font-size:11.5px;color:var(--text-faint)}
.role-chip{font-size:11px;padding:5px 11px;border-radius:20px;border:1px solid var(--border);color:var(--text-dim);font-family:var(--font-mono);white-space:nowrap}
.role-chip.admin{border-color:var(--gold);color:var(--gold-ink)}
.hub-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hub-section-lbl{font-size:11.5px;color:var(--text-faint);text-transform:uppercase;letter-spacing:.06em;margin:22px 2px 12px;font-weight:600}
.hub-section-lbl:first-child{margin-top:0}

/* unified hub card grid (calendar / usaha / tambah / pengaturan) */
.hub-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px;width:100%}
.hub-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;cursor:pointer;text-align:left;transition:transform .15s,border-color .15s,box-shadow .15s;position:relative;overflow:hidden;min-width:0;display:flex;flex-direction:column}
.hub-card:hover{transform:translateY(-3px);border-color:var(--card-accent,var(--gold));box-shadow:var(--shadow-sm)}
.hub-card .icon{width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:14px;flex-shrink:0}
.hub-card h3{font-size:15.5px;margin-bottom:4px;overflow-wrap:anywhere}
.hub-card p{font-size:12px;color:var(--text-dim);margin-bottom:14px;flex:1}
.hub-card .foot{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--text-faint);gap:6px;margin-top:auto}
.hub-card .foot .lock{font-family:var(--font-mono);white-space:nowrap}
.hub-card.cal-card{background:linear-gradient(150deg,color-mix(in srgb, var(--brand) 18%, var(--surface)),var(--surface))}
.cal-card-dots{display:flex;gap:5px;margin-bottom:14px}
.cal-card-dots span{width:8px;height:8px;border-radius:50%}
.hub-card.dashed{border:1.5px dashed var(--border);background:transparent;align-items:center;justify-content:center;text-align:center;min-height:168px;color:var(--text-dim);gap:8px}
.hub-card.dashed:hover{border-color:var(--gold);color:var(--gold)}
.hub-card.dashed .plus{font-size:26px}
.hub-card.dashed span.lbl{font-size:12.5px;font-weight:600}
.employee-note{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px;color:var(--text-dim);font-size:13px;display:flex;gap:12px;align-items:flex-start;margin-top:22px}

/* ============ CALENDAR PAGE ============ */
.page-topbar{display:flex;align-items:center;gap:12px;max-width:1180px;margin:0 auto;padding:16px 18px 0}
.page-topbar h1{font-size:17px}
.cal-section{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px;margin:16px auto 0;max-width:1180px;box-shadow:var(--shadow-sm);width:calc(100% - 36px)}
.cal-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:14px}
.cal-title{display:flex;align-items:center;gap:9px;min-width:0}
.cal-title h2{font-size:16px}
.cal-nav-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px;width:100%}
.cal-nav-row .btn-icon{flex-shrink:0;width:34px;height:34px}
.cal-nav{display:flex;align-items:center;gap:6px}
.cal-month-label{font-family:var(--font-mono);font-size:12.5px;color:var(--text-dim);text-align:center;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cal-legend{display:flex;flex-wrap:wrap;gap:8px 14px;font-size:11.5px;color:var(--text-dim);margin-bottom:14px}
.cal-legend span.item{display:inline-flex;align-items:center;white-space:nowrap}
.cal-legend .dot{width:7px;height:7px;border-radius:50%;display:inline-block;margin-right:5px;flex-shrink:0}
.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;width:100%}
.cal-dow{text-align:center;font-size:10px;color:var(--text-faint);font-weight:600;padding-bottom:4px;text-transform:uppercase;letter-spacing:.02em}
.cal-cell{aspect-ratio:1/1;min-height:0;min-width:0;border-radius:8px;border:1px solid transparent;background:var(--surface2);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;position:relative;cursor:pointer;transition:background .12s,border-color .12s;padding:2px}
.cal-cell:hover{border-color:var(--gold)}
.cal-cell.empty{background:transparent;cursor:default}
.cal-cell.empty:hover{border-color:transparent}
.cal-cell.today{border-color:var(--brand2);background:color-mix(in srgb, var(--brand2) 12%, var(--surface2))}
.cal-cell .d{font-family:var(--font-mono);font-size:12px}
.cal-cell .dots{display:flex;gap:2px;flex-wrap:wrap;justify-content:center;max-width:100%}
.cal-cell .dots span{width:4.5px;height:4.5px;border-radius:50%;flex-shrink:0}
.cal-empty-msg{font-size:12.5px;color:var(--text-faint);text-align:center;padding:6px 0 2px}
@media(min-width:640px){
  .cal-cell{min-height:52px}
  .cal-cell .d{font-size:13px}
  .cal-cell .dots span{width:5px;height:5px}
  .cal-section{padding:22px}
}

/* ============ SETTINGS / REORDER PAGE ============ */
.settings-list{display:flex;flex-direction:column;gap:10px;max-width:640px;margin:16px auto 0;padding:0 18px}
.settings-row{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}
.settings-row .ic{width:38px;height:38px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:17px;flex-shrink:0}
.settings-row .info{flex:1;min-width:0}
.settings-row .info b{display:block;font-size:13.5px;overflow-wrap:anywhere}
.settings-row .info span{font-size:11px;color:var(--text-faint)}
.settings-row .order-ctrl{display:flex;flex-direction:column;gap:2px}
.settings-row .order-ctrl button{width:24px;height:20px;border:1px solid var(--border);background:var(--surface2);color:var(--text-dim);border-radius:5px;font-size:10px;line-height:1}
.settings-row .row-actions{display:flex;gap:6px}

/* ============ MODAL ============ */
.modal-wrap{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:16px}
.modal{width:min(440px,100%);max-height:88vh;overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:26px;box-shadow:var(--shadow);animation:modalIn .18s ease}
.modal.modal-lg{width:min(640px,100%)}
@keyframes modalIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.modal-head h3{font-size:17px}
.modal-close{background:none;border:none;color:var(--text-dim);font-size:20px;line-height:1;padding:4px}
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;color:var(--text-dim);margin-bottom:6px;font-weight:600}
.field input,.field select,.field textarea{width:100%;padding:11px 12px;border-radius:9px;border:1px solid var(--border);background:var(--surface2);font-size:13.5px;outline:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--gold)}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.checkbox-group{display:flex;flex-direction:column;gap:2px;max-height:150px;overflow:auto;border:1px solid var(--border);border-radius:9px;padding:6px}
.chk-item{display:flex;align-items:center;gap:9px;font-size:13px;padding:7px 8px;border-radius:7px;cursor:pointer}
.chk-item:hover{background:var(--surface2)}
.chk-item input{width:15px;height:15px;flex-shrink:0;accent-color:var(--biz,var(--brand2))}
.modal-actions{display:flex;gap:10px;margin-top:6px}
.modal-actions .btn{flex:1}

/* ============ BIZ APP SHELL ============ */
.biz-app{min-height:100vh;display:flex;background:var(--bg)}
.biz-sidebar{width:220px;flex-shrink:0;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:20px 14px;gap:18px;position:sticky;top:0;height:100vh}
.biz-sidebar .biz-id{display:flex;align-items:center;gap:10px;padding:4px 6px 14px;border-bottom:1px solid var(--border)}
.biz-sidebar .biz-id .ic{width:38px;height:38px;border-radius:10px;background:var(--biz);display:flex;align-items:center;justify-content:center;font-size:18px}
.biz-sidebar .biz-id b{font-size:13.5px;display:block}
.biz-sidebar .biz-id span{font-size:10.5px;color:var(--text-faint)}
.biz-nav{display:flex;flex-direction:column;gap:3px;flex:1}
.biz-nav button{display:flex;align-items:center;gap:10px;padding:10px 12px;border:none;background:none;color:var(--text-dim);border-radius:9px;font-size:13px;font-weight:500;text-align:left}
.biz-nav button:hover{background:var(--surface2);color:var(--text)}
.biz-nav button.active{background:color-mix(in srgb, var(--biz) 18%, transparent);color:var(--text)}
.biz-nav button.active span.ic{color:var(--biz2,var(--biz))}
.biz-nav button span.ic{width:18px;text-align:center}
.biz-exit{width:100%}

.biz-topbar{display:none}
.biz-main{flex:1;min-width:0;padding:26px 30px 90px;max-width:1180px}
.biz-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:22px}
.biz-header h2{font-size:21px}
.biz-header .crumb{font-size:12px;color:var(--text-faint)}

/* mobile bottom nav */
.bottom-nav{display:none}

@media(max-width:900px){
  .biz-app{flex-direction:column}
  .biz-sidebar{display:none}
  .biz-topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;background:var(--surface);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:20;width:100%}
  .biz-topbar .biz-id{display:flex;align-items:center;gap:9px;min-width:0}
  .biz-topbar .biz-id .ic{width:32px;height:32px;flex-shrink:0;border-radius:9px;background:var(--biz);display:flex;align-items:center;justify-content:center;font-size:15px}
  .biz-topbar .biz-id b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .biz-main{padding:18px 16px 90px;width:100%;max-width:100%}
  .bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;background:var(--surface);border-top:1px solid var(--border);z-index:20;padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
  .bottom-nav button{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;background:none;border:none;color:var(--text-faint);font-size:9.5px;padding:6px 2px;border-radius:8px}
  .bottom-nav button.active{color:var(--biz2,var(--biz))}
  .bottom-nav button .ic{font-size:17px}
}

/* cards */
.grid-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin-bottom:24px}
.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px}
.stat-card .lbl{font-size:11.5px;color:var(--text-faint);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px;display:flex;align-items:center;justify-content:space-between}
.stat-card .val{font-family:var(--font-mono);font-size:22px;font-weight:700}
.stat-card .val.in{color:var(--success)}
.stat-card .val.out{color:var(--danger)}
.stat-card .sub{font-size:11px;color:var(--text-faint);margin-top:4px}

.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;margin-bottom:20px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.panel-head h3{font-size:15px}

.bars{display:flex;align-items:flex-end;gap:10px;height:130px;padding-top:10px}
.bars .bar-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;height:100%}
.bars .bar{width:100%;max-width:26px;border-radius:5px 5px 2px 2px;background:linear-gradient(180deg,var(--biz2,var(--brand2)),var(--biz,var(--brand)));min-height:3px}
.bars .bar-lbl{font-size:9.5px;color:var(--text-faint);font-family:var(--font-mono)}

.range-form{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.range-form .field{margin-bottom:0;min-width:130px}

/* tables */
.table-wrap{overflow-x:auto;border-radius:12px;border:1px solid var(--border)}
table{width:100%;border-collapse:collapse;font-size:13px;min-width:560px}
thead th{text-align:left;background:var(--surface2);color:var(--text-faint);font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;padding:11px 14px;font-weight:600;white-space:nowrap}
tbody td{padding:11px 14px;border-top:1px solid var(--border);white-space:nowrap}
tbody tr:hover{background:var(--surface2)}
.badge{display:inline-block;padding:3px 9px;border-radius:20px;font-size:10.5px;font-weight:600}
.badge.in{background:color-mix(in srgb, var(--success) 18%, transparent);color:var(--success)}
.badge.out{background:color-mix(in srgb, var(--danger) 18%, transparent);color:var(--danger)}
.badge.low{background:color-mix(in srgb, var(--danger) 18%, transparent);color:var(--danger)}
.badge.ok{background:color-mix(in srgb, var(--success) 18%, transparent);color:var(--success)}
.badge.rented{background:color-mix(in srgb, var(--warn) 20%, transparent);color:var(--warn)}
.row-actions{display:flex;gap:6px}
.row-actions button{width:29px;height:29px;border-radius:7px;border:1px solid var(--border);background:var(--surface2);color:var(--text-dim);font-size:12px}
.row-actions button:hover{color:var(--text);border-color:var(--text-faint)}
.empty-state{padding:34px 16px;text-align:center;color:var(--text-faint);font-size:12.5px}

/* kasir */
.kasir-layout{display:grid;grid-template-columns:1.6fr 1fr;gap:18px}
@media(max-width:840px){.kasir-layout{grid-template-columns:1fr}}
.menu-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
.menu-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px;text-align:left;transition:border-color .15s,transform .1s}
.menu-item:hover{border-color:var(--biz)}
.menu-item:active{transform:scale(.97)}
.menu-item .ic{font-size:24px;margin-bottom:8px}
.menu-item b{display:block;font-size:13px;margin-bottom:2px}
.menu-item .price{font-family:var(--font-mono);font-size:12.5px;color:var(--biz2,var(--biz))}
.rental-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.rental-item .top{display:flex;justify-content:space-between;align-items:center}
.rental-item b{font-size:13.5px}
.rental-item .rate{font-family:var(--font-mono);font-size:12px;color:var(--text-dim)}
.cart{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px;position:sticky;top:16px;display:flex;flex-direction:column;height:fit-content}
.cart h3{font-size:14px;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between}
.cart-list{display:flex;flex-direction:column;gap:10px;max-height:280px;overflow:auto;margin-bottom:12px}
.cart-item{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12.5px}
.cart-item .name{flex:1}
.qty-ctrl{display:flex;align-items:center;gap:6px}
.qty-ctrl button{width:22px;height:22px;border-radius:6px;border:1px solid var(--border);background:var(--surface2);color:var(--text)}
.cart-empty{color:var(--text-faint);font-size:12.5px;text-align:center;padding:20px 0}
.cart-total{display:flex;justify-content:space-between;font-family:var(--font-mono);font-weight:700;font-size:16px;padding-top:12px;border-top:1px dashed var(--border);margin-top:4px}
.pay-method{display:flex;gap:8px;margin:12px 0}
.pay-method button{flex:1;padding:10px 8px;border-radius:9px;border:1.5px solid var(--border);background:var(--surface2);color:var(--text-dim);font-size:12.5px;font-weight:600;text-align:center}
.pay-method button.active{border-color:var(--biz,var(--brand2));background:color-mix(in srgb, var(--biz,var(--brand2)) 16%, var(--surface2));color:var(--text)}
.badge.tunai{background:color-mix(in srgb, var(--success) 16%, transparent);color:var(--success)}
.badge.qris{background:color-mix(in srgb, var(--brand2) 20%, transparent);color:var(--brand2)}

/* receipt */
#printArea{display:none}
.receipt{width:280px;background:#fff;color:#111;font-family:var(--font-mono);padding:18px 16px;margin:0 auto;font-size:12px;line-height:1.6}
.receipt[data-size="80mm"]{width:380px;font-size:13px}
.receipt .r-center{text-align:center}
.receipt .r-small{font-size:10.5px}
.receipt .r-line{border-top:1px dashed #999;margin:8px 0}
.receipt .r-row{display:flex;justify-content:space-between;gap:6px}
.receipt .r-logo{max-width:80px;max-height:80px;object-fit:contain;margin-bottom:4px}
.receipt .stamp{width:70px;height:70px;border:2px solid #b3841b;border-radius:50%;color:#b3841b;display:flex;align-items:center;justify-content:center;margin:12px auto 4px;transform:rotate(-11deg);font-weight:700;font-size:11px;text-align:center;letter-spacing:.03em}
@media print{
  body.printing > *:not(#printArea){display:none !important}
  body.printing #printArea{display:block !important;position:fixed;top:0;left:0;width:100%}
  @page{margin:6mm}
}

/* ============ NOTA (STRUK) EDITOR ============ */
.nota-editor-grid{display:grid;grid-template-columns:1fr;gap:20px}
@media (min-width:920px){
  .nota-editor-grid{grid-template-columns:1fr 340px;align-items:start}
}
.nota-form-col{min-width:0}
.nota-preview-col{min-width:0}
.nota-preview-panel{position:sticky;top:16px}
.nota-preview-pane{background:var(--surface2);border-radius:12px;padding:12px 0;overflow:auto;max-height:70vh}
.nota-check-row{display:flex;align-items:center;gap:10px;font-size:13.5px;font-weight:600;padding:10px 0 6px;border-top:1px solid var(--border)}
.nota-check-row:first-of-type{border-top:none;padding-top:2px}
.nota-check-row input[type="checkbox"]{width:18px;height:18px;accent-color:var(--gold);flex-shrink:0}
.nota-field{margin:0 0 4px 28px}
.nota-logo-row{display:flex;align-items:center;gap:12px;margin:6px 0 6px 28px}
.nota-logo-thumb{width:48px;height:48px;object-fit:contain;border-radius:8px;border:1px solid var(--border);background:#fff;flex-shrink:0}
.nota-logo-empty{display:flex;align-items:center;justify-content:center;font-size:9.5px;color:var(--text-faint);text-align:center;padding:2px}
.nota-upload-btn{width:fit-content;cursor:pointer}
.nota-order-list{display:flex;flex-direction:column;gap:6px}
.nota-order-item{display:flex;align-items:center;gap:10px;background:var(--surface2);border:1px solid var(--border);border-radius:9px;padding:9px 12px;font-size:12.5px;cursor:grab}
.nota-order-item.dragging{opacity:.4}
.nota-order-item .drag-handle{color:var(--text-faint);font-size:15px;cursor:grab}

/* toast */
.toast-wrap{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:60;display:flex;flex-direction:column;gap:8px;align-items:center}
.toast{background:var(--surface);border:1px solid var(--border);border-left:3px solid var(--success);color:var(--text);padding:11px 18px;border-radius:10px;font-size:13px;box-shadow:var(--shadow-sm);animation:toastIn .2s ease}
.toast.err{border-left-color:var(--danger)}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

.pill-filter{display:flex;gap:6px;flex-wrap:wrap}
.pill-filter button{padding:7px 13px;border-radius:20px;border:1px solid var(--border);background:var(--surface2);color:var(--text-dim);font-size:12px}
.pill-filter button.active{background:var(--biz,var(--brand));color:#fff;border-color:transparent}

.day-events{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.day-event{border:1px solid var(--border);border-left:3px solid var(--c);border-radius:10px;padding:12px 14px;background:var(--surface2)}
.day-event .top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.day-event b{font-size:13.5px}
.day-event .biz-tag{font-size:10.5px;color:var(--text-faint)}
.day-event .time{font-family:var(--font-mono);font-size:11.5px;color:var(--text-dim)}
.day-event p{font-size:12px;color:var(--text-dim)}
.status-tag{font-size:10px;padding:2px 8px;border-radius:20px;font-weight:600}
.status-tag.upcoming{background:color-mix(in srgb, var(--gold) 20%, transparent);color:var(--gold-ink)}
.status-tag.ongoing{background:color-mix(in srgb, var(--success) 20%, transparent);color:var(--success)}
.status-tag.past{background:var(--surface);color:var(--text-faint);border:1px solid var(--border)}

.footer-note{text-align:center;font-size:11px;color:var(--text-faint);margin-top:26px}

/* ============ EXTRA RESPONSIVE TUNING ============ */
@media(max-width:380px){
  .hub{padding:16px 12px 40px}
  .cal-section{padding:14px;width:calc(100% - 24px)}
  .page-topbar{padding:14px 12px 0}
  .hub-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
  .hub-card{padding:14px}
  .modal{padding:20px}
  .theme-toggle{top:10px;right:10px}
  .install-btn{bottom:12px;right:12px;font-size:12px;padding:10px 14px}
}
@media(orientation:landscape) and (max-height:480px){
  .splash,.gate{min-height:100svh}
  .hub{padding-top:16px}
  .biz-sidebar{padding:14px 10px}
  .bottom-nav{padding:4px 4px calc(4px + env(safe-area-inset-bottom))}
  .bottom-nav button{font-size:8.5px;padding:4px 2px}
  .bottom-nav button .ic{font-size:14px}
}
@media(min-width:641px) and (max-width:1024px){
  .hub-grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
  .kasir-layout{grid-template-columns:1fr}
}
</style>
