/* Schetor — stylesheet tunggal. Struktur & konvensi visual (skala radius,
   shadow, shell berbasis flexbox, kartu statistik dengan chip ikon
   berwarna, badge bertema "tint") mengikuti ElectSub, warna tetap
   punya Schetor sendiri (biru/hijau/emas/koral). */

:root{
  --blue:#608CCF;
  --blue-dark:#4A72A8;
  --blue-darker:#395A87;
  --blue-tint:#E9F0F9;
  --green:#25B076;
  --green-tint:#DFF5EB;
  --gold:#E8C553;
  --gold-tint:#FBF1D9;
  --coral:#DD7C62;
  --coral-tint:#FBEBE6;
  --danger:#E2574C;
  --danger-tint:#FDEEEC;
  --ok:#25B076;

  --page-bg:#F3F5FA;
  --panel:#FFFFFF;
  --panel-2:#F7F8FD;
  --ink:#232B3A;
  --ink-soft:#8A94A6;
  --ink-faint:#AEB4C2;
  --line:#EEF1F6;
  --line-strong:#DDE3EC;

  --radius-s:9px;
  --radius-m:14px;
  --radius-l:22px;
  --shadow-sm:0 1px 3px rgba(45,70,110,.07);
  --shadow-card:0 14px 32px -18px rgba(45,70,110,.20);
  --shadow-md:0 24px 50px -18px rgba(35,55,90,.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --page-bg:#161B24; --panel:#1F2530; --panel-2:#242B38; --ink:#E7EAF0; --ink-soft:#8C93A3;
    --line:#2B3240; --line-strong:#3A4252; color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --page-bg:#161B24; --panel:#1F2530; --panel-2:#242B38; --ink:#E7EAF0; --ink-soft:#8C93A3;
  --line:#2B3240; --line-strong:#3A4252; color-scheme: dark;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:'IBM Plex Sans', sans-serif;
  background:var(--page-bg);
  color:var(--ink);
  font-size:14px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{
  font-family:'Space Grotesk', sans-serif;
  font-weight:600;
  margin:0;
  color:var(--ink);
  letter-spacing:-0.01em;
}
button{font-family:inherit;}
table{font-variant-numeric:tabular-nums;}
a{color:inherit; text-decoration:none;}
::selection{background:var(--gold); color:var(--blue-darker);}

/* ---------- utility ---------- */
.hidden{display:none !important;}
.muted{color:var(--ink-soft);}
.mono{font-family:'IBM Plex Mono', monospace;}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:6px;
  padding:9px 16px;
  border-radius:var(--radius-s);
  border:1.5px solid var(--line-strong);
  background:var(--panel);
  color:var(--ink);
  font-size:13px; font-weight:600;
  cursor:pointer;
  text-decoration:none;
  transition:border-color .12s ease, background .12s ease, transform .1s ease;
}
.btn:hover{border-color:var(--blue); color:var(--blue-darker); text-decoration:none;}
.btn-primary{
  background:var(--blue); border-color:var(--blue); color:#fff;
  box-shadow:0 6px 16px -6px rgba(96,140,207,.6);
}
.btn-primary:hover{background:var(--blue-dark); border-color:var(--blue-dark); color:#fff; transform:translateY(-1px);}
.btn-accent{
  background:var(--green); border-color:var(--green); color:#fff; font-weight:700;
  box-shadow:0 6px 16px -6px rgba(37,176,118,.55);
}
.btn-accent:hover{background:#1E9765; border-color:#1E9765; transform:translateY(-1px);}
.btn-ghost{border-color:transparent; background:transparent;}
.btn-ghost:hover{border-color:var(--line-strong);}
.btn-danger{color:var(--danger); border-color:var(--line-strong);}
.btn-danger:hover{border-color:var(--danger); background:var(--danger-tint);}
.btn-sm{padding:6px 12px; font-size:12px; border-radius:8px;}
.icon-btn{
  width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:var(--radius-s); border:1px solid transparent; background:transparent; cursor:pointer; color:var(--ink-soft);
  text-decoration:none;
}
.icon-btn svg{width:15px;height:15px;}
.icon-btn:hover{background:var(--panel-2); color:var(--danger);}

/* Checkbox & radio - explicit fixed size everywhere by default, so they
   never get stretched by width:100% rules meant for text inputs. This
   is intentionally placed BEFORE .toggle further down: the custom
   toggle-switch's hidden checkbox (.toggle input{width:0;...}) has the
   same CSS specificity as the rule below, so source order decides —
   .toggle input must come later to win and stay hidden. */
input[type=checkbox], input[type=radio]{
  width:16px; height:16px; min-width:16px; flex:0 0 16px; margin:0;
  accent-color:var(--blue); cursor:pointer;
}

/* ---------- LOGIN ---------- */
#login-screen{
  --ink:#232B3A; --ink-soft:#8A94A6; --line:#EEF1F6; --line-strong:#DDE3EC; --page-bg:#F3F5FA;
  color-scheme: light;
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  font-family:'IBM Plex Sans', sans-serif;
  background:radial-gradient(circle at 20% 15%, var(--blue), var(--blue-darker) 65%);
  padding:40px 20px;
}
.login-card-outer{
  width:100%; max-width:460px; background:#fff; border-radius:var(--radius-l); padding:44px 40px 36px;
  box-shadow:var(--shadow-md);
}
.login-logo-row{display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:10px;}
.login-logo-row img{height:52px; width:auto;}
.login-logo-row span{font-family:'Space Grotesk'; font-weight:700; font-size:30px; color:var(--ink); letter-spacing:-0.02em;}
.login-tagline{
  text-align:center; font-size:11.5px; font-weight:600; letter-spacing:.12em; color:var(--ink-soft);
  text-transform:uppercase; margin-bottom:22px;
}
.login-role-row{display:flex; align-items:center; justify-content:center; gap:9px; margin-bottom:28px;}
.login-role-badge{
  background:var(--blue-tint); color:var(--blue-dark); font-weight:700; font-size:12px; padding:5px 12px; border-radius:99px;
}
.login-role-row .role-desc{color:var(--ink-soft); font-size:13px;}

.login-card-outer .field{margin-bottom:18px;}
.login-card-outer .field label{display:block; font-size:13.5px; font-weight:700; margin-bottom:8px; color:var(--ink);}
.login-card-outer .field input{
  width:100%; padding:12px 14px; border:1.5px solid var(--line-strong); border-radius:var(--radius-m);
  font-family:inherit; font-size:14px; background:#fff; color:var(--ink);
  transition:border-color .15s ease, box-shadow .15s ease;
}
.login-card-outer .field input:focus{outline:none; border-color:var(--blue); box-shadow:0 0 0 4px rgba(96,140,207,.16);}
.login-card-outer .field .helper{font-size:12px; color:var(--ink-soft); margin-top:7px; line-height:1.5;}

.login-card-outer .btn-login{
  width:100%; justify-content:center; padding:13px; margin-top:6px; border-radius:99px; font-size:14.5px; font-weight:700;
  background:var(--blue); border-color:var(--blue); box-shadow:0 10px 22px -8px rgba(96,140,207,.6);
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.login-card-outer .btn-login:hover{background:var(--blue-dark); border-color:var(--blue-dark); transform:translateY(-1px);}
.login-card-outer .help-line{text-align:center; font-size:12.5px; color:var(--ink-soft); margin-top:18px;}
.login-card-outer .help-line a{color:var(--blue); font-weight:600; text-decoration:none;}

.login-copyright{
  display:flex; align-items:center; justify-content:center; gap:7px; margin-top:22px; padding-top:18px;
  border-top:1px solid var(--line); font-size:11.5px; color:var(--ink-soft);
}
.login-copyright img{height:14px; width:auto; flex-shrink:0;}
.login-copyright b{color:var(--ink);}

/* ---------- APP SHELL — flexbox (sidebar fixed width + main flexes) ---------- */
#app-shell{display:none; min-height:100vh;}
#app-shell.active{display:flex;}
.main{flex:1; min-width:0; display:flex; flex-direction:column;}

.sidebar{
  width:248px; flex:none; background:var(--panel); color:var(--ink-soft);
  display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow-y:auto;
  border-right:1px solid var(--line); padding:0 14px;
}
.side-brand{display:flex; align-items:center; gap:9px; padding:22px 10px 20px;}
.side-brand img{height:40px; width:auto;}
.side-brand span{font-family:'Space Grotesk'; font-weight:700; font-size:21px; color:var(--ink); letter-spacing:-0.02em;}

.nav-group{margin-bottom:6px;}
.nav-label{font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--ink-faint); font-weight:800; padding:16px 10px 6px;}
.nav-item{
  display:flex; align-items:center; gap:11px; padding:10px 13px; border-radius:var(--radius-m);
  color:var(--ink-soft); font-size:13.5px; font-weight:600; margin-bottom:3px; text-decoration:none;
}
.nav-item svg{width:18px; height:18px; flex-shrink:0; opacity:.75;}
.nav-item:hover{background:var(--panel-2); color:var(--ink);}
.nav-item:hover svg{opacity:1;}
.nav-item.is-active{background:var(--blue); color:#fff; box-shadow:0 8px 18px -8px rgba(96,140,207,.65);}
.nav-item.is-active svg{opacity:1;}
.nav-sub{padding-left:44px;}
.nav-item .chev{margin-left:auto; width:12px; height:12px; transition:transform .15s ease;}
.nav-item.expanded .chev{transform:rotate(90deg);}
.subnav{max-height:0; overflow:hidden; transition:max-height .18s ease;}
.subnav.open{max-height:400px;}

.sidebar-foot{margin-top:auto; padding:14px 0 18px;}
.sidebar-card{
  padding:16px; border-radius:var(--radius-l); color:#fff;
  background:linear-gradient(160deg, var(--blue-darker), #1C2E44 140%);
  box-shadow:0 16px 30px -16px rgba(28,46,68,.55);
}
.sidebar-card .who{font-size:11.5px; color:rgba(255,255,255,.62); line-height:1.5;}
.sidebar-card .who strong{display:block; color:#fff; font-size:14px; font-weight:700; margin-top:3px;}
.sidebar-card .role-chip{display:inline-block; background:rgba(255,255,255,.18); color:#fff; font-size:10.5px; font-weight:700; padding:2px 9px; border-radius:99px; text-transform:uppercase; letter-spacing:.03em;}
.sidebar-card form{margin:12px 0 0;}
.btn-logout{
  width:100%; display:flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 14px; border-radius:99px; border:none;
  background:#fff; color:var(--blue-darker); font-size:12.5px; font-weight:800; cursor:pointer;
  transition:background .12s ease;
}
.btn-logout:hover{background:var(--blue-tint);}
.btn-logout svg{width:15px;height:15px;}

.topbar{
  background:var(--panel); border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 28px; position:sticky; top:0; z-index:5;
}
.crumb{font-size:13px; color:var(--ink-soft); display:flex; align-items:center; gap:6px;}
.crumb b{color:var(--ink); font-weight:600;}
.hamburger-btn{
  display:none; width:36px; height:36px; align-items:center; justify-content:center;
  border-radius:var(--radius-s); border:1px solid var(--line-strong); background:var(--panel); color:var(--ink);
  cursor:pointer; flex-shrink:0; margin-right:12px;
}
.hamburger-btn svg{width:18px;height:18px;}
.topbar-left{display:flex; align-items:center; min-width:0;}
.sidebar-backdrop{
  display:none; position:fixed; top:0; right:0; bottom:0; left:0; background:rgba(20,25,35,.45); z-index:140;
}
.sidebar-backdrop.show{display:block;}

.topbar-search{
  display:flex; align-items:center; gap:9px; background:var(--panel-2); border:1px solid var(--line);
  border-radius:99px; padding:9px 16px; color:var(--ink-faint); font-size:13px; flex:1; max-width:360px;
}
.topbar-search svg{width:15px;height:15px; flex-shrink:0;}
.topbar-search input{
  border:none; background:transparent; outline:none; font-family:inherit; font-size:13px; color:var(--ink);
  width:100%; padding:0;
}
.topbar-search input::placeholder{color:var(--ink-faint);}
.topbar-right{display:flex; align-items:center; gap:16px;}
.notif-wrap{position:relative;}
.notif-dropdown{
  display:none; position:absolute; top:calc(100% + 10px); right:0; width:320px; max-height:400px;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-m); box-shadow:var(--shadow-md);
  z-index:60; overflow:hidden; flex-direction:column;
}
.notif-dropdown.open{display:flex;}
.notif-dropdown-head{
  display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--line);
  font-size:13px; font-weight:700; color:var(--ink);
}
.notif-mark-read{background:none; border:none; color:var(--blue); font-size:11.5px; font-weight:600; cursor:pointer; padding:0;}
.notif-mark-read:hover{text-decoration:underline;}
.notif-dropdown-list{overflow-y:auto; max-height:340px;}
.notif-item{padding:11px 16px; border-bottom:1px solid var(--line);}
.notif-item:last-child{border-bottom:none;}
.notif-item.unread{background:var(--blue-tint);}
.notif-msg{font-size:12.5px; color:var(--ink); line-height:1.4;}
.notif-time{font-size:11px; color:var(--ink-faint); margin-top:3px;}
.notif-empty{padding:24px 16px; text-align:center; font-size:12.5px; color:var(--ink-faint);}
.bell{position:relative; width:38px; height:38px; border-radius:50%; border:1px solid var(--line-strong); background:var(--panel); display:flex; align-items:center; justify-content:center; color:var(--ink-soft); flex-shrink:0; cursor:pointer; padding:0;}
.bell:hover{background:var(--panel-2); color:var(--ink);}
.bell svg{width:17px;height:17px;}
.bell .dot{position:absolute; top:8px; right:9px; width:7px; height:7px; border-radius:50%; background:var(--coral); border:1.5px solid var(--panel);}
.greet{text-align:right; line-height:1.3;}
.greet .hi{font-size:13.5px; font-weight:700; color:var(--ink);}
.greet .sub{font-size:11.5px; color:var(--ink-faint);}
.avatar{
  width:38px; height:38px; border-radius:50%; background:var(--blue); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px; flex-shrink:0;
  box-shadow:0 6px 14px -6px rgba(96,140,207,.7);
}

main.content{flex:1; overflow-y:auto; padding:28px 32px 60px;}
.view{display:none;}
.view.active{display:block;}

.page-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px;}
.page-head h1{font-size:20px; margin-bottom:4px;}
.page-head .desc{font-size:13px; color:var(--ink-soft); max-width:640px;}
.page-head .actions{display:flex; gap:10px; flex-shrink:0;}

.panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-l); margin-bottom:20px; box-shadow:var(--shadow-card);}
.panel-head{padding:18px 22px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between;}
.panel-head h3{font-size:15px;}
.panel-head .hint{font-size:12px; color:var(--ink-faint);}
.panel-body{padding:22px;}

/* ---------- stat tiles: white card + colored icon chip (not full-gradient) ---------- */
.stat-row{display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:22px;}
.stat-card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-m);
  padding:17px 18px; box-shadow:var(--shadow-sm); position:relative;
}
.stat-card .icon-badge{
  width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  margin-bottom:14px;
}
.stat-card .icon-badge svg{width:20px;height:20px;}
.stat-card .n{font-size:26px; font-weight:800; font-family:'Space Grotesk'; letter-spacing:-0.01em; color:var(--ink);}
.stat-card .l{font-size:12px; color:var(--ink-faint); font-weight:600; margin-top:2px;}
.stat-card.c-green .icon-badge{background:var(--green-tint); color:var(--green);}
.stat-card.c-blue .icon-badge{background:var(--blue-tint); color:var(--blue-dark);}
.stat-card.c-gold .icon-badge{background:var(--gold-tint); color:#9A7712;}
.stat-card.c-coral .icon-badge{background:var(--coral-tint); color:#B25A41;}

.tabs{display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:18px;}
.tab{padding:9px 16px; font-size:13px; font-weight:500; color:var(--ink-soft); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; text-decoration:none;}
.tab:hover{color:var(--ink);}
.tab.active{color:var(--blue-darker); border-bottom-color:var(--blue); font-weight:600;}

table.grid-table{width:100%; border-collapse:collapse; font-size:13px;}
table.grid-table.compact{width:auto; max-width:640px;}
table.grid-table th{
  text-align:left; padding:11px 14px; background:var(--panel-2); color:var(--ink-soft);
  font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid var(--line-strong);
}
.sort-link{display:block; margin:-11px -14px; padding:11px 14px; color:inherit; text-decoration:none; cursor:pointer; user-select:none;}
.sort-link:hover{color:var(--ink);}
.sort-arrow{margin-left:4px; font-size:9px; display:inline-block;}
table.grid-table th.checkbox-col, table.grid-table td.checkbox-col{width:34px; padding-right:0;}
.bulk-bar{
  display:none; align-items:center; gap:14px; padding:11px 22px; background:var(--blue-tint);
  border-bottom:1px solid var(--line);
}
.bulk-bar.show{display:flex;}
.bulk-bar .count{font-size:13px; font-weight:700; color:var(--blue-darker);}
table.grid-table td{padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:top;}
table.grid-table tr:last-child td{border-bottom:none;}
table.grid-table tbody tr:hover{background:var(--panel-2);}
.row-actions{text-align:right; white-space:nowrap;}
.row-actions > *{margin-left:4px;}
.row-actions > *:first-child{margin-left:0;}

.swatch{width:14px;height:14px;border-radius:4px; display:inline-block; vertical-align:-2px; margin-right:7px; border:1px solid rgba(0,0,0,.08);}
.badge{display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:99px; font-size:11px; font-weight:700;}
.badge.wajib{background:var(--blue-tint); color:var(--blue-darker);}
.badge.pilihan{background:var(--gold-tint); color:#9A7712;}
.badge.moving{background:var(--coral-tint); color:#B25A41;}

/* schedule grid emulation */
.sched-wrap{overflow-x:auto;}
table.sched{border-collapse:collapse; font-size:11.5px; min-width:900px;}
table.sched th, table.sched td{border:1px solid var(--line-strong); padding:5px 7px; text-align:center;}
table.sched thead th{background:var(--blue); color:#fff; font-weight:600; font-size:11px;}
table.sched td.jam-col{background:var(--panel-2); font-weight:600; width:34px;}
table.sched td.time-col{background:var(--panel-2); color:var(--ink-soft); width:76px; font-size:10.5px;}
table.sched td.break{background:var(--gold-tint); font-weight:600; color:#9A7712;}
table.sched td.subj{font-weight:500;}
table.sched td.code{font-family:'IBM Plex Mono'; font-weight:600; color:var(--blue-darker);}

.rule-item{display:flex; align-items:flex-start; gap:12px; padding:14px 20px; border-bottom:1px solid var(--line);}
.rule-item:last-child{border-bottom:none;}
.rule-item .num{font-family:'Space Grotesk'; font-weight:700; color:var(--coral); font-size:13px; width:20px; flex-shrink:0; padding-top:1px;}
.rule-item .txt{flex:1; font-size:13.5px;}
.rule-item .txt .rule-input{
  display:inline-block; width:52px; padding:3px 6px; border:1px solid var(--line-strong); border-radius:6px; font-family:'IBM Plex Mono'; font-size:12.5px; text-align:center; margin:0 3px;
}
.toggle{position:relative; display:inline-block; width:36px; height:20px; flex-shrink:0; vertical-align:middle;}
.toggle input{opacity:0; width:0; height:0;}
.toggle .slider{position:absolute; top:0; right:0; bottom:0; left:0; background:var(--line-strong); border-radius:20px; cursor:pointer; transition:.15s;}
.toggle .slider:before{content:""; position:absolute; width:14px; height:14px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.15s;}
.toggle input:checked + .slider{background:var(--ok);}
.toggle input:checked + .slider:before{transform:translateX(16px);}

/* time-off grid */
.timeoff-grid{border-collapse:collapse; width:100%;}
.timeoff-grid th, .timeoff-grid td{border:1px solid var(--line); text-align:center; padding:8px; font-size:13px;}
.timeoff-grid th{background:var(--panel-2); font-weight:600; font-size:12px;}
.timeoff-grid td.daylabel{background:var(--panel-2); font-weight:600; text-align:left; padding-left:14px;}
.cell-state{width:26px; height:26px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:14px; user-select:none;}
.cell-avail{background:var(--green-tint); color:var(--ok);}
.cell-unavail{background:var(--danger-tint); color:var(--danger);}
.cell-cond{background:var(--gold-tint); color:#9A7712;}

/* modal */
.modal-overlay{
  position:fixed; top:0; right:0; bottom:0; left:0; background:rgba(35,43,58,.5); display:none; align-items:center; justify-content:center; z-index:100; padding:20px;
}
.modal-overlay.active{display:flex;}
.modal{background:#fff; border-radius:var(--radius-l); width:560px; max-width:100%; max-height:88vh; display:flex; flex-direction:column; box-shadow:var(--shadow-md);}
.modal.wide{width:680px;}
.modal-head{padding:18px 22px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between;}
.modal-head h3{font-size:16px;}
.modal-body{padding:22px; overflow-y:auto;}
.modal-foot{padding:16px 22px; border-top:1px solid var(--line); display:flex; justify-content:flex-end; gap:10px;}
.field-row{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
.field-row-3{grid-template-columns:1fr 1fr 1fr;}
.field label{display:block; font-size:12.5px; font-weight:600; margin-bottom:7px; color:var(--ink);}
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea{
  width:100%; padding:9px 12px; border:1.5px solid var(--line-strong); border-radius:var(--radius-s);
  font-family:inherit; font-size:13.5px; background:#fff; color:var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus{outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(96,140,207,.15);}
.field{margin-bottom:16px;}

/* Grid of checkboxes (e.g. "pilih Kelas Anggota") - columns auto-adjust
   to available width so labels never get squeezed on narrow screens. */
.checkbox-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(110px,1fr)); gap:10px 14px;
  border:1px solid var(--line); border-radius:var(--radius-s); padding:14px;
}
.checkbox-grid label{
  display:flex !important; align-items:center; gap:8px; font-size:13px !important; font-weight:500 !important;
  color:var(--ink); margin:0 !important; cursor:pointer; white-space:nowrap;
}

.empty-state{text-align:center; padding:40px 20px; color:var(--ink-faint); border:1px dashed var(--line-strong); border-radius:var(--radius-m);}
.empty-state strong{display:block; color:var(--ink); font-size:14.5px; margin-bottom:4px;}
.empty-state svg{width:40px;height:40px; margin-bottom:12px; opacity:.5;}

.legend{display:flex; gap:18px; align-items:center; margin-top:12px; font-size:12px; color:var(--ink-soft);}
.legend .k{display:inline-flex; align-items:center; gap:6px;}

.import-box{border:1.5px dashed var(--line-strong); border-radius:var(--radius-s); padding:22px; text-align:center; color:var(--ink-soft); font-size:13px; margin-bottom:16px;}
.import-box a{color:var(--blue); font-weight:600; text-decoration:underline;}

.toast{
  position:fixed; bottom:24px; right:24px; background:var(--blue-darker); color:#fff; padding:12px 18px; border-radius:var(--radius-m);
  font-size:13px; display:flex; align-items:center; gap:10px; z-index:200; box-shadow:var(--shadow-md);
  opacity:0; transform:translateY(8px); transition:.2s ease; pointer-events:none;
}
.toast.show{opacity:1; transform:translateY(0);}
.toast .dot{width:7px;height:7px;border-radius:50%; background:var(--gold);}

/* =====================================================================
   RESPONSIVE — tablet & phone
   Breakpoints: <=1024px (tablet, sidebar becomes an off-canvas drawer),
   <=640px (phone, tighter spacing + single-column layouts).
   The shell is flexbox now, so unlike a CSS-Grid shell there is no
   column/area template to switch — only the sidebar's own position
   changes for the off-canvas drawer.
   ===================================================================== */

/* Let wide tables/grids scroll horizontally on their own instead of
   forcing the whole page to scroll sideways. */
.panel-body{overflow-x:auto;}

@media (max-width: 1024px){
  .hamburger-btn{display:inline-flex;}
  .sidebar{
    position:fixed; top:0; left:0; bottom:0; width:264px; z-index:150;
    transform:translateX(-100%); transition:transform .2s ease; box-shadow:var(--shadow-md);
  }
  .sidebar.open{transform:translateX(0);}
  .topbar{padding:12px 16px;}
  .topbar-search{display:none;}
  main.content{padding:18px 16px 50px;}
}

@media (max-width: 900px){
  .stat-row{grid-template-columns:repeat(2,1fr);}
}

@media (max-width: 640px){
  .topbar-right{gap:10px;}
  .topbar-right .greet{display:none;}
  .page-head{flex-wrap:wrap; gap:12px;}
  .page-head .actions{width:100%;}
  .page-head .actions .btn{flex:1;}
  .stat-row{grid-template-columns:1fr; gap:12px;}
  .field-row{grid-template-columns:1fr;}
  .checkbox-grid{grid-template-columns:repeat(auto-fill, minmax(90px,1fr));}
  .modal{border-radius:16px;}
  .modal-head, .modal-foot{padding:14px 16px;}
  .modal-body{padding:16px;}
  .tabs{overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap;}
  .tab{flex-shrink:0;}
  .rule-item{flex-wrap:wrap; padding:12px 16px;}
  .rule-item .txt{flex-basis:100%; order:1;}
  .rule-item .num{order:0;}
  .panel-head{flex-wrap:wrap; gap:8px;}
  main.content{padding:14px 12px 40px;}
  .login-card-outer{padding:32px 22px 26px;}
  #login-screen{padding:20px 14px;}
}
