/* ==========================================================================
   School Payroll — Apple-style design system
   Modelled on Apple's Human Interface Guidelines + apple.com design language:
   SF Pro system type, iOS system colours, grouped inset lists with hairline
   separators, translucent materials, spring motion. Light + dark.
   ========================================================================== */

/* ---------- 1 - Design tokens ---------- */
:root{
  color-scheme:light dark;
  /* iOS system colours */
  --blue:#0071e3;   --blue-hi:#0077ed;  --blue-press:#0069d9;
  --green:#34c759;  --green-txt:#1d8a3c;
  --red:#ff3b30;    --red-txt:#d70015;
  --orange:#ff9500; --orange-txt:#c93400;
  --purple:#af52de; --purple-txt:#8944ab;
  --teal:#30b0c7;   --teal-txt:#0f7c8f;
  --pink:#ff2d55;   --pink-txt:#c8204a;
  --indigo:#5856d6; --indigo-txt:#4645b5;
  --gray:#8e8e93;   --gray-txt:#5f6368;
  /* labels */
  --label:#1d1d1f; --label-2:#6e6e73; --label-3:#86868b; --label-4:#a1a1a6;
  /* surfaces */
  --bg:#f5f5f7;   --card:#ffffff;  --card-2:#fbfbfd;  --elev:#ffffff;
  --material:rgba(255,255,255,.76);
  --fill:rgba(120,120,128,.12); --fill-2:rgba(120,120,128,.07);
  --separator:rgba(60,60,67,.13); --hairline:#d2d2d7;
  --overlay:rgba(0,0,0,.42); --toast-bg:rgba(28,28,30,.86);
  /* translucent tints — read correctly in both schemes */
  --tint-blue:rgba(0,113,227,.11);    --tint-green:rgba(52,199,89,.15);
  --tint-red:rgba(255,59,48,.13);     --tint-orange:rgba(255,149,0,.16);
  --tint-purple:rgba(175,82,222,.14); --tint-teal:rgba(48,176,199,.15);
  --tint-gray:rgba(120,120,128,.13);
  /* aliases — app.js writes inline styles with these names */
  --accent:var(--blue);       --accent-soft:var(--tint-blue);
  --muted:var(--label-2);     --text:var(--label);
  --border:var(--separator);  --danger:var(--red-txt);
  --success:var(--green-txt); --warning:var(--orange-txt);
  /* shape */
  --r-xs:6px; --r-sm:10px; --r:13px; --r-lg:17px; --r-xl:22px; --r-pill:980px;
  /* elevation */
  --shadow-1:0 1px 1px rgba(0,0,0,.03), 0 1px 3px rgba(0,0,0,.05);
  --shadow-2:0 1px 2px rgba(0,0,0,.04), 0 12px 30px -16px rgba(10,20,40,.28);
  --shadow-pop:0 20px 55px -14px rgba(0,0,0,.34), 0 2px 8px rgba(0,0,0,.10);
  --ring:0 0 0 3.5px rgba(0,113,227,.16);
  /* motion — Apple's spring-ish curve */
  --spring:cubic-bezier(.32,.72,0,1);
  --ease:cubic-bezier(.4,0,.2,1);
  --t-fast:.16s; --t:.28s; --t-slow:.44s;
  /* type */
  --font:-apple-system,BlinkMacSystemFont,'SF Pro Text','SF Pro Display',
         'Helvetica Neue','Inter',system-ui,sans-serif;
  /* sidebar shell — #sb-w is redefined by #app.rail (collapsed) on desktop */
  --sb-w:246px;
  --sidebar-rail:68px;
}
@media (prefers-color-scheme:dark){
  :root{
    --blue:#0a84ff;   --blue-hi:#2492ff;  --blue-press:#0a7ae8;
    --green:#30d158;  --green-txt:#4cd964;
    --red:#ff453a;    --red-txt:#ff6961;
    --orange:#ff9f0a; --orange-txt:#ffb340;
    --purple:#bf5af2; --purple-txt:#cf7ef7;
    --teal:#40c8e0;   --teal-txt:#7de0f0;
    --pink:#ff375f;   --pink-txt:#ff7a93;
    --indigo:#5e5ce6; --indigo-txt:#9b99f2;
    --gray:#98989d;   --gray-txt:#a1a1a6;
    --label:#f5f5f7; --label-2:#a1a1a6; --label-3:#8e8e93; --label-4:#6e6e73;
    --bg:#000000;  --card:#1c1c1e;  --card-2:#232325;  --elev:#2c2c2e;
    --material:rgba(28,28,30,.78);
    --fill:rgba(120,120,128,.26); --fill-2:rgba(120,120,128,.15);
    --separator:rgba(84,84,88,.6); --hairline:#38383a;
    --overlay:rgba(0,0,0,.62); --toast-bg:rgba(58,58,60,.92);
    --tint-blue:rgba(10,132,255,.22);   --tint-green:rgba(48,209,88,.20);
    --tint-red:rgba(255,69,58,.20);     --tint-orange:rgba(255,159,10,.20);
    --tint-purple:rgba(191,90,242,.22); --tint-teal:rgba(64,200,224,.20);
    --tint-gray:rgba(120,120,128,.26);
    --shadow-1:0 1px 1px rgba(0,0,0,.4);
    --shadow-2:0 1px 2px rgba(0,0,0,.6);
    --shadow-pop:0 24px 60px -12px rgba(0,0,0,.75);
    --ring:0 0 0 3.5px rgba(10,132,255,.30);
  }
}
/* ---------- 2 - Base ---------- */
*,*::before,*::after{box-sizing:border-box;}
html,body{margin:0;padding:0;}
html{-webkit-text-size-adjust:100%;}
body{
  font-family:var(--font);
  background:var(--bg); color:var(--label);
  font-size:16px; line-height:1.47; letter-spacing:-.011em;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  -webkit-tap-highlight-color:transparent; overscroll-behavior-y:none;
}
.hidden{display:none !important;}
button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit;}
button{cursor:pointer;touch-action:manipulation;}
h1,h2,h3,h4{margin:0;font-weight:600;letter-spacing:-.022em;}
a{color:var(--blue);text-decoration:none;}
::-webkit-scrollbar{width:9px;height:9px;}
::-webkit-scrollbar-thumb{background:rgba(120,120,128,.32);border-radius:5px;}
::-webkit-scrollbar-track{background:transparent;}
::selection{background:rgba(0,113,227,.18);}
.ico{width:1.1em;height:1.1em;display:inline-block;vertical-align:-.18em;
  fill:none;overflow:visible;}
/* ---------- 3 - App shell + large-title header ---------- */
.app{
  max-width:780px; margin:0 auto;
  padding-bottom:calc(34px + env(safe-area-inset-bottom));
}
.topbar{
  position:sticky; top:0; z-index:30;
  min-height:calc(56px + env(safe-area-inset-top));
  padding:calc(env(safe-area-inset-top) + 8px) 20px 8px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--material);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid transparent;
  transition:border-color var(--t) var(--ease);
}
/* The hairline only appears once the content scrolls under the bar, exactly
   like the iOS navigation bar. */
.topbar.scrolled{border-bottom-color:var(--separator);}
.topbar-title{
  font-size:29px; font-weight:700; letter-spacing:-.028em; line-height:1.15;
  transform-origin:left center;
  transition:transform var(--t) var(--spring);
  will-change:transform;
  /* The labelled menu button uses the topbar's spare width, so a long view name
     must ellipsis rather than run underneath the account chip. */
  min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* Scales the large title down instead of reflowing it — the iOS collapse
   animation, with no layout jitter. */
.topbar.scrolled .topbar-title{transform:scale(.62);}
/* ---------- 4 - App sidebar (replaces the bottom tab bar) ---------- */
.sidebar{
  position:fixed; top:0; left:0; bottom:0; z-index:60;
  width:var(--sb-w);
  display:flex; flex-direction:column;
  padding:calc(env(safe-area-inset-top) + 12px) 12px
          calc(12px + env(safe-area-inset-bottom));
  background:var(--material);
  -webkit-backdrop-filter:saturate(180%) blur(22px);
  backdrop-filter:saturate(180%) blur(22px);
  border-right:1px solid var(--separator);
  transition:width var(--t) var(--spring), transform var(--t) var(--spring);
}
.sb-head{display:flex; align-items:center; gap:6px; min-height:40px; padding:0 4px 6px;}
.sb-brand{display:flex; align-items:center; gap:9px; min-width:0; flex:1 1 auto;}
.sb-logo{
  flex:0 0 auto; display:flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:9px;
  background:var(--tint-blue); color:var(--blue);
}
.sb-logo .ico{width:16px; height:16px; vertical-align:0;}
.sb-brand-txt{
  font-size:14.5px; font-weight:700; letter-spacing:-.022em; color:var(--label);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sb-toggle{
  flex:0 0 auto; display:flex; align-items:center; justify-content:center;
  width:30px; height:30px; border:0; border-radius:8px;
  background:none; color:var(--label-3);
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sb-toggle:hover{background:var(--fill); color:var(--label);}
.sb-toggle .ico{width:16px; height:16px; vertical-align:0;}
.sb-nav{flex:1 1 auto; overflow-y:auto; overscroll-behavior:contain; padding:2px 0;}
.sb-group-t{
  font-size:10.5px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
  color:var(--label-4); padding:14px 10px 5px;
}
/* Real buttons: iOS-sized tap targets, keyboard reachable. */
.sb-item{
  display:flex; align-items:center; gap:11px; width:100%;
  padding:9px 10px; margin-bottom:1px;
  border:0; border-radius:var(--r-sm); background:none;
  color:var(--label); font-size:14.5px; font-weight:500; letter-spacing:-.012em;
  text-align:left; white-space:nowrap;
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
             transform var(--t-fast) var(--ease);
}
.sb-item .sb-ico{flex:0 0 auto; display:block; height:20px;}
.sb-item .sb-ico .ico{width:20px; height:20px; vertical-align:0; color:var(--label-2);}
.sb-item .sb-txt{overflow:hidden; text-overflow:ellipsis;}
/* A pending count on a sidebar item: the manager must see that a leave request is
   waiting WITHOUT opening the tab. Collapses to a corner dot in the 68px rail. */
.sb-item{position:relative;}
.sb-badge{
  flex:0 0 auto; margin-left:auto; min-width:20px;
  padding:2px 6px; border-radius:var(--r-pill);
  background:var(--red); color:#fff;
  font-size:11.5px; font-weight:700; line-height:1.35; text-align:center;
}
.sb-item:hover{background:var(--fill-2);}
.sb-item:active{transform:scale(.98);}
.sb-item.active{background:var(--tint-blue); color:var(--blue); font-weight:600;}
.sb-item.active .sb-ico .ico{color:var(--blue);}
.sb-item.danger, .sb-item.danger .sb-ico .ico{color:var(--danger);}
.sb-foot{border-top:1px solid var(--separator); padding-top:8px; margin-top:6px;}
.sb-user{padding:2px 10px 8px; font-size:11.5px; line-height:1.45; color:var(--label-3);}
.sb-user b{display:block; font-size:13px; font-weight:600; color:var(--label-2);}
.scrim{
  position:fixed; inset:0; z-index:55; background:var(--overlay);
  opacity:0; pointer-events:none;
  transition:opacity var(--t) var(--ease);
}
body.drawer .scrim{opacity:1; pointer-events:auto;}
/* The drawer opener is a LABELLED button, not a bare glyph: an unlabelled
   hamburger floating in a topbar reads as decoration, so staff never find the
   menu. The tint also makes it read as tappable. */
.menu-btn{
  display:none; align-items:center; gap:5px;
  flex:0 0 auto; height:34px; padding:0 12px 0 9px; margin-left:-9px;
  border:0; border-radius:10px;
  background:var(--tint-blue); color:var(--blue);
  font-size:14px; font-weight:600; letter-spacing:-.01em;
  transition:background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.menu-btn .ico{width:19px; height:19px; vertical-align:0;}
.menu-btn-t{line-height:1;}
.menu-btn:active{transform:scale(.95);}
/* Under 360px the title and the account chip need the width back. */
@media (max-width:359px){ .menu-btn-t{display:none;} .menu-btn{padding:0 9px;} }
.topbar-lead{display:flex; align-items:center; gap:6px; min-width:0;}

/* ---------- 4b - Sidebar layout per viewport ---------- */
/* Phone / tablet: off-canvas drawer over the content. */
.main-col{margin-left:0;}
.menu-btn{display:flex;}
.sidebar{width:min(292px, 86vw); transform:translateX(-102%); box-shadow:var(--shadow-pop);}
body.drawer .sidebar{transform:none;}
body.drawer{overflow:hidden;}
/* Desktop: the sidebar sits beside the content and can collapse to a rail.
   The rail rules live INSIDE this block on purpose — a rail class left over in
   localStorage from a desktop session must never hide the drawer's labels. */
@media (min-width:1000px){
  .scrim{display:none;}
  .menu-btn{display:none;}
  .sb-toggle{display:flex;}
  .sidebar{width:var(--sb-w); transform:none; box-shadow:none;}
  /* A centred 780px column would leave a dead gap beside the sidebar; let the
     main column fill the remaining width and centre the CONTENT inside it. */
  .app{max-width:none; margin:0;}
  .main-col{margin-left:var(--sb-w); transition:margin-left var(--t) var(--spring);}
  .main-col .topbar{padding-inline:max(24px, calc((100% - 860px) / 2));}
  .main-col .view{max-width:860px; margin-inline:auto;}
  #app.rail{--sb-w:var(--sidebar-rail);}
  /* Railed, this chevron is the only way to reopen the menu: tint it
     like the phone's opener so it reads as a button, not a stray mark. */
  #app.rail .sb-toggle{background:var(--tint-blue); color:var(--blue);}
  #app.rail .sb-brand-txt, #app.rail .sb-group-t, #app.rail .sb-txt{display:none;}
  #app.rail .sb-item{justify-content:center; padding-inline:0; gap:0;}
  /* Railed there is no text column and the item is only ~43px wide. Pinned blindly to the
     item's corner the badge lands ON the 20px icon and hides its middle (measured: badge
     x 28-43 against an icon at x 24-44). Park it on the icon's top-right corner, inside the
     68px rail, so it grazes the glyph instead of covering it. */
  #app.rail .sb-badge{position:absolute; top:1px; right:-2px; margin:0;
    min-width:16px; padding:1px 4px; font-size:10px;}
  /* A 68px rail cannot hold the logo and the expand button side by side — they
     overlapped into the same tile. Stack them instead. */
  #app.rail .sb-head{flex-direction:column; justify-content:center; gap:8px;
    min-height:0; padding:0 0 10px;}
  #app.rail .sb-brand{flex:0 0 auto; justify-content:center;}
  #app.rail .sb-user{display:none;}
}
@media (max-width:999px){
  .sb-toggle{display:none;}
}
/* ---------- 5 - View transitions, loading, empty states ---------- */
.view{padding:20px 20px 26px;}
.view.enter{animation:viewIn var(--t-slow) var(--spring);}
@keyframes viewIn{
  from{opacity:0; transform:translateY(10px) scale(.996);}
  to{opacity:1; transform:none;}
}
/* Skeleton placeholders: the tab paints instantly instead of flashing
   "Memuat…", so navigation feels immediate. */
.skel{padding-top:6px;}
.skel-row{
  position:relative; overflow:hidden;
  height:62px; border-radius:var(--r-lg);
  background:var(--fill-2); margin-bottom:10px;
}
.skel-row.tall{height:96px;}
.skel-row.half{height:46px;width:58%;}
.skel-row::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.5),transparent);
  animation:shimmer 1.5s var(--ease) infinite;
}
@keyframes shimmer{from{transform:translateX(-100%);} to{transform:translateX(100%);}}
.empty{
  text-align:center; color:var(--label-2); padding:44px 20px 40px;
  font-size:15px; line-height:1.45;
}
.empty .empty-ico{
  display:flex; align-items:center; justify-content:center;
  width:64px; height:64px; margin:0 auto 12px;
  border-radius:50%; background:var(--fill-2); color:var(--label-3);
}
.empty .empty-ico .ico{width:30px; height:30px; vertical-align:0;}
/* A compact empty state for a card inside an otherwise full page: same icon and
   message, without the full-height placeholder's padding pushing the next
   section off screen (measured: 44px top + 40px bottom of pure air). */
.empty.sm{
  display:flex; flex-direction:column; align-items:center; gap:12px;
  padding:22px 8px 24px;
}
.empty.sm .empty-ico{width:44px; height:44px; margin:0;}
.empty.sm .empty-ico .ico{width:22px; height:22px;}
.empty-txt{font-size:14.5px; color:var(--label-2); letter-spacing:-.01em;}
/* ---------- 6 - Grouped inset lists (the core Apple surface) ---------- */
.card{
  background:var(--card); border-radius:var(--r-lg);
  box-shadow:var(--shadow-1);
  padding:2px 16px; margin-bottom:18px;
}
.card h3{
  margin:0; padding:13px 0 9px;
  font-size:13px; font-weight:600; color:var(--label-2);
  text-transform:uppercase; letter-spacing:.04em;
}
.list-item{
  position:relative; display:flex; align-items:center; gap:14px;
  min-height:56px; padding:12px 0;
  transition:background var(--t-fast) var(--ease);
}
.list-item::after{
  content:''; position:absolute; left:0; right:0; bottom:0;
  height:1px; background:var(--separator);
}
.list-item:last-child::after{display:none;}
.list-item.tap:active{background:var(--fill-2);}
.list-item .avatar{
  width:44px; height:44px; border-radius:50%; flex-shrink:0;
  background:var(--tint-blue); color:var(--blue);
  display:flex; align-items:center; justify-content:center;
  font-weight:600; font-size:16px; letter-spacing:-.02em;
}
.list-item .li-main{flex:1; min-width:0;}
.list-item .li-title{
  font-size:17px; font-weight:500; letter-spacing:-.022em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.list-item .li-sub{
  font-size:13.5px; color:var(--label-2); margin-top:1px; letter-spacing:-.005em;
}
.list-item .li-actions{display:flex; gap:6px; flex-shrink:0;}
/* A row's leading icon is a tinted circle, not a button: the whole row is the tap
   target, so the icon only has to carry the meaning. */
.row-ico{
  flex:0 0 auto; display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:50%;
  background:var(--fill-2); color:var(--label-2);
}
.row-ico .ico{width:18px; height:18px; vertical-align:0;}
.row-ico.low{background:var(--tint-orange); color:var(--orange-txt);}
.row-ico.out{background:var(--tint-red); color:var(--red-txt);}
/* A row that navigates says so with a chevron, not with a button. */
.list-item .li-chev{flex:0 0 auto; display:flex; color:var(--label-4);}
.list-item .li-chev .ico{width:15px; height:15px; vertical-align:0;}
/* The last row of a group may be a link instead of a control ("Lihat semua"). */
.card-link{
  display:flex; align-items:center; justify-content:center; gap:5px;
  width:100%; padding:13px 0; border:0; background:none;
  color:var(--blue); font-size:15px; font-weight:600; letter-spacing:-.015em;
  transition:opacity var(--t-fast) var(--ease);
}
.card-link .ico{width:14px; height:14px; vertical-align:0;}
.card-link:active{opacity:.5;}
/* A leave row carries a title, a range, a reason AND the affected sessions: let it
   wrap, or the teacher's name gets ellipsed away by the one-line title rule. */
.list-item.leave-item{align-items:flex-start;}
.list-item.leave-item .li-title{white-space:normal; overflow:visible; text-overflow:clip;}
/* The sessions that hang on this request — each row opens the session sheet,
   which is where a substitute is actually assigned. */
.imp-wrap{margin-top:8px; border-top:1px dashed var(--separator); padding-top:8px;}
.imp-head{font-size:11.5px; font-weight:600; color:var(--label-3); margin-bottom:6px;}
.imp-row{
  display:flex; align-items:center; gap:8px; width:100%;
  padding:6px 8px; margin-bottom:4px;
  border:1px solid var(--separator); border-radius:var(--r-sm);
  background:none; color:var(--label); font:inherit; font-size:12.5px;
  text-align:left; cursor:pointer;
  transition:background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.imp-row:hover{background:var(--fill-2);}
.imp-row:active{transform:scale(.985);}
.imp-date{flex:0 0 auto; font-weight:600; color:var(--blue);}
.imp-cls{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; color:var(--label-2);}
.imp-go{flex:0 0 auto;}
.imp-go .ico{width:14px; height:14px; vertical-align:0; color:var(--label-3);}
.imp-none{margin-top:6px; font-size:11.5px; color:var(--label-3);}
/* ---------- 7 - Home summary + section heads ---------- */
/* Home's figures live in ONE grouped widget instead of four floating tiles: the
   month's money on top, then the counts in a hairline-separated row. A grid of
   stretched cells gives every cell the same height by construction, so no label
   wrapping can push one value off its neighbours' baseline - which is exactly
   what four independent cards did the moment a label needed two lines. */
.summary{
  background:var(--card); border-radius:var(--r-xl);
  box-shadow:var(--shadow-1); margin-bottom:18px; overflow:hidden;
}
.sum-hero{padding:18px 20px 16px;}
.sum-cap{
  font-size:12px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
  color:var(--label-3);
}
.sum-money{
  margin-top:4px; font-size:34px; font-weight:700; letter-spacing:-.034em;
  line-height:1.1; font-variant-numeric:tabular-nums;
}
.sum-sub{margin-top:5px; font-size:13px; color:var(--label-2); letter-spacing:-.005em;}
.sum-grid{
  display:grid; grid-template-columns:repeat(3,1fr);
  border-top:1px solid var(--separator);
}
.sum-cell{
  position:relative; display:flex; flex-direction:column; gap:1px;
  padding:12px 14px 14px; border:0; background:none;
  color:var(--label); font:inherit; text-align:left;
  transition:background var(--t-fast) var(--ease);
}
button.sum-cell{cursor:pointer;}
button.sum-cell:active{background:var(--fill-2);}
.sum-cell::after{
  content:''; position:absolute; right:0; top:11px; bottom:11px;
  width:1px; background:var(--separator);
}
.sum-cell:last-child::after{display:none;}
.sum-n{
  font-size:22px; font-weight:600; letter-spacing:-.028em; line-height:1.2;
  font-variant-numeric:tabular-nums;
}
.sum-l{font-size:12.5px; color:var(--label-2); letter-spacing:-.005em;}
.section-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:26px 2px 10px;
}
.section-head h2{font-size:20px; font-weight:600; letter-spacing:-.024em;}
.section-actions{display:flex; gap:8px; flex-wrap:wrap;}
.section-actions .btn{padding:8px 14px; font-size:14px;}
/* ---------- 8 - Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  border:0; border-radius:var(--r); padding:10px 16px;
  font-size:15px; font-weight:600; letter-spacing:-.012em;
  background:var(--fill); color:var(--label);
  -webkit-user-select:none; user-select:none;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
             opacity var(--t-fast) var(--ease);
}
.btn .ico{width:16px; height:16px;}
.btn:active{transform:scale(.97);}
.btn:disabled{opacity:.42; cursor:not-allowed; transform:none;}
.btn-primary{background:var(--blue); color:#fff; box-shadow:0 1px 2px rgba(0,113,227,.26);}
.btn-primary:hover{background:var(--blue-hi);}
.btn-ghost{background:transparent; color:var(--blue);}
.btn-ghost:hover{background:var(--tint-blue);}
/* Inline row action (level / catalog / fee rows) */
.btn-sm{padding:7px 13px; font-size:13.5px; font-weight:600; border-radius:var(--r-pill); min-height:0; line-height:1.2;}
.btn-danger{background:transparent; color:var(--red-txt);}
.btn-danger:hover{background:var(--tint-red);}
.btn-danger-solid{background:var(--red); color:#fff;}
.btn-block{width:100%; height:50px; font-size:17px; border-radius:14px;}
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; padding:0; border:0; border-radius:50%;
  background:transparent; color:var(--blue);
  transition:background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover{background:var(--tint-blue);}
.icon-btn:active{transform:scale(.92);}
.icon-btn .ico{width:19px; height:19px; vertical-align:0;}
/* ---------- 9 - Badges, chips, status ---------- */
.badge{
  display:inline-block; padding:3px 9px; border-radius:var(--r-pill);
  font-size:12px; font-weight:600; letter-spacing:-.005em;
  background:var(--tint-gray); color:var(--gray-txt);
}
.badge.private {background:var(--tint-pink, rgba(255,45,85,.12)); color:var(--pink-txt);}
.badge.group   {background:var(--tint-green); color:var(--green-txt);}
.badge.semi    {background:var(--tint-orange); color:var(--orange-txt);}
.badge.flat    {background:var(--tint-gray); color:var(--gray-txt);}
.badge.inactive{background:var(--tint-gray); color:var(--label-3);}
.badge.manager {background:var(--tint-blue); color:var(--blue);}
.badge.admin   {background:var(--tint-teal); color:var(--teal-txt);}
.badge.teacher {background:var(--tint-orange); color:var(--orange-txt);}
.badge.senior  {background:var(--tint-indigo, rgba(88,86,214,.13)); color:var(--indigo-txt);}
.badge.junior  {background:var(--tint-gray); color:var(--gray-txt);}
.badge.low     {background:var(--tint-orange); color:var(--orange-txt);}
.badge.out     {background:var(--tint-red); color:var(--red-txt);}
.badge.ok      {background:var(--tint-green); color:var(--green-txt);}
.status-chip{
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 9px; border-radius:var(--r-pill);
  font-size:12px; font-weight:600; white-space:nowrap; letter-spacing:-.005em;
}
.status-chip .ico{width:12.5px; height:12.5px; vertical-align:0;}
.status-scheduled        {background:var(--tint-gray);   color:var(--gray-txt);}
.status-conducted        {background:var(--tint-green);  color:var(--green-txt);}
.status-cancelled_teacher{background:var(--tint-red);    color:var(--red-txt);}
.status-cancelled_student{background:var(--tint-orange); color:var(--orange-txt);}
.status-rescheduled      {background:var(--tint-purple); color:var(--purple-txt);}
.hst-ok  {background:var(--tint-green);  color:var(--green-txt);}
.hst-no  {background:var(--tint-red);    color:var(--red-txt);}
.hst-mid {background:var(--tint-purple); color:var(--purple-txt);}
/* ---------- 10 - Icon sizing per context ---------- */
.status-btn .sb-ico .ico{width:19px; height:19px; vertical-align:0;}
.icon-btn .ico{width:19px; height:19px; vertical-align:0;}
.status-chip .ico{width:12.5px; height:12.5px; vertical-align:0;}
.sess-pay .ico{width:14px; height:14px; vertical-align:0;}
.teacher-hero .th-stat .ico{width:15px; height:15px; vertical-align:0;}
.acct-btn .ico{width:18px; height:18px; vertical-align:0;}
.kind-btn .ico{width:15px; height:15px;}
.sub-badge .ico{width:11px; height:11px; vertical-align:0;}
.mini-act .ico{width:12px; height:12px;}
.tick-move .ico{width:13px; height:13px;}
.mv-line .ico{width:13px; height:13px;}
.hist-note .ico{width:12px; height:12px;}
.login-logo .ico{width:34px; height:34px; vertical-align:0; color:var(--blue);}

/* Checkbox row for "Tambah paket sekaligus" in the Tambah Siswa form. */
.chk{
  display:flex; align-items:center; gap:9px;
  padding:11px 13px; margin-bottom:12px;
  border:1px solid var(--hairline); border-radius:var(--r-sm);
  background:var(--card); cursor:pointer;
  font-size:14.5px; font-weight:600; letter-spacing:-.012em;
}
.chk input{width:18px; height:18px; margin:0; accent-color:var(--blue); flex:0 0 auto;}
.chk .ico{width:17px; height:17px; vertical-align:-.15em; color:var(--blue);}
.chk-sub{font-weight:500; color:var(--label-3); font-size:12.5px;}

/* ---------- 11 - Rate rows & class groups ---------- */
.list-item .rate-lines{display:flex; flex-direction:column; gap:7px; margin-top:7px;}
.rate-line{display:flex; align-items:center; gap:9px;}
.rate-line .badge{flex:none; min-width:58px; text-align:center;}
.rate-amt{font-size:14px; color:var(--label-2); font-variant-numeric:tabular-nums;}
.rate-dur{font-size:12.5px; font-weight:600; color:var(--label-3); white-space:nowrap;}
.rate-tier-head{
  font-size:12px; font-weight:600; color:var(--label-2);
  text-transform:uppercase; letter-spacing:.05em; margin:16px 0 6px;
}
.class-group{margin-top:16px;}
.class-group:first-child{margin-top:0;}
.class-group-head{display:flex; align-items:center; justify-content:space-between; padding:2px 0 8px;}
.class-group-name{font-size:15px; font-weight:600; letter-spacing:-.018em;}
.class-group-name.muted{color:var(--label-2);}
.class-group-count{
  font-size:12px; font-weight:600; color:var(--label-2);
  background:var(--fill-2); padding:2px 9px; border-radius:var(--r-pill);
}
/* tint aliases completed (used by .badge.private / .badge.senior) */
:root{--tint-pink:rgba(255,45,85,.12); --tint-indigo:rgba(88,86,214,.13);}
@media (prefers-color-scheme:dark){
  :root{--tint-pink:rgba(255,55,95,.22); --tint-indigo:rgba(94,92,230,.24);}
}

/* ---------- 12 - Forms ---------- */
.field{margin-bottom:16px;}
.field > label{
  display:block; margin:0 0 6px 2px;
  font-size:13px; font-weight:600; color:var(--label-2); letter-spacing:-.005em;
}
.field input,.field select,.field textarea{
  width:100%; height:50px; padding:0 14px;
  font-size:16px; letter-spacing:-.011em;   /* 16px: iOS never zooms on focus */
  background:var(--card); color:var(--label);
  border:1px solid var(--hairline); border-radius:var(--r);
  -webkit-appearance:none; appearance:none;
  transition:border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field textarea{height:auto; min-height:88px; padding:13px 14px; line-height:1.45;}
.field select{
  padding-right:40px; cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.6 6 6.4l5-4.8' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 15px center; background-size:12px;
}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none; border-color:var(--blue); box-shadow:var(--ring);
}
.field input::placeholder,.field textarea::placeholder{color:var(--label-4);}
.field input:-webkit-autofill{
  -webkit-text-fill-color:var(--label); box-shadow:0 0 0 1000px var(--card) inset;
}
.field .hint{font-size:12.5px; color:var(--label-3); margin-top:6px; line-height:1.42;}
.field-err{font-size:12.5px; font-weight:600; color:var(--red-txt); margin-top:6px;}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
/* pick list — a scrollable list beats a 20-item native select on mobile */
.pick-list{
  max-height:46vh; overflow-y:auto;
  border:1px solid var(--separator); border-radius:var(--r); background:var(--card);
}
.pick-row{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:13px 15px; font-size:16px; letter-spacing:-.015em; cursor:pointer;
  border-bottom:1px solid var(--separator);
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.pick-row:last-child{border-bottom:0;}
.pick-row:active{background:var(--fill-2);}
.pick-row.on{background:var(--tint-blue); color:var(--blue); font-weight:600;}
.pick-row .pick-name{min-width:0;}
.pick-meta{font-size:12px; font-weight:600; color:var(--label-3);}
.pick-sub{display:block; font-size:12px; color:var(--label-3); font-weight:500; margin-top:2px;}

/* ---------- 23 - Paket picker (Tambah Paket Siswa) ----------
   Three labelled steps instead of one flat list: type cards state the duration and
   student cap, price rows carry a Trial/Regular badge + the per-session price, and
   the strip above Save restates the exact package being committed. */
.step-n{
  display:inline-flex; align-items:center; justify-content:center;
  width:17px; height:17px; margin-right:5px; border-radius:50%;
  background:var(--tint-blue); color:var(--blue);
  font-size:11px; font-weight:700; vertical-align:0;
}
.opt-grid{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.opt{
  display:flex; flex-direction:column; gap:2px; text-align:left;
  padding:10px 13px; border:1px solid var(--hairline); border-radius:var(--r);
  background:var(--card); cursor:pointer;
  transition:background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
             transform var(--t-fast) var(--ease);
}
.opt:active{transform:scale(.98);}
.opt.on{background:var(--tint-blue); border-color:transparent;}
.opt-t{font-size:14px; font-weight:600; letter-spacing:-.015em; color:var(--label);}
.opt.on .opt-t{color:var(--blue);}
.opt-s{font-size:11.5px; color:var(--label-3);}
/* The student cap is the primary sub-line: it is what tells the two
   "Semi-private Offline" products apart. */
.opt-cap{color:var(--label-2); font-weight:600;}
.opt.on .opt-cap{color:var(--blue);}
.lbl-sub{font-weight:500; color:var(--label-3);}
.plan-cards{
  border:1px solid var(--separator); border-radius:var(--r);
  background:var(--card); overflow:hidden;
}
/* Before a type is chosen the container is empty — an empty 1px box reads as a
   broken element, so hide it entirely. */
.plan-cards:empty{display:none;}
.plan-card{
  display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:11px;
  padding:11px 14px; cursor:pointer; border-bottom:1px solid var(--separator);
  transition:background var(--t-fast) var(--ease);
}
.plan-card:last-child{border-bottom:0;}
.plan-card:active{background:var(--fill-2);}
.plan-card.on{background:var(--tint-blue);}
.plan-badge{
  font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  padding:3px 8px; border-radius:var(--r-pill); white-space:nowrap;
}
.plan-badge.trial{background:var(--tint-orange); color:var(--orange-txt);}
.plan-badge.reg{background:var(--fill); color:var(--label-2);}
.plan-card.on .plan-badge.reg{background:rgba(0,113,227,.16); color:var(--blue);}
.plan-sesi{font-size:15px; font-weight:600; letter-spacing:-.015em; min-width:0;}
.plan-sesi small{
  display:block; font-size:11.5px; font-weight:500; color:var(--label-3); letter-spacing:0;
}
.plan-price{
  font-size:16px; font-weight:700; letter-spacing:-.02em; text-align:right;
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.plan-card.on .plan-sesi, .plan-card.on .plan-price{color:var(--blue);}
.picked{
  display:flex; align-items:center; gap:9px;
  padding:11px 14px; margin-bottom:12px; border-radius:var(--r-sm);
  font-size:13px; line-height:1.4; background:var(--fill-2); color:var(--label-2);
}
.picked .ico{width:16px; height:16px; flex:0 0 auto;}
.picked{background:var(--tint-green); color:var(--green-txt);}
.picked.edited{background:var(--tint-orange); color:var(--orange-txt);}
.picked.none{background:var(--fill-2); color:var(--label-2);}

/* day chips + filters + quick chips */
.day-picker{display:flex; flex-wrap:wrap; gap:8px;}
.day-chip{
  padding:9px 15px; border-radius:var(--r-pill);
  border:1px solid var(--hairline); background:var(--card);
  font-size:14px; font-weight:600; color:var(--label-2); cursor:pointer;
  -webkit-user-select:none; user-select:none;
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
             border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.day-chip:active{transform:scale(.95);}
.day-chip.on{background:var(--blue); border-color:transparent; color:#fff;}
/* Wrap instead of a hidden-scroll strip. Measured at 390px with 7 chips: only 3
   were fully visible and 4 sat off-screen behind a hidden scrollbar, so the filter
   looked like it was missing whole teachers. Wrapping keeps every one tappable.
   Kept compact so a growing staff list costs rows, not a scrolling hunt. */
.teacher-filter{display:flex; flex-wrap:wrap; gap:7px; margin-bottom:14px;}
.chip{
  flex-shrink:0; padding:8px 15px; border-radius:var(--r-pill);
  border:1px solid var(--hairline); background:var(--card);
  font-size:14px; font-weight:600; color:var(--label-2); cursor:pointer;
  -webkit-user-select:none; user-select:none; white-space:nowrap;
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.chip:active{transform:scale(.95);}
.chip.on{background:var(--blue); border-color:transparent; color:#fff;}
.chip.off{background:var(--tint-red); border-color:transparent; color:var(--red-txt);}
/* Kehadiran grid — a real 7-column month calendar. One tap cycles
   belum ditandai -> hadir -> tidak hadir -> belum ditandai, so a mis-tap is
   recoverable (the old chip row could only alternate blue <-> red forever). */
.att-grid{display:grid; grid-template-columns:repeat(7, 1fr); gap:6px; margin-bottom:10px;}
.att-dow{font-size:11px; font-weight:700; color:var(--label-3); text-align:center; padding-bottom:2px;}
.att-day{
  display:flex; align-items:center; justify-content:center; padding:0;
  aspect-ratio:1 / 1; border:1px solid var(--hairline); border-radius:10px;
  background:var(--card); color:var(--label-2); font-size:14px; font-weight:600;
  cursor:pointer;
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
             transform var(--t-fast) var(--ease);
}
.att-day:active{transform:scale(.93);}
.att-day.we{background:var(--fill); color:var(--label-3);}
.att-day.on{background:var(--blue); border-color:transparent; color:#fff;}
.att-day.off{background:var(--tint-red); border-color:transparent; color:var(--red-txt);}
.att-day.today{box-shadow:0 0 0 2px var(--blue);}
.att-legend{display:flex; flex-wrap:wrap; gap:12px; margin:2px 0 4px;
  font-size:12.5px; font-weight:600; color:var(--label-2);}
.att-key{display:inline-flex; align-items:center; gap:6px;}
.att-key::before{content:''; width:11px; height:11px; border-radius:4px;
  border:1px solid var(--hairline); background:var(--card);}
.att-key.on::before{background:var(--blue); border-color:transparent;}
.att-key.off::before{background:var(--tint-red); border-color:transparent;}
.quick-chips{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px;}
.quick-chip{
  padding:8px 13px; border-radius:var(--r-pill);
  border:1px solid var(--hairline); background:var(--card);
  font-size:13px; font-weight:600; color:var(--label-2); cursor:pointer; white-space:nowrap;
}
.quick-chip:active{background:var(--tint-blue); color:var(--blue);}
/* Upload picker. A native <input type=file> paints a 24px OS button inside its
   bordered box, aligned to the baseline — every pixel of the leftover height
   lands BELOW it, which is the "not centred in the border" the owner reported.
   The input is hidden here and .file-drop (a label) becomes the real control:
   centred both ways by design, and it names the file it picked up. */
.file-slot{position:relative; margin-bottom:14px;}
.file-slot input[type=file]{
  position:absolute; left:0; top:0; width:1px; height:1px; opacity:0;
  padding:0; border:0; -webkit-appearance:none; appearance:none; pointer-events:none;
}
.file-drop{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; width:100%; min-height:98px; padding:14px 12px;
  border:1.5px dashed var(--hairline); border-radius:var(--r); background:var(--fill);
  font-size:14px; font-weight:600; color:var(--label-2); line-height:1.3;
  text-align:center; cursor:pointer;
  transition:background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.file-drop:active{background:var(--tint-blue);}
.file-drop.on{border-style:solid; border-color:var(--blue); background:var(--tint-blue); color:var(--blue);}
.file-drop-ico{display:flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:50%; background:var(--card);}
.file-drop-ico .ico{width:20px; height:20px; vertical-align:0; color:var(--blue);}
.file-drop-txt{max-width:100%; overflow-wrap:anywhere;}
.file-drop-sub{font-size:12.5px; font-weight:500; color:var(--label-3);}
.file-drop.on .file-drop-sub{color:var(--blue);}
/* ---------- 13 - Info boxes + segmented control ---------- */
.preview-box{
  background:var(--tint-blue); color:var(--blue);
  border-radius:var(--r); padding:13px 15px;
  font-size:15px; font-weight:600; letter-spacing:-.015em;
}
.conflict-warn{
  background:var(--tint-red); color:var(--red-txt);
  border-radius:var(--r); padding:12px 14px;
  font-size:14px; font-weight:600; margin-bottom:14px;
}
.segmented{
  display:flex; gap:2px; padding:3px; margin-bottom:16px;
  background:var(--fill); border-radius:var(--r-sm);
}
.seg{
  flex:1; border:0; padding:8px 4px; border-radius:8px;
  background:transparent; color:var(--label);
  font-size:13.5px; font-weight:600; letter-spacing:-.01em;
  transition:background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
             transform var(--t-fast) var(--ease);
}
.seg:active{transform:scale(.97);}
/* selected segment lifts as a white pill, exactly like UISegmentedControl */
.seg.active{
  background:var(--card);
  box-shadow:0 1px 2px rgba(0,0,0,.10), 0 2px 7px rgba(0,0,0,.07);
}
/* On a phone the two decision buttons take ~140px of a 390px row, which squeezed
   the teacher, the range and the status chip into three wrapped lines. Stack them
   under the text instead: the row is a little taller, but it reads as a sentence
   again. Desktop keeps them on the right, where there is room for both.
   (metrics measured at 390px, where the text column had only ~200px left) */
@media (max-width:520px){
  .list-item.leave-item{flex-wrap:wrap;}
  .list-item.leave-item .li-main{flex:1 1 100%;}
  .list-item.leave-item .li-actions{width:100%; justify-content:flex-end; margin-top:8px;}
}

/* In dark mode the knob must be LIGHTER than the track (iOS uses systemGray),
   and idle labels sit back a step. */
@media (prefers-color-scheme:dark){
  .seg{color:var(--label-2);}
  .seg.active{background:#636366; color:#fff; box-shadow:0 1px 3px rgba(0,0,0,.55);}
}
.kind-row{display:grid; grid-template-columns:repeat(3,1fr); gap:8px;}
.kind-btn{
  border:1px solid var(--hairline); background:var(--card); border-radius:var(--r-sm);
  padding:11px 6px; font-size:13px; font-weight:600; color:var(--label-2);
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.kind-btn.on{background:var(--tint-blue); border-color:transparent; color:var(--blue);}
/* ---------- 14 - Schedule / calendar ---------- */
.cal-head{display:flex; align-items:center; gap:10px; margin-bottom:16px;}
.cal-title{
  flex:1; text-align:center;
  font-size:17px; font-weight:600; letter-spacing:-.022em;
}
.cal-nav{
  flex:none; width:34px; height:34px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  border:0; border-radius:50%; background:var(--fill); color:var(--blue);
  font-size:17px; line-height:1; cursor:pointer;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.cal-nav:hover{background:var(--tint-blue);}
.cal-nav:active{transform:scale(.9);}

/* day view */
.cal-class{
  background:var(--card); border-left:4px solid var(--blue);
  border-radius:var(--r-lg); box-shadow:var(--shadow-1);
  padding:14px 16px; margin-bottom:10px; cursor:pointer;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.cal-class:active{transform:scale(.985); background:var(--card-2);}
.cal-class-time{
  font-size:13px; font-weight:600; color:var(--label-2);
  font-variant-numeric:tabular-nums; letter-spacing:.01em;
}
.cal-class-name{font-size:17px; font-weight:600; letter-spacing:-.022em; margin-top:2px;}
.cal-class-meta{font-size:13.5px; color:var(--label-2); margin-top:2px;}
.cal-class.is-cancelled{opacity:.6;}
.cal-class.is-cancelled .cal-class-name{text-decoration:line-through;}

/* week view */
.week-scroll{overflow-x:auto; margin:0 -20px; padding:0 20px 4px; scrollbar-width:none;}
.week-scroll::-webkit-scrollbar{display:none;}
.week-grid{display:flex; gap:9px;}
.wk-col{
  flex:1 0 118px; min-width:0; padding:11px 11px 13px;
  background:var(--card); border-radius:var(--r-lg); box-shadow:var(--shadow-1);
  cursor:pointer; border:1.5px solid transparent;
  transition:border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.wk-col:active{transform:scale(.985);}
.wk-col.today{border-color:var(--blue);}
.wk-day{font-size:12px; font-weight:600; color:var(--label-3); letter-spacing:.02em;}
.wk-date{font-size:22px; font-weight:600; letter-spacing:-.03em; margin:1px 0 7px;}
.wk-col.today .wk-date{color:var(--blue);}
.wk-classes{display:flex; flex-direction:column; gap:6px;}
.wk-class{padding:7px 9px; border-radius:9px; font-size:12px; line-height:1.32;}
.wk-class b{display:block; font-size:11px; font-weight:700; margin-bottom:1px;}
/* month view */
.mo-weekdays{display:grid; grid-template-columns:repeat(7,1fr); gap:4px; margin-bottom:6px;}
.mo-weekdays div{text-align:center; font-size:11px; font-weight:600; color:var(--label-3); letter-spacing:.04em;}
.mo-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:5px;}
.mo-cell{
  min-height:70px; padding:4px; overflow:hidden; cursor:pointer;
  background:var(--card); border-radius:var(--r-sm); box-shadow:var(--shadow-1);
  transition:transform var(--t-fast) var(--ease);
}
.mo-cell:active{transform:scale(.97);}
.mo-cell.blank,
.mo-cell.blank:active{background:transparent; box-shadow:none; cursor:default; transform:none;}
.mo-cell.today{background:var(--tint-blue); box-shadow:none;}
.mo-num{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:22px; height:22px; border-radius:50%;
  font-size:12.5px; font-weight:600; font-variant-numeric:tabular-nums;
}
.mo-cell.today .mo-num{background:var(--blue); color:#fff;}
.mo-class{
  margin-top:3px; padding:1.5px 5px; border-radius:5px;
  font-size:9.5px; font-weight:600; line-height:1.45;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.mo-more{font-size:9.5px; color:var(--label-3); padding:2px 5px 0; font-weight:600;}

/* ---------- 15 - Attendance ---------- */
.att-list{display:flex; flex-direction:column; gap:8px; margin:4px 0 14px;}
.att-row{
  display:flex; align-items:center; gap:10px; padding:11px 13px;
  border:1px solid var(--separator); border-radius:var(--r); background:var(--card);
}
.att-date{flex:1; font-size:15px; font-weight:600; letter-spacing:-.015em;}
.att-badge{
  font-size:11px; font-weight:600; color:var(--orange-txt);
  background:var(--tint-orange); padding:2px 7px; border-radius:var(--r-pill); margin-left:4px;
}
.att-input{
  width:74px; padding:10px; font-size:16px; text-align:center;
  border:1px solid var(--hairline); border-radius:var(--r-sm);
  background:var(--card); color:var(--label);
}
.att-input:focus{outline:none; border-color:var(--blue); box-shadow:var(--ring);}
.att-unit{font-size:13px; color:var(--label-3);}
.att-controls{display:flex; align-items:center; gap:10px;}
.att-cancel-toggle{
  display:flex; align-items:center; gap:5px; font-size:13px; color:var(--label-2);
  cursor:pointer; -webkit-user-select:none; user-select:none; white-space:nowrap;
}
.att-cancel-toggle input{width:17px; height:17px; accent-color:var(--red);}
.att-row.is-cancelled{opacity:.5;}
.att-row.is-cancelled .att-date{text-decoration:line-through;}
.att-badge.cancel{color:var(--red-txt); background:var(--tint-red);}

/* attendance + substitute badges on calendar cards */
.cal-att{
  display:inline-flex; align-items:center;
  font-size:11px; font-weight:600; padding:2px 8px; border-radius:var(--r-pill);
  margin-left:6px; vertical-align:middle;
  background:var(--tint-gray); color:var(--gray-txt);
}
.cal-att.override{background:var(--tint-orange); color:var(--orange-txt);}
.cal-att.cancel{background:var(--tint-red); color:var(--red-txt);}
/* ---------- 16 - Session sheet: status, presence, make-up ---------- */
.status-grid{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:6px;}
.status-btn{
  display:flex; align-items:center; gap:9px; text-align:left; line-height:1.25;
  padding:13px 12px; border:1px solid var(--hairline); border-radius:var(--r);
  background:var(--card); color:var(--label);
  font-size:13.5px; font-weight:600; letter-spacing:-.015em;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
             border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.status-btn:active{transform:scale(.97);}
.status-btn.on{border-color:transparent; background:var(--tint-blue); color:var(--blue);}
.status-btn.on.sb-conducted{border-color:transparent; background:var(--tint-green); color:var(--green-txt);}
.status-btn.on.sb-ct{border-color:transparent; background:var(--tint-red); color:var(--red-txt);}
.status-btn.on.sb-cs{border-color:transparent; background:var(--tint-orange); color:var(--orange-txt);}
.status-btn.on.sb-rs{border-color:transparent; background:var(--tint-purple); color:var(--purple-txt);}

.tick-list{display:flex; flex-direction:column; gap:7px; margin-bottom:14px;}
.tick-row{
  display:flex; align-items:center; gap:11px; padding:12px 13px;
  border:1px solid var(--separator); border-radius:var(--r); background:var(--card);
  cursor:pointer; font-size:16px; font-weight:500; letter-spacing:-.015em;
  transition:background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tick-row.on{background:var(--tint-green); border-color:transparent;}
.tick-row input{
  width:20px; height:20px; flex-shrink:0; accent-color:var(--green);
}
.tick-row .tick-name{flex:1; min-width:0;}
.tick-row .tick-pkg{font-size:12px; color:var(--label-3); font-weight:600;}
.tick-row.is-guest{border-style:dashed;}
.tick-item{display:flex; gap:8px; align-items:stretch;}
.tick-item .tick-row{flex:1 1 auto; min-width:0;}
.tick-move{
  flex:none; display:inline-flex; align-items:center; gap:5px;
  padding:0 13px; border:0; border-radius:var(--r);
  background:var(--tint-blue); color:var(--blue);
  font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.tick-move:active{transform:scale(.96); background:var(--blue); color:#fff;}
/* Guru pengganti / pindah jadwal markers */
.sub-badge{
  display:inline-flex; align-items:center; gap:4px; vertical-align:middle;
  background:var(--tint-orange); color:var(--orange-txt);
  border-radius:var(--r-pill); padding:2px 8px;
  font-size:11.5px; font-weight:600; white-space:nowrap;
}
.mv-tag{
  background:var(--tint-indigo); color:var(--indigo-txt);
  border-radius:var(--r-pill); padding:2px 8px;
  font-size:11.5px; font-weight:600; white-space:nowrap;
}
.mini-act{
  display:inline-flex; align-items:center; gap:5px; vertical-align:middle;
  border:0; border-radius:var(--r-pill);
  background:var(--tint-blue); color:var(--blue);
  font-size:12px; font-weight:600; padding:4px 11px; cursor:pointer;
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.mini-act:active{background:var(--blue); color:#fff;}
.mv-list{display:flex; flex-direction:column; gap:7px;}
.mv-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  border:1px solid var(--separator); border-radius:var(--r);
  padding:11px 13px; background:var(--card);
}
.mv-who{min-width:0; font-size:15px; font-weight:600; letter-spacing:-.015em;}
.mv-sub{font-size:12.5px; color:var(--label-2); font-weight:500;}
.mv-line{
  display:flex; align-items:center; gap:5px; margin-top:4px;
  font-size:12px; font-weight:600; color:var(--orange-txt);
}
.mv-line.is-in{color:var(--indigo-txt);}
.mv-line.is-in .ico{color:var(--indigo-txt);}
.quota-box{
  border:1px solid var(--separator); border-radius:var(--r);
  padding:11px 13px; margin-bottom:11px;
  font-size:13.5px; font-weight:600; letter-spacing:-.01em;
}
.quota-box.is-empty{border-color:transparent; background:var(--tint-red); color:var(--red-txt);}
/* ---------- 17 - Packages, alerts, key-value lists ---------- */
.pkg-row{padding:13px 0; border-bottom:1px solid var(--separator);}
.pkg-row:last-child{border-bottom:0;}
.pkg-head{display:flex; align-items:baseline; justify-content:space-between; gap:10px;}
.pkg-title{font-size:16px; font-weight:600; letter-spacing:-.018em;}
.pkg-left{font-size:13px; font-weight:600; white-space:nowrap; color:var(--label-2);}
.pkg-left.low{color:var(--orange-txt);}
.pkg-left.out{color:var(--red-txt);}
.pkg-meta{font-size:13px; color:var(--label-2); margin-top:2px;}
.progress{
  height:5px; border-radius:3px; margin-top:9px;
  background:var(--fill); overflow:hidden;
}
.progress > span{display:block; height:100%; border-radius:3px; background:var(--blue);}
.progress > span.low{background:var(--orange);}
.progress > span.out{background:var(--red);}
.kv{
  display:flex; justify-content:space-between; gap:12px;
  padding:11px 0; font-size:15px; border-bottom:1px solid var(--separator);
}
.kv:last-child{border-bottom:0;}
.kv .k{color:var(--label-2);}
.kv .v{font-weight:600; text-align:right; letter-spacing:-.012em;}
.kv.total{border-top:1px solid var(--separator); border-bottom:0; padding-top:13px; margin-top:4px; font-weight:700;}
.kv.total .v{font-size:17px;}
/* ---------- 18 - Teacher home, session cards ---------- */
.teacher-hero{
  position:relative; overflow:hidden;
  background:linear-gradient(150deg,#0a84ff 0%,#0071e3 46%,#0057b8 100%);
  color:#fff; border-radius:var(--r-xl);
  padding:22px 22px 20px; margin-bottom:18px; box-shadow:var(--shadow-2);
}
.teacher-hero::after{
  content:''; position:absolute; top:-60px; right:-40px;
  width:190px; height:190px; border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,.30),transparent 66%);
}
.teacher-hero h2{font-size:24px; font-weight:600; letter-spacing:-.028em;}
.teacher-hero .th-sub{opacity:.86; font-size:14px; margin-top:3px; letter-spacing:-.011em;}
.teacher-hero .th-stat{
  display:inline-flex; align-items:center; gap:6px;
  background:rgba(255,255,255,.20); border-radius:var(--r-pill);
  padding:8px 14px; margin-top:15px; margin-right:8px;
  font-size:13px; font-weight:600;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.sess-card{
  display:flex; align-items:center; gap:13px; padding:13px 15px;
  border:1px solid transparent; border-left:4px solid var(--blue);
  border-radius:var(--r-lg); background:var(--card);
  box-shadow:var(--shadow-1); margin-bottom:9px; cursor:pointer;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.sess-card:active{transform:scale(.985);}
.sess-card.is-done{border-left-color:var(--green);}
.sess-card.is-cancel{border-left-color:var(--red); opacity:.72;}
.sess-card.is-moved{border-left-color:var(--purple); opacity:.85;}
.sess-time{
  font-size:14px; font-weight:600; color:var(--label-2);
  min-width:48px; font-variant-numeric:tabular-nums; letter-spacing:.01em;
}
.sess-main{flex:1; min-width:0;}
.sess-title{font-size:16px; font-weight:600; letter-spacing:-.018em;}
.sess-meta{font-size:13px; color:var(--label-2); margin-top:2px;}
.sess-pay{display:flex; align-items:center; gap:4px; font-size:12.5px; font-weight:600; color:var(--green-txt);}
/* ---------- 19 - Payroll ---------- */
.pay-table{width:100%; border-collapse:collapse; font-size:14.5px; letter-spacing:-.008em;}
.pay-table th{
  text-align:left; padding:9px 6px; border-bottom:1px solid var(--separator);
  font-size:12px; font-weight:600; color:var(--label-2);
  text-transform:uppercase; letter-spacing:.04em;
}
.pay-table td{padding:10px 6px; border-bottom:1px solid var(--separator); vertical-align:top;}
.pay-table tr:last-child td{border-bottom:0;}
.pay-table .num{text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums;}
.total-row td{font-weight:700; border-top:1px solid var(--separator); border-bottom:0;}
.teacher-block{margin-bottom:22px;}
.teacher-block h3{font-size:17px; font-weight:600; letter-spacing:-.022em; margin-bottom:6px;}
.teacher-total{
  display:flex; justify-content:space-between; padding:9px 0;
  font-weight:600; letter-spacing:-.012em;
}
.pay-label{display:block; font-size:13px; font-weight:600; color:var(--label-2); margin-bottom:8px;}
.pay-row{display:flex; gap:10px; align-items:stretch;}
.month-pick{
  flex:1; min-width:0; display:flex; align-items:center;
  background:var(--card); border:1px solid var(--separator);
  border-radius:14px; overflow:hidden; box-shadow:var(--shadow-1);
}
.mp-nav{
  flex:none; align-self:stretch; display:flex; align-items:center;
  padding:0 14px; border:0; background:transparent;
  color:var(--blue); font-size:21px; line-height:1;
  transition:background var(--t-fast) var(--ease);
}
.mp-nav:hover{background:var(--tint-blue);}
.mp-nav:active{background:var(--blue); color:#fff;}
.mp-body{
  position:relative; flex:1; min-width:0;
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 2px;
}
.mp-ico{display:inline-flex; color:var(--blue);}
.mp-text{font-size:16px; font-weight:600; letter-spacing:-.022em; white-space:nowrap;}
.mp-native{position:absolute; inset:0; opacity:0; border:0; cursor:pointer;}
.mp-holder{position:absolute; width:1px; height:1px; opacity:0; left:-9999px; border:0;}
.pay-go{
  flex:none; align-self:stretch; display:inline-flex;
  align-items:center; justify-content:center; padding:0 20px; border-radius:14px;
}
.export-row{display:grid; grid-template-columns:1fr 1fr 1fr; gap:9px; margin-bottom:18px;}
/* Pemasukan exports only two formats; a 3-column track left an empty third. */
.export-row.two{grid-template-columns:1fr 1fr;}
/* uniform tinted actions — two loud filled buttons side by side is not Apple */
.export-row .btn{background:var(--tint-blue); color:var(--blue); box-shadow:none; padding:12px 6px; font-size:14px;}
.export-row .btn:hover{background:var(--tint-blue);}
/* ---------- 20 - Sheet (modal) ---------- */
.modal-overlay{
  position:fixed; inset:0; z-index:40;
  display:flex; align-items:flex-end; justify-content:center;
  background:var(--overlay);
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  animation:overlayIn var(--t) var(--ease);
}
@keyframes overlayIn{from{opacity:0;} to{opacity:1;}}
.modal{
  position:relative; width:100%; max-width:600px;
  max-height:90vh; max-height:90dvh;
  display:flex; flex-direction:column;
  background:var(--card);
  border-radius:var(--r-xl) var(--r-xl) 0 0;
  box-shadow:var(--shadow-pop);
  animation:sheetUp var(--t-slow) var(--spring);
}
@keyframes sheetUp{from{transform:translateY(101%);} to{transform:translateY(0);}}
/* the grabber that tells you the sheet can be swiped down */
.modal::before{
  content:''; position:absolute; top:7px; left:50%; transform:translateX(-50%);
  width:38px; height:5px; border-radius:3px; background:var(--fill);
}
.modal-head{
  position:sticky; top:0; z-index:2;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:20px 20px 10px;
  background:var(--card); border-radius:var(--r-xl) var(--r-xl) 0 0;
  border-bottom:1px solid transparent;
  transition:border-color var(--t) var(--ease);
}
.modal-head.stuck{border-bottom-color:var(--separator);}
.modal-head h2{font-size:19px; font-weight:600; letter-spacing:-.024em;}
.modal-close{
  flex:none; width:30px; height:30px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  border:0; border-radius:50%;
  background:var(--fill); color:var(--label-2);
  font-size:19px; line-height:1;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.modal-close:active{transform:scale(.9); background:var(--fill-2);}
.modal-body{padding:4px 20px calc(26px + env(safe-area-inset-bottom)); overflow-y:auto;}
.modal-body::-webkit-scrollbar{width:0;}
/* Tall variant: the Tambah Kelas form fits one screen without scrolling. */
.modal.modal-tall{max-height:96vh; max-height:96dvh;}
.modal.modal-tall .modal-head{padding:15px 18px 6px;}
.modal.modal-tall .modal-head h2{font-size:17px;}
.modal.modal-tall .modal-body{padding:2px 18px calc(12px + env(safe-area-inset-bottom));}
.modal.modal-tall .field{margin-bottom:7px;}
.modal.modal-tall .field > label{font-size:12px; margin-bottom:4px;}
.modal.modal-tall .field input,
.modal.modal-tall .field select,
.modal.modal-tall .field textarea{height:44px; font-size:16px; padding:0 12px;}
.modal.modal-tall .field .hint{font-size:11.5px; margin-top:3px;}
.modal.modal-tall .day-chip{padding:6px 11px; font-size:12.5px;}
.modal.modal-tall .btn{padding:9px 13px; font-size:14px;}

/* ---------- 21 - Alert (replaces native alert/confirm/prompt) ---------- */
.dlg-layer{
  position:fixed; inset:0; z-index:60; padding:24px;
  display:flex; align-items:center; justify-content:center;
  background:var(--overlay);
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  animation:overlayIn var(--t-fast) var(--ease);
}
/* A real UIAlertController: 270pt, translucent material, hairline-separated
   full-width buttons stacked preferred-action-first. */
.dlg{
  width:100%; max-width:272px; padding:0; overflow:hidden; text-align:center;
  background:var(--material);
  -webkit-backdrop-filter:saturate(180%) blur(24px);
  backdrop-filter:saturate(180%) blur(24px);
  border-radius:14px; box-shadow:var(--shadow-pop);
  animation:dlgPop var(--t) var(--spring);
}
@keyframes dlgPop{from{transform:scale(.88); opacity:0;} to{transform:none; opacity:1;}}
.dlg-ico{
  width:52px; height:52px; margin:20px auto 0;
  display:flex; align-items:center; justify-content:center; border-radius:50%;
}
.dlg-ico .ico{width:26px; height:26px; vertical-align:0;}
.dlg-info   .dlg-ico{background:var(--tint-blue);   color:var(--blue);}
.dlg-warn   .dlg-ico{background:var(--tint-orange); color:var(--orange-txt);}
.dlg-danger .dlg-ico{background:var(--tint-red);    color:var(--red-txt);}
.dlg-title{
  font-size:17px; font-weight:600; letter-spacing:-.022em;
  margin:0; padding:14px 18px 0;
}
.dlg-ico + .dlg-title{padding-top:12px;}
.dlg-msg{
  font-size:13px; color:var(--label-2); line-height:1.42;
  white-space:pre-line; margin:0; padding:5px 18px 16px;
}
.dlg-msg:empty{display:none;}
.dlg-field{padding:0 18px 16px;}
.dlg-field input{
  width:100%; height:44px; padding:0 12px; text-align:center; font-weight:600;
  font-size:16px; background:var(--card); color:var(--label);
  border:1px solid var(--hairline); border-radius:var(--r-sm);
}
.dlg-field input:focus{outline:none; border-color:var(--blue); box-shadow:var(--ring);}
.dlg-actions{
  display:flex; flex-direction:column-reverse;
  border-top:1px solid var(--separator);
}
.dlg-actions .btn{
  width:100%; height:44px; border-radius:0; padding:0;
  background:transparent; font-size:17px; font-weight:400; color:var(--blue);
  letter-spacing:-.022em;
}
.dlg-actions .btn + .btn{border-bottom:1px solid var(--separator);}
.dlg-actions .btn:active{background:var(--fill-2); transform:none;}
.dlg-actions .btn-primary,
.dlg-actions .btn-danger-solid{font-weight:600;}
.dlg-actions .btn-primary{background:transparent; color:var(--blue); box-shadow:none;}
.dlg-actions .btn-primary:hover{background:var(--fill-2);}
.dlg-actions .btn-ghost{background:transparent; color:var(--blue);}
.dlg-actions .btn-ghost:hover{background:var(--fill-2);}
.dlg-actions .btn-danger-solid{background:transparent; color:var(--red-txt);}
/* ---------- 22 - Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:calc(26px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  max-width:min(88vw,420px);
  padding:12px 20px; border-radius:var(--r-pill);
  background:var(--toast-bg); color:#fff;
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px);
  font-size:15px; font-weight:600; letter-spacing:-.015em; text-align:center;
  box-shadow:var(--shadow-pop); z-index:50;
  animation:toastIn var(--t) var(--spring);
}
.toast.err{background:var(--red);}
@keyframes toastIn{from{opacity:0; transform:translate(-50%,14px) scale(.96);} to{opacity:1; transform:translateX(-50%);}}

/* ---------- 23 - Payslip: per-session detail ---------- */
.sess-class{margin-top:16px;}
.sess-class-title{
  font-size:12px; font-weight:600; color:var(--label-2);
  text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px;
}
.sess-detail .pay-table{font-size:13px;}
.sess-detail .pay-table td{padding:8px 6px;}
.sess-detail .hint{margin-top:8px;}
.sess-detail .mv-tag{margin-left:3px;}
.sess-toggle{margin-top:14px;}
.sess-toggle > summary{
  display:flex; align-items:center; gap:7px;
  list-style:none; cursor:pointer; -webkit-user-select:none; user-select:none;
  padding:11px 14px; border-radius:var(--r);
  background:var(--tint-blue); color:var(--blue);
  font-size:14px; font-weight:600; letter-spacing:-.015em;
  transition:transform var(--t-fast) var(--ease);
}
.sess-toggle > summary:active{transform:scale(.985);}
.sess-toggle > summary::-webkit-details-marker{display:none;}
.sess-toggle > summary::marker{content:'';}
.sess-toggle > summary .ico{width:15px; height:15px; transition:transform var(--t) var(--spring);}
.sess-toggle[open] > summary .ico{transform:rotate(90deg);}
.sess-toggle > summary .sess-count{margin-left:auto; font-size:13px; font-weight:500; opacity:.85;}
.sess-toggle[open] > summary{margin-bottom:4px;}
/* ---------- 24 - Student history ---------- */
.hist-row{display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--separator);}
.hist-row:last-child{border-bottom:0;}
.hist-when{
  flex:0 0 88px; padding-top:1px;
  font-size:12.5px; font-weight:600; color:var(--label-3); letter-spacing:-.005em;
}
.hist-body{flex:1 1 auto; min-width:0;}
.hist-title{font-size:15px; font-weight:600; letter-spacing:-.018em;}
.hist-sub{font-size:13px; color:var(--label-2); margin-top:2px;}
.hist-pkg{
  display:inline-block; margin-top:5px; padding:2px 9px; border-radius:var(--r-pill);
  font-size:12px; font-weight:600;
  background:var(--tint-blue); color:var(--blue);
}
.hist-note{
  display:flex; align-items:center; gap:5px; margin-top:5px;
  font-size:12px; font-weight:600; color:var(--orange-txt);
}
.hist-note.is-in{color:var(--indigo-txt);}

/* ---------- 25 - Misc primitives ---------- */
.hint{font-size:12.5px; color:var(--label-3); line-height:1.42;}
.acct-btn{
  display:inline-flex; align-items:center; gap:7px;
  padding:5px 11px 5px 12px; border:0; border-radius:var(--r-pill);
  background:var(--fill); color:var(--label-2);
  font-size:13.5px; font-weight:600; letter-spacing:-.012em;
  transition:background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  white-space:nowrap;
}
.acct-btn:active{transform:scale(.96); background:var(--fill-2);}
.acct-role{font-size:12px; font-weight:600; color:var(--blue);}
/* Under 520px the topbar must hold the labelled menu button, the large iOS-style
   title AND this chip. The role word is redundant here (the sidebar footer already
   reads "manager / Manager"), so drop it rather than ellipsise the page title —
   measured: the title needs 141px and this frees exactly enough for all of it. */
@media (max-width:520px){ .acct-role{display:none;} }
b,strong{font-weight:600;}
.mono,[data-mono]{font-variant-numeric:tabular-nums;}

/* ---------- 26 - Focus visibility (keyboard) ---------- */
:focus-visible{outline:2px solid var(--blue); outline-offset:2px; border-radius:var(--r-xs);}
.field input:focus-visible,.field select:focus-visible{outline:none;}

/* ---------- 27 - Responsive ---------- */
@media (min-width:720px){
  body{font-size:16px;}
  /* Keep the tab bar's items under the content column instead of smearing them
     across the whole desktop window. */
  .topbar{padding:14px 28px 14px;}
  .topbar-title{font-size:32px;}
  .view{padding:24px 28px 32px;}
  .modal-overlay{align-items:center; padding:32px;}
  .modal{border-radius:var(--r-xl); max-height:86vh; animation:modalIn var(--t-slow) var(--spring);}
  .modal::before{display:none;}
  .modal-head{border-radius:var(--r-xl) var(--r-xl) 0 0;}
  @keyframes modalIn{from{opacity:0; transform:translateY(14px) scale(.985);} to{transform:none; opacity:1;}}
  .wk-col{min-width:0;}
  .mo-cell{min-height:92px;}
  .status-grid{grid-template-columns:repeat(4,1fr);}
}

/* ---------- 28 - Reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}
/* ---------- 29 - Login ---------- */
.login-screen{
  min-height:100vh; min-height:100dvh;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  background:radial-gradient(120% 90% at 50% -10%,#ffffff 0%,#f6f7f9 46%,#eceff5 100%);
  color:var(--label);
}
.login-card{
  width:100%; max-width:376px;
  padding:34px 28px 30px;
  background:rgba(255,255,255,.88);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px);
  border:1px solid rgba(0,0,0,.06); border-radius:var(--r-xl);
  box-shadow:0 1px 2px rgba(0,0,0,.04), 0 18px 44px -14px rgba(10,20,40,.22);
  animation:loginIn var(--t-slow) var(--spring);
}
/* Transform-only entrance: a killed/never-started animation must never be able
   to leave the login screen invisible. */
@keyframes loginIn{from{transform:translateY(14px) scale(.965);} to{transform:none;}}
.login-badge{
  width:64px; height:64px; margin:0 auto 16px;
  display:flex; align-items:center; justify-content:center;
  border-radius:17px;
  background:linear-gradient(180deg,#ffffff,#eef1f6);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.05), 0 6px 16px -8px rgba(10,20,40,.35);
}
.login-card h1{
  text-align:center; margin:0 0 5px;
  font-size:26px; font-weight:600; letter-spacing:-.022em;
}
.login-sub{
  text-align:center; color:var(--label-2); margin:0 0 26px;
  font-size:14px; letter-spacing:-.01em;
}
/* The switch on the login screen. Deliberately quiet - it must be reachable BEFORE
   login (someone who cannot read Indonesian needs it most), but must never compete
   with the Sign in button. */
.login-lang{
  display:block; width:100%; margin:18px 0 0; padding:10px 0;
  font-family:inherit; font-size:13px; font-weight:500; letter-spacing:-.005em;
  color:var(--accent, #0a84ff); background:none; border:0; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.login-lang::before{content:"\1F310\00a0\00a0"; font-size:12px;}
.login-lang:active{opacity:.55;}
.lg-field{margin-bottom:14px;}
.lg-field label{
  display:block; font-size:12.5px; font-weight:500; color:var(--label);
  margin-bottom:6px; letter-spacing:-.005em;
}
.lg-field input{
  width:100%; height:48px; padding:0 14px;
  font-size:16px; font-family:inherit; color:var(--label);
  background:rgba(255,255,255,.92);
  border:1px solid var(--hairline); border-radius:12px;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.lg-field input:focus{
  outline:none; border-color:var(--blue); background:#fff; box-shadow:var(--ring);
}
.lg-field input:-webkit-autofill{
  -webkit-text-fill-color:var(--label); box-shadow:0 0 0 1000px #fff inset;
}
.lg-btn{
  width:100%; height:48px; margin-top:6px; border:0; border-radius:12px;
  background:var(--blue); color:#fff; font-family:inherit;
  font-size:16px; font-weight:600; letter-spacing:-.01em;
  transition:background .15s, transform .1s var(--spring);
}
.lg-btn:hover{background:var(--blue-hi);}
.lg-btn:active{transform:scale(.985);}
.lg-btn:disabled{opacity:.6; cursor:default;}
.login-error{
  color:var(--red-txt); font-size:13px; margin:12px 0 0;
  text-align:center; letter-spacing:-.005em;
}
@media (prefers-color-scheme:dark){
  .login-screen{
    background:radial-gradient(120% 90% at 50% -10%,#1c1c1e 0%,#121214 46%,#000000 100%);
  }
  .login-card{
    background:rgba(28,28,30,.86);
    border-color:rgba(255,255,255,.09);
    box-shadow:0 1px 2px rgba(0,0,0,.6), 0 22px 50px -16px rgba(0,0,0,.8);
  }
  .login-badge{
    background:linear-gradient(180deg,#2c2c2e,#1c1c1e);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.08), 0 6px 18px -8px #000;
  }
  .lg-field input{background:rgba(58,58,60,.6);}
  .lg-field input:focus{background:rgba(58,58,60,.9);}
  .lg-field input:-webkit-autofill{
    -webkit-text-fill-color:var(--label); box-shadow:0 0 0 1000px #2c2c2e inset;
  }
}

/* ---------- 22 - Pemasukan (revenue) ---------- */
.rev-cards{display:grid; grid-template-columns:repeat(3, 1fr); gap:9px; margin-bottom:18px;}
@media (max-width:520px){ .rev-cards{grid-template-columns:1fr; gap:8px;} }
.rev-card{
  background:var(--card); border-radius:var(--r-lg); box-shadow:var(--shadow-1);
  padding:13px 14px;
}
.rev-card-t{font-size:12px; font-weight:600; color:var(--label-3); letter-spacing:.01em;}
.rev-card-v{font-size:20px; font-weight:700; letter-spacing:-.022em; margin:3px 0 2px;}
.rev-card-v.good{color:var(--green-txt);}
.rev-card-v.out{color:var(--red-txt);}
.rev-card-s{font-size:11.5px; color:var(--label-3);}
/* A payroll run that does not exist yet makes the margin look better than it is,
   so say so instead of quietly showing the bigger number. */
.notice{
  display:flex; align-items:flex-start; gap:9px;
  padding:12px 14px; border-radius:var(--r-sm); margin-bottom:16px;
  font-size:13.5px; line-height:1.45;
}
.notice.warn{background:var(--tint-orange); color:var(--orange-txt);}
.notice .ico{width:17px; height:17px; margin-top:1px; flex:0 0 auto;}
.rev-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 0; border-bottom:1px solid var(--separator);
}
.rev-row:last-child{border-bottom:0;}
.rev-row-val{font-weight:600; text-align:right; letter-spacing:-.012em; white-space:nowrap;}
.rev-bar{
  display:block; height:4px; margin-top:6px; border-radius:2px;
  background:var(--fill); overflow:hidden;
}
.rev-bar i{display:block; height:100%; border-radius:2px; background:var(--blue);}
.rev-bar.in i{background:var(--green);}
.rev-bar.out i{background:var(--red);}
.rev-trend{display:flex; flex-direction:column; gap:2px;}
.rev-trend-row{
  display:grid; grid-template-columns:62px 1fr minmax(84px, auto);
  align-items:center; gap:9px; padding:5px 5px; border-radius:var(--r-xs);
  cursor:pointer; font-size:12.5px;
  transition:background var(--t-fast) var(--ease);
}
.rev-trend-row:hover{background:var(--fill-2);}
.rev-trend-row.on{background:var(--tint-blue);}
.rev-trend-m{color:var(--label-2); font-variant-numeric:tabular-nums;}
.rev-trend-bars{display:flex; flex-direction:column; gap:3px;}
.rev-trend-bars .rev-bar{margin-top:0;}
.rev-trend-v{text-align:right; font-weight:600; font-variant-numeric:tabular-nums;}
.rev-legend{display:flex; align-items:center; gap:6px; margin-top:10px; font-size:11.5px; color:var(--label-3);}
.rev-key{width:9px; height:9px; border-radius:2.5px; display:inline-block;}
.rev-key.in{background:var(--green);}
.rev-key.out{background:var(--red); margin-left:10px;}
