/* ==========================================================================
   Tunas Ceria — Administrasi PAUD & TK
   ========================================================================== */

:root {
  --bg: #f5f2e9;
  --bg-deep: #eeeadf;
  --surface: #fffdf8;
  --surface-2: #f2f0e7;
  --surface-3: #eae7dc;
  --ink: #15342b;
  --ink-2: #2d4a41;
  --muted: #75827c;
  --muted-2: #98a29d;
  --line: #e2ded2;
  --line-strong: #d2ccbd;
  --forest: #103f33;
  --forest-2: #185643;
  --forest-3: #2e745a;
  --mint: #dcefe4;
  --mint-2: #eef7f0;
  --amber: #e7a23d;
  --amber-2: #c6821e;
  --amber-soft: #fbf0da;
  --coral: #d16d4b;
  --coral-soft: #f9e7df;
  --blue: #4b7b98;
  --blue-soft: #e6eff4;
  --danger: #b84b42;
  --danger-soft: #fbe9e6;
  --shadow-sm: 0 1px 2px rgba(24, 48, 39, 0.04), 0 5px 16px rgba(24, 48, 39, 0.035);
  --shadow-md: 0 10px 30px rgba(25, 50, 40, 0.08);
  --shadow-lg: 0 24px 70px rgba(18, 45, 35, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sidebar-w: 266px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1000px 540px at 95% -10%, rgba(231, 162, 61, 0.11), transparent 58%),
    radial-gradient(900px 500px at 10% 110%, rgba(46, 116, 90, 0.08), transparent 60%),
    var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(46, 116, 90, 0.22); }
:focus-visible { outline: 3px solid rgba(46, 116, 90, 0.3); outline-offset: 2px; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-green { color: var(--forest-3); }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Login
   ========================================================================== */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr);
  background: var(--bg);
}
.login-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 52px 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f7f3e7;
  background:
    radial-gradient(700px 480px at 78% 25%, rgba(95, 156, 119, 0.32), transparent 62%),
    radial-gradient(600px 530px at 5% 105%, rgba(231, 162, 61, 0.18), transparent 55%),
    #0e3a2f;
}
.login-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: radial-gradient(rgba(255, 255, 255, 0.32) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(135deg, transparent 20%, #000 80%);
  pointer-events: none;
}
.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
}
.login-brand .brand-mark { width: 50px; height: 50px; background: #f4e8c9; color: var(--forest); }
.login-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.login-brand span { display: block; color: rgba(246, 243, 232, 0.62); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; margin-top: 2px; }
.login-hero { position: relative; z-index: 2; max-width: 590px; margin: 7vh 0 5vh; }
.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  padding: 7px 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d9e6da;
}
.login-kicker .dot { width: 6px; height: 6px; border-radius: 99px; background: #e8b45a; box-shadow: 0 0 0 3px rgba(232, 180, 90, 0.17); }
.login-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.03;
  font-weight: 500;
  letter-spacing: -1.8px;
  margin: 24px 0 20px;
}
.login-hero h1 em { font-style: italic; color: #eac47c; }
.login-hero p { color: rgba(246, 243, 232, 0.72); font-size: 16px; line-height: 1.65; max-width: 480px; }
.login-features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.login-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 10px;
  padding: 8px 11px;
  color: rgba(245, 242, 232, 0.78);
  font-size: 12px;
}
.login-feature svg { color: #e7b25b; }
.login-art {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1;
}
.login-art::before {
  content: "";
  position: absolute;
  inset: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.login-art::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 280px;
  left: 120px;
  top: 70px;
  border-radius: 100% 0 100% 0;
  transform: rotate(28deg);
  background: linear-gradient(150deg, rgba(231, 178, 91, 0.24), rgba(103, 164, 124, 0.2));
  filter: blur(1px);
}
.login-foot { position: relative; z-index: 2; color: rgba(246, 243, 232, 0.43); font-size: 11px; display: flex; gap: 20px; align-items: center; }
.login-foot .sep { width: 22px; height: 1px; background: rgba(255, 255, 255, 0.2); }

.login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px clamp(28px, 6vw, 86px);
  background:
    radial-gradient(600px 360px at 100% 0%, rgba(231, 162, 61, 0.1), transparent 60%),
    var(--surface);
}
.login-box { width: 100%; max-width: 414px; }
.login-box .eyebrow { color: var(--amber-2); }
.login-box h2 {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -1px;
  font-weight: 500;
  margin: 11px 0 8px;
}
.login-box .login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .input-wrap { position: relative; }
.login-form .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.login-form .input { height: 50px; padding-left: 43px; border-radius: 11px; background: #fffefa; }
.login-form .input:focus { background: #fff; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 8px;
}
.password-toggle:hover { background: var(--surface-2); color: var(--ink); }
.login-submit { height: 50px; border-radius: 11px; font-size: 14px; margin-top: 4px; }
.login-error {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--danger-soft); color: #8e362f; border: 1px solid #f0ccc6;
  padding: 10px 12px; border-radius: 9px; font-size: 12.5px;
}
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; margin: 27px 0 15px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.demo-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.demo-title span { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.demo-title small { font-size: 10.5px; color: var(--muted-2); }
.demo-accounts { display: grid; gap: 7px; }
.demo-account {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 11px; border: 1px solid var(--line); background: #fffefa;
  border-radius: 10px; text-align: left; transition: 0.16s ease;
}
.demo-account:hover { border-color: #b9ccbe; background: #f8fbf7; transform: translateY(-1px); }
.demo-account .avatar { width: 32px; height: 32px; font-size: 11px; }
.demo-account .demo-copy { flex: 1; min-width: 0; }
.demo-account strong { display: block; font-size: 12px; font-weight: 650; }
.demo-account span { display: block; color: var(--muted); font-size: 10.5px; }
.demo-account code { font: 10px ui-monospace, "Cascadia Code", monospace; color: var(--muted); background: var(--surface-2); padding: 3px 6px; border-radius: 5px; }
.login-note { margin-top: 22px; display: flex; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.login-note svg { flex: 0 0 auto; color: var(--amber-2); margin-top: 1px; }
.login-mobile-brand { display: none; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background:
    radial-gradient(420px 300px at 10% 0%, rgba(88, 145, 108, 0.24), transparent 65%),
    linear-gradient(180deg, #103d31 0%, #0d352b 100%);
  color: #eef2e9;
  display: flex;
  flex-direction: column;
  z-index: 60;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 0.7px, transparent 0.7px);
  background-size: 20px 20px;
  opacity: 0.12;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000, transparent 36%);
}
.sidebar-top { position: relative; z-index: 1; padding: 24px 19px 15px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: #efe1be; color: #164334;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { min-width: 0; }
.brand-copy strong {
  display: block; font-family: var(--serif); font-size: 19px; font-weight: 600;
  line-height: 1.1; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-copy span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(238, 242, 233, 0.5); margin-top: 4px; }
.sidebar-year {
  margin-top: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: rgba(238, 242, 233, 0.72);
}
.sidebar-year strong { color: #f1e9d5; font-weight: 600; }
.sidebar-year svg { color: #e5b35e; }
.sidebar-nav { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 5px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.17); border-radius: 9px; }
.nav-group { margin-top: 18px; }
.nav-group:first-child { margin-top: 5px; }
.nav-label { padding: 0 11px 7px; color: rgba(238, 242, 233, 0.34); font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 39px; padding: 8px 11px; margin: 2px 0;
  border-radius: 9px; color: rgba(238, 242, 233, 0.7);
  font-size: 12.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item svg { color: rgba(238, 242, 233, 0.5); flex: 0 0 auto; transition: color 0.15s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.055); color: #fff; }
.nav-item:hover svg { color: rgba(255, 255, 255, 0.82); }
.nav-item.active {
  background: #f3ead4; color: #173e32; font-weight: 650;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
}
.nav-item.active svg { color: #1d5b46; }
.nav-item .nav-badge {
  margin-left: auto; min-width: 19px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: rgba(255, 255, 255, 0.13); color: #f4e9d2;
  font-size: 9.5px; font-weight: 700;
}
.nav-item.active .nav-badge { background: rgba(19, 63, 50, 0.12); color: #204b3d; }
.nav-item .nav-soon { margin-left: auto; font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(238, 242, 233, 0.35); }
.sidebar-foot { position: relative; z-index: 1; padding: 13px 13px 16px; border-top: 1px solid rgba(255, 255, 255, 0.075); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 9px; border-radius: 10px; transition: background 0.15s;
}
.user-card:hover { background: rgba(255, 255, 255, 0.055); }
.user-card .user-copy { flex: 1; min-width: 0; }
.user-card strong { display: block; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card span { display: block; color: rgba(238, 242, 233, 0.45); font-size: 9.5px; margin-top: 1px; }
.user-card svg { color: rgba(238, 242, 233, 0.35); }
.avatar {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 50%;
  background: #dcefe4; color: #1b5946;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(24, 75, 59, 0.06);
}
.avatar.tone-1 { background: #f3e5c7; color: #7d5b1a; }
.avatar.tone-2 { background: #e4eaf5; color: #3c587e; }
.avatar.tone-3 { background: #f5e2d9; color: #8c4b34; }
.avatar.tone-4 { background: #e9e2f3; color: #5e477c; }
.avatar.tone-5 { background: #dfeee9; color: #286454; }
.avatar.sm { width: 30px; height: 30px; font-size: 10px; }
.avatar.lg { width: 58px; height: 58px; font-size: 18px; }
.sidebar-avatar { background: #e9dfc7; color: #264a3d; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 70px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(18px, 3vw, 38px);
  border-bottom: 1px solid rgba(213, 207, 193, 0.75);
  background: rgba(247, 244, 236, 0.82);
  backdrop-filter: blur(18px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left .crumb { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.topbar-left .crumb strong { color: var(--ink-2); font-weight: 600; }
.topbar-left .crumb svg { color: var(--muted-2); }
.topbar-title { font-size: 14px; font-weight: 650; color: var(--ink); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.top-date { color: var(--muted); font-size: 11.5px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.top-date svg { color: var(--muted-2); }
.icon-btn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-grid; place-items: center; transition: 0.15s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.menu-btn { display: none; }
.wa-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--ink-2);
  font-size: 10.5px; font-weight: 600; white-space: nowrap;
  transition: 0.15s;
}
.wa-pill:hover { border-color: #b9ccbe; }
.wa-dot { width: 7px; height: 7px; border-radius: 50%; background: #c5cbc7; box-shadow: 0 0 0 3px rgba(120, 130, 125, 0.08); }
.wa-pill.connected .wa-dot { background: #3b9b68; box-shadow: 0 0 0 3px rgba(59, 155, 104, 0.12); }
.wa-pill.sim .wa-dot { background: #d79a3d; box-shadow: 0 0 0 3px rgba(215, 154, 61, 0.14); }
.wa-pill .wa-label { color: var(--muted); font-weight: 500; }
.avatar-btn { border: 0; background: transparent; padding: 0; border-radius: 50%; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px rgba(16, 63, 51, 0.1); }

.page { width: 100%; max-width: 1460px; margin: 0 auto; padding: 30px clamp(18px, 3vw, 38px) 60px; animation: pageIn 0.3s ease both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head-copy { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--amber-2); font-size: 9.5px; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow .line { width: 18px; height: 1px; background: currentColor; opacity: 0.5; }
.page-title { font-family: var(--serif); font-size: clamp(27px, 3vw, 38px); line-height: 1.08; font-weight: 500; letter-spacing: -0.8px; margin-top: 8px; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-head + .toolbar { margin-top: 0; }

/* ==========================================================================
   Buttons & controls
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 9px;
  font-size: 12px; font-weight: 650; line-height: 1;
  white-space: nowrap; transition: 0.16s ease;
  user-select: none;
}
.btn svg { flex: 0 0 auto; }
.btn:disabled { opacity: 0.52; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--forest); color: #f8f4e8; box-shadow: 0 3px 9px rgba(16, 63, 51, 0.15); }
.btn-primary:hover:not(:disabled) { background: #0c3329; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(16, 63, 51, 0.2); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { border-color: #b5c5ba; background: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: rgba(16, 63, 51, 0.06); }
.btn-amber { background: #e6a23c; color: #3f2a08; }
.btn-amber:hover:not(:disabled) { background: #d8952e; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a03c34; }
.btn-danger-soft { background: var(--danger-soft); color: #963b33; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 11px; border-radius: 7px; }
.btn-xs { height: 27px; padding: 0 8px; font-size: 10px; border-radius: 6px; gap: 5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.btn-icon.btn-sm { width: 29px; height: 29px; }
.btn-icon.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-icon.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn .spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.32); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.btn-secondary .spinner, .btn-ghost .spinner { border-color: rgba(21,52,43,.2); border-top-color: var(--ink); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fffefa;
  color: var(--ink);
  font-size: 12.5px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.textarea { height: auto; min-height: 82px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: #a7aea9; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: #6f9c83; box-shadow: 0 0 0 3px rgba(46, 116, 90, 0.11); background: #fff; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2375827c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.select-sm, .input-sm { height: 34px; font-size: 11.5px; border-radius: 8px; }
.input-group { position: relative; }
.input-group .prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted); pointer-events: none;
}
.input-group .input { padding-left: 37px; }
.input-group .suffix {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--muted); background: var(--surface-2); border-radius: 5px; padding: 3px 6px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.span-full { grid-column: 1 / -1; }
.form-field > label { font-size: 11px; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.form-field > label .required { color: var(--coral); }
.form-hint { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.form-error {
  display: none; align-items: flex-start; gap: 7px; padding: 8px 10px;
  border: 1px solid #efcbc5; border-radius: 7px;
  background: var(--danger-soft); color: #8c362f; font-size: 11px;
}
.form-error.visible { display: flex; }
.form-section { padding-top: 4px; }
.form-section + .form-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.form-section-title { font-size: 11px; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fdfbf5; }
.checkbox-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--forest-2); margin-top: 1px; }
.checkbox-row .check-copy { flex: 1; }
.checkbox-row strong { display: block; font-size: 11.5px; font-weight: 650; }
.checkbox-row span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; line-height: 1.4; }
.radio-cards { display: grid; gap: 8px; }
.radio-card {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; cursor: pointer;
  transition: 0.15s;
}
.radio-card:hover { border-color: #b9cbbf; }
.radio-card:has(input:checked) { border-color: #8db49b; background: #f3faf4; box-shadow: 0 0 0 1px #8db49b inset; }
.radio-card input { margin-top: 2px; accent-color: var(--forest-2); }
.radio-card strong { display: block; font-size: 12px; }
.radio-card span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-copy strong { display: block; font-size: 12px; font-weight: 650; }
.switch-copy span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; line-height: 1.4; }
.switch { position: relative; width: 40px; height: 23px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cfd5d0; border-radius: 99px; transition: 0.2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch input:checked + .slider { background: var(--forest-3); }
.switch input:checked + .slider::before { transform: translateX(17px); }

/* ==========================================================================
   Cards, badges, tables
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 20px 0; }
.card-title { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.1px; }
.card-sub { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.card-body { padding: 18px 20px 20px; }
.card-link { color: var(--forest-3); font-size: 10.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-link:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.card-pad { padding: 20px; }
.card-dark {
  background:
    radial-gradient(300px 220px at 100% 0%, rgba(93, 153, 111, 0.2), transparent 65%),
    var(--forest);
  color: #f5f1e4; border-color: transparent;
}
.card-dark .card-title { color: #f5f1e4; }
.card-dark .card-sub { color: rgba(245, 241, 228, 0.55); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 22px; padding: 2px 8px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted);
  font-size: 9.5px; font-weight: 650; letter-spacing: 0.01em; white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--mint); color: #1a6248; }
.badge-amber { background: var(--amber-soft); color: #8b5a14; }
.badge-red { background: var(--danger-soft); color: #963b33; }
.badge-blue { background: var(--blue-soft); color: #3c6580; }
.badge-coral { background: var(--coral-soft); color: #97503a; }
.badge-gray { background: var(--surface-2); color: #68756f; }
.badge-dark { background: rgba(255,255,255,.1); color: #f0e7d5; }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 9px; font-size: 9.5px; font-weight: 650; }
.pill-light { background: rgba(255,255,255,.13); color: #f3ead9; border: 1px solid rgba(255,255,255,.14); }
.pill-mint { background: var(--mint); color: #1a6248; }
.pill-amber { background: var(--amber-soft); color: #8b5a14; }

.table-wrap { width: 100%; overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.table th {
  text-align: left; padding: 9px 14px; background: #f5f3eb;
  color: #83908a; font-size: 8.8px; font-weight: 750;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 14px; border-bottom: 1px solid #eeebe1; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: #fbfaf4; }
.table tbody tr[data-clickable] { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 3px; }
.table-empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-copy { min-width: 0; }
.cell-copy strong { display: block; font-size: 11.5px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.cell-copy span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.money { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.15px; }
.money.negative { color: #a9503a; }
.money.positive { color: #226b50; }
.money.muted { color: var(--muted); font-weight: 500; }
.text-right { text-align: right; }
.stack-xs > * + * { margin-top: 3px; }
.progress { height: 5px; border-radius: 99px; background: #eceae0; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--forest-3); }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); color: #9aa59f; margin-bottom: 13px; }
.empty strong { color: var(--ink-2); font-size: 13px; }
.empty p { font-size: 11px; max-width: 320px; margin-top: 4px; line-height: 1.5; }
.empty .btn { margin-top: 14px; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.welcome-panel {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 27px 28px;
  color: #f7f1e3;
  background:
    radial-gradient(400px 300px at 87% 8%, rgba(232, 180, 90, 0.22), transparent 65%),
    radial-gradient(420px 290px at 70% 110%, rgba(104, 165, 122, 0.2), transparent 60%),
    #103c31;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  box-shadow: 0 18px 44px rgba(15, 55, 44, 0.16);
  margin-bottom: 18px;
}
.welcome-panel::before {
  content: ""; position: absolute; right: -45px; top: -90px;
  width: 320px; height: 320px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.welcome-panel::after {
  content: ""; position: absolute; right: 55px; bottom: -150px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.welcome-copy { position: relative; z-index: 2; min-width: 0; }
.welcome-copy h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(27px, 3vw, 37px); line-height: 1.08; letter-spacing: -0.7px; margin: 13px 0 8px; }
.welcome-copy h1 em { font-style: italic; color: #eac57e; }
.welcome-copy p { color: rgba(247, 241, 227, 0.63); font-size: 12px; max-width: 540px; line-height: 1.55; }
.welcome-actions { position: relative; z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.welcome-panel .btn-secondary { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.14); color: #f7f1e3; }
.welcome-panel .btn-secondary:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.22); }
.welcome-panel .btn-amber { background: #e9b45b; color: #3d2b0b; }
.welcome-panel .btn-amber:hover { background: #f0c271; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  padding: 15px 16px 14px; box-shadow: var(--shadow-sm);
  transition: transform 0.16s, box-shadow 0.16s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--mint); color: var(--forest-3); }
.stat-icon.amber { background: var(--amber-soft); color: #a56a14; }
.stat-icon.coral { background: var(--coral-soft); color: #a05238; }
.stat-icon.blue { background: var(--blue-soft); color: #3d6c89; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 0.03em; margin-top: 12px; }
.stat-value { font-family: var(--serif); font-size: clamp(23px, 2.2vw, 30px); line-height: 1.1; font-weight: 600; letter-spacing: -0.7px; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value.small { font-size: 22px; }
.stat-meta { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--muted-2); font-size: 9.5px; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-size: 9px; font-weight: 700; border-radius: 5px; padding: 2px 5px; }
.trend.up { color: #1d6b4d; background: var(--mint); }
.trend.down { color: #9b4339; background: var(--danger-soft); }
.trend.flat { color: var(--muted); background: var(--surface-2); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.9fr); gap: 14px; margin-bottom: 14px; }
.dashboard-grid.equal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.chart-bars { display: flex; align-items: flex-end; gap: 11px; height: 190px; padding: 22px 2px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.chart-value { font-size: 8.5px; color: var(--muted); font-weight: 650; white-space: nowrap; opacity: .9; transition: 0.15s; }
.chart-col:hover .chart-value { opacity: 1; color: var(--ink-2); }
.chart-track { width: 100%; max-width: 46px; height: 132px; display: flex; align-items: flex-end; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, transparent, rgba(227, 226, 214, 0.38)); }
.chart-fill {
  width: 100%; min-height: 5px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #3f8064, #1c5a46);
  transition: height 0.7s cubic-bezier(.2,.8,.2,1);
}
.chart-col:nth-child(6) .chart-fill { background: linear-gradient(180deg, #e8b45b, #d8952e); }
.chart-col:hover .chart-fill { filter: brightness(1.07); }
.chart-label { color: var(--muted); font-size: 9.5px; font-weight: 550; }
.chart-label.current { color: var(--ink); font-weight: 700; }
.chart-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; color: var(--muted); font-size: 9.5px; }
.chart-legend { display: flex; align-items: center; gap: 14px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--forest-3); }
.chart-legend i.amber { background: var(--amber); }

.queue-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; }
.queue-main { display: flex; align-items: center; gap: 17px; margin: 16px 0 14px; }
.queue-ring {
  --pct: 68; width: 82px; height: 82px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(#e5b25d calc(var(--pct) * 1%), rgba(255,255,255,.1) 0);
}
.queue-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #143f34; }
.queue-ring-inner { position: relative; z-index: 1; text-align: center; }
.queue-ring-inner strong { display: block; font-family: var(--serif); font-size: 27px; line-height: 1; color: #f2e7d1; }
.queue-ring-inner span { display: block; font-size: 7.5px; text-transform: uppercase; letter-spacing: .12em; color: rgba(245,241,228,.5); margin-top: 3px; }
.queue-copy h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.1; color: #f7f1e3; }
.queue-copy p { color: rgba(247, 241, 227, 0.57); font-size: 10.5px; margin-top: 5px; line-height: 1.45; }
.queue-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 15px; }
.queue-actions { display: flex; gap: 6px; align-items: center; }
.queue-actions .btn { flex: 1; }
.queue-countdown { color: #e7bd77; font-weight: 700; font-variant-numeric: tabular-nums; }

.arrears-list { display: flex; flex-direction: column; }
.arrears-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #efede4; }
.arrears-row:last-child { border-bottom: 0; padding-bottom: 0; }
.arrears-row:first-child { padding-top: 0; }
.arrears-rank { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 9.5px; font-weight: 700; flex: 0 0 auto; }
.arrears-copy { flex: 1; min-width: 0; }
.arrears-copy strong { display: block; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrears-copy span { display: block; font-size: 9px; color: var(--muted); margin-top: 1px; }
.arrears-amount { font-size: 10.5px; font-weight: 700; color: #a24c39; white-space: nowrap; }
.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid #efede4; }
.activity-row:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-row:first-child { padding-top: 0; }
.activity-dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; background: var(--mint-2); color: var(--forest-3); margin-top: 1px; }
.activity-dot.amber { background: var(--amber-soft); color: #9c6818; }
.activity-dot.coral { background: var(--coral-soft); color: #9d5139; }
.activity-copy { min-width: 0; }
.activity-copy p { font-size: 10.5px; color: var(--ink-2); line-height: 1.4; }
.activity-copy span { display: block; font-size: 8.5px; color: var(--muted-2); margin-top: 2px; }
.activity-copy strong { font-weight: 650; }

/* ==========================================================================
   Toolbar / filters
   ========================================================================== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 15px; background: var(--surface); border: 1px solid var(--line);
  border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  flex-wrap: wrap;
}
.toolbar + .card, .toolbar + .table-card { border-radius: 0 0 var(--radius) var(--radius); }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.toolbar .search-field { width: 245px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.search-field .input { padding-left: 34px; height: 34px; font-size: 11.5px; }
.filter-count { font-size: 9.5px; color: var(--muted); margin-left: 3px; }

/* Pencarian murid pada pembayaran */
.qp-search-field { margin-top: 2px; }
.qp-search-field svg { left: 14px; color: var(--muted); }
.qp-search-field .input {
  height: 48px;
  padding-left: 42px;
  font-size: 14px;
  border-color: #b9ccbe;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 116, 90, 0.06);
}
.qp-search-field .input:focus { border-color: #6f9c83; box-shadow: 0 0 0 4px rgba(46, 116, 90, 0.12); }
.search-results {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefa;
  max-height: 322px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #efede4;
  background: transparent;
  text-align: left;
  transition: background 0.12s;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result.active { background: var(--mint-2); }
.search-result:focus-visible { outline: 2px solid var(--forest-3); outline-offset: -2px; }
.search-result-copy { flex: 1; min-width: 0; }
.search-result-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-copy span {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-amount { flex: 0 0 auto; text-align: right; }
.search-result-amount strong { display: block; font-size: 10.5px; color: #a24c39; font-variant-numeric: tabular-nums; }
.search-result-amount span { display: block; margin-top: 1px; font-size: 8.5px; color: var(--muted); }
.search-result-arrow { color: var(--muted-2); flex: 0 0 auto; }
.search-empty { padding: 30px 20px; text-align: center; color: var(--muted); }
.search-empty svg { margin: 0 auto 8px; color: var(--muted-2); }
.search-empty strong { display: block; font-size: 12px; color: var(--ink-2); }
.search-empty p { font-size: 10px; margin-top: 3px; line-height: 1.45; }
.selected-student {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #d5e6da;
  border-radius: 10px;
  background: var(--mint-2);
}
.selected-student .cell-main { min-width: 0; }
.invoice-choices { display: flex; flex-direction: column; gap: 7px; }
.invoice-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
  text-align: left;
  transition: 0.15s;
}
.invoice-choice:hover { border-color: #a9c4b2; background: #f8fcf8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(24, 48, 39, 0.06); }
.invoice-choice-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--mint-2); color: var(--forest-3); flex: 0 0 auto; }
.invoice-choice-copy { flex: 1; min-width: 130px; }
.invoice-choice-copy strong { display: block; font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-choice-copy span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-choice-status { flex: 0 0 auto; }
.invoice-choice-amount { flex: 0 0 auto; text-align: right; margin-left: auto; }
.invoice-choice-amount small { display: block; font-size: 7.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.invoice-choice-amount strong { display: block; font-size: 11px; color: #a24c39; font-variant-numeric: tabular-nums; margin-top: 1px; }
.invoice-choice-arrow { color: var(--muted-2); flex: 0 0 auto; }
.segmented {
  display: inline-flex; align-items: center; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.segment {
  border: 0; background: transparent; color: var(--muted);
  height: 27px; padding: 0 10px; border-radius: 6px;
  font-size: 10px; font-weight: 650; white-space: nowrap;
}
.segment.active { background: #fffdf8; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 45, 35, 0.08); }
.tab-strip { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-strip .tab {
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  padding: 10px 13px; color: var(--muted); font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.tab-strip .tab.active { border-bottom-color: var(--forest-3); color: var(--ink); }
.tab-strip .tab .count { font-size: 8.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; margin-left: 3px; }

/* ==========================================================================
   Classes
   ========================================================================== */
.class-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.class-card { overflow: hidden; transition: transform 0.16s, box-shadow 0.16s; }
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.class-band { height: 5px; background: linear-gradient(90deg, var(--forest-2), #62a47c); }
.class-band.amber { background: linear-gradient(90deg, #dc9c35, #edc06f); }
.class-band.blue { background: linear-gradient(90deg, #4b7894, #83a9bd); }
.class-band.coral { background: linear-gradient(90deg, #c86c4d, #e7a389); }
.class-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 15px 16px 0; }
.class-name { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.1; }
.class-level { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 650; margin-top: 4px; }
.class-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: var(--mint-2); color: var(--forest-3); }
.class-body { padding: 13px 16px 15px; }
.class-teacher { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.class-teacher strong { color: var(--ink-2); font-weight: 600; }
.class-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; }
.class-stat strong { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.class-stat span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.class-stat.alert strong { color: #a7553c; }
.class-actions { display: flex; gap: 5px; margin-top: 13px; }
.class-actions .btn { flex: 1; }

/* ==========================================================================
   Student drawer
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(13, 33, 27, 0.44);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.18s ease both;
}
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 81;
  width: min(590px, 94vw);
  background: var(--bg);
  box-shadow: -20px 0 70px rgba(15, 42, 32, 0.24);
  display: flex; flex-direction: column;
  animation: slideIn 0.24s cubic-bezier(.2,.75,.2,1) both;
}
.drawer-head {
  position: relative; flex: 0 0 auto;
  padding: 22px 24px 18px;
  background:
    radial-gradient(320px 200px at 100% 0%, rgba(232, 180, 90, 0.18), transparent 65%),
    var(--forest);
  color: #f7f1e3;
}
.drawer-head .drawer-close {
  position: absolute; top: 14px; right: 14px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); color: #f7f1e3;
  width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center;
}
.drawer-head .drawer-close:hover { background: rgba(255,255,255,.15); }
.drawer-identity { display: flex; gap: 13px; align-items: center; padding-right: 35px; }
.drawer-identity .avatar { width: 54px; height: 54px; font-size: 17px; background: #f1e6ce; color: #264a3c; }
.drawer-identity h2 { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.1; letter-spacing: -.4px; }
.drawer-identity p { color: rgba(247, 241, 227, 0.6); font-size: 10px; margin-top: 4px; }
.drawer-head .badge-outline { border-color: rgba(255,255,255,.22); color: rgba(247,241,227,.75); }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 15px; color: rgba(247,241,227,.65); font-size: 10px; }
.drawer-meta span { display: flex; align-items: center; gap: 5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 17px 20px 28px; }
.drawer-section { margin-bottom: 14px; }
.drawer-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 8px; }
.drawer-section-head h3 { font-size: 10px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.drawer-foot { flex: 0 0 auto; padding: 13px 20px; background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 7px; justify-content: flex-end; }
.drawer-foot .btn { flex: 1; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mini-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; }
.mini-stat span { display: block; font-size: 8.5px; color: var(--muted); font-weight: 600; }
.mini-stat strong { display: block; font-size: 13px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.mini-stat.alert strong { color: #a55139; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.kv span { display: block; font-size: 8.5px; color: var(--muted); }
.kv strong { display: block; font-size: 11px; font-weight: 600; margin-top: 2px; word-break: break-word; }
.kv.full { grid-column: 1 / -1; }
.mini-list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid #efede4; }
.mini-row:last-child { border-bottom: 0; }
.mini-row-copy { flex: 1; min-width: 0; }
.mini-row-copy strong { display: block; font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row-copy span { display: block; font-size: 8.8px; color: var(--muted); margin-top: 1px; }
.mini-row .money { font-size: 10px; }
.mini-row .badge { font-size: 8px; min-height: 19px; }
.timeline { position: relative; padding-left: 17px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 11px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -16px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface); border: 2px solid #94b5a1; }
.timeline-item strong { display: block; font-size: 10.5px; font-weight: 600; }
.timeline-item span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }

/* ==========================================================================
   WhatsApp
   ========================================================================== */
.wa-layout { display: grid; grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.55fr); gap: 14px; align-items: start; }
.connection-card { overflow: hidden; }
.connection-top { padding: 19px 20px 15px; background: var(--forest); color: #f6f1e3; position: relative; overflow: hidden; }
.connection-top::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); right: -65px; top: -70px; }
.connection-status { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 650; color: rgba(246,241,227,.75); }
.connection-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #9ba6a1; }
.connection-status.on .dot { background: #5fd38c; box-shadow: 0 0 0 3px rgba(95,211,140,.14); }
.connection-status.qr .dot { background: #e7b45b; box-shadow: 0 0 0 3px rgba(231,180,91,.15); }
.connection-top h2 { font-family: var(--serif); font-size: 25px; font-weight: 500; margin-top: 5px; }
.connection-top p { color: rgba(246,241,227,.58); font-size: 10.5px; margin-top: 4px; line-height: 1.5; }
.connection-number { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 7px 9px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; font-size: 10px; }
.connection-body { padding: 15px 18px 18px; }
.qr-box { border: 1px solid var(--line); border-radius: 11px; padding: 12px; text-align: center; background: #fff; margin-bottom: 12px; }
.qr-box img { width: 190px; height: 190px; margin: 0 auto; border-radius: 6px; }
.qr-box p { font-size: 9.5px; color: var(--muted); margin-top: 6px; }
.connection-actions { display: flex; flex-direction: column; gap: 6px; }
.connection-actions .btn { width: 100%; }
.connection-hint { display: flex; gap: 7px; font-size: 9.5px; color: var(--muted); line-height: 1.45; margin-top: 11px; }
.connection-hint svg { flex: 0 0 auto; color: var(--amber-2); margin-top: 1px; }
.queue-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.queue-stat { border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; background: #fffefa; }
.queue-stat span { display: block; font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.queue-stat strong { display: block; font-size: 17px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.queue-stat.amber strong { color: #a36b18; }
.queue-stat.red strong { color: #a64c3c; }
.queue-live { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; border: 1px dashed var(--line-strong); border-radius: 9px; background: #fcfaf3; font-size: 10px; color: var(--muted); margin-bottom: 12px; }
.queue-live strong { color: var(--ink-2); }
.wa-table-card { min-width: 0; }
.message-preview { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 10px; }
.wa-message-modal { background: #e8e2d7; border-radius: 13px; padding: 16px; }
.wa-bubble { background: #d9f3d2; border-radius: 10px 3px 10px 10px; padding: 11px 12px; max-width: 340px; margin-left: auto; font-size: 10.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-bubble-head { display: flex; justify-content: flex-end; gap: 5px; align-items: center; color: #4f7c56; font-size: 8px; margin: -3px -2px 5px; }
.wa-meta { text-align: right; color: #7d8c7c; font-size: 8px; margin-top: 4px; }

/* ==========================================================================
   Reports
   ========================================================================== */
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.report-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; box-shadow: var(--shadow-sm); }
.report-stat span { display: block; font-size: 9px; font-weight: 600; color: var(--muted); }
.report-stat strong { display: block; font-family: var(--serif); font-size: 23px; line-height: 1.1; margin-top: 4px; font-weight: 600; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.report-stat small { display: block; color: var(--muted-2); font-size: 8.5px; margin-top: 4px; }
.report-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 14px; align-items: start; }
.parent-group-list { display: flex; flex-direction: column; }
.parent-group { border-bottom: 1px solid #efede4; padding: 11px 0; }
.parent-group:last-child { border-bottom: 0; padding-bottom: 0; }
.parent-group:first-child { padding-top: 0; }
.parent-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.parent-group-head strong { font-size: 11px; font-weight: 650; }
.parent-group-head .money { font-size: 10px; color: #a24c39; }
.parent-group p { font-size: 9px; color: var(--muted); margin-top: 2px; }
.report-preview-card { position: sticky; top: 86px; }
.wa-preview { background: #e8e2d6; border-radius: 12px; padding: 12px; max-height: 360px; overflow-y: auto; }
.wa-preview .wa-bubble { max-width: 100%; font-size: 9.5px; }
.wa-preview .wa-bubble strong { font-weight: 700; }

/* ==========================================================================
   Promotion
   ========================================================================== */
.promo-steps { display: flex; gap: 0; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.promo-step { flex: 1; display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-right: 1px solid var(--line); }
.promo-step:last-child { border-right: 0; }
.promo-step .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 700; flex: 0 0 auto; }
.promo-step strong { display: block; font-size: 10.5px; font-weight: 650; }
.promo-step span { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.promo-step.active .num { background: var(--forest); color: #f4eddc; }
.promo-step.done .num { background: var(--mint); color: var(--forest-3); }
.promo-panel { padding: 20px; }
.promo-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.promo-note { display: flex; gap: 9px; background: var(--amber-soft); border: 1px solid #eddcbd; border-radius: 9px; padding: 10px 12px; font-size: 10.5px; color: #79551f; line-height: 1.45; }
.promo-note svg { flex: 0 0 auto; margin-top: 1px; }
.promo-table select { min-width: 135px; height: 31px; font-size: 10.5px; }
.promo-table .select { height: 31px; }
.promo-table td { padding: 8px 10px; }
.promo-table th { padding: 8px 10px; }
.promo-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 0; margin-top: 14px; border-top: 1px solid var(--line); }
.promo-summary { display: flex; gap: 13px; color: var(--muted); font-size: 10px; flex-wrap: wrap; }
.promo-summary strong { color: var(--ink-2); }

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); gap: 14px; align-items: start; }
.settings-stack { display: flex; flex-direction: column; gap: 14px; }
.settings-card-head { display: flex; align-items: flex-start; gap: 11px; padding: 18px 20px 0; }
.settings-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--mint-2); color: var(--forest-3); flex: 0 0 auto; }
.settings-icon.amber { background: var(--amber-soft); color: #9e6918; }
.settings-icon.blue { background: var(--blue-soft); color: #3c6883; }
.settings-icon.coral { background: var(--coral-soft); color: #9d523a; }
.settings-card-head .card-title { margin-top: 2px; }
.settings-form { padding: 16px 20px 20px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.profile-card { text-align: center; padding: 22px 18px; }
.profile-card .avatar { margin: 0 auto 10px; width: 58px; height: 58px; font-size: 18px; }
.profile-card h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.profile-card p { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.profile-links { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; }
.profile-link { display: flex; align-items: center; gap: 8px; padding: 8px 4px; font-size: 10.5px; color: var(--ink-2); border: 0; background: transparent; text-align: left; border-radius: 6px; }
.profile-link:hover { background: var(--surface-2); }
.profile-link.danger { color: var(--danger); }
.activity-log { display: flex; flex-direction: column; }
.log-row { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f0eee6; }
.log-row:last-child { border-bottom: 0; padding-bottom: 0; }
.log-row .dot { width: 5px; height: 5px; border-radius: 50%; background: #a8b6ae; margin-top: 7px; flex: 0 0 auto; }
.log-row p { font-size: 9.5px; color: var(--ink-2); line-height: 1.4; }
.log-row span { display: block; color: var(--muted-2); font-size: 8px; margin-top: 1px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; padding-bottom: 0; }
.user-row:first-child { padding-top: 0; }
.user-row .cell-copy { flex: 1; }
.user-actions { display: flex; gap: 4px; }

/* ==========================================================================
   Fee list
   ========================================================================== */
.fee-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fee-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fffefa; }
.fee-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.fee-name { font-size: 12px; font-weight: 650; }
.fee-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.fee-amount { font-family: var(--serif); font-size: 19px; font-weight: 600; margin-top: 9px; letter-spacing: -.3px; }
.fee-desc { font-size: 9px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.fee-actions { display: flex; gap: 3px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.fee-actions .btn { flex: 1; }

/* ==========================================================================
   Modal / dialog
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(12, 31, 25, 0.48);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.16s ease both;
}
.modal {
  width: min(520px, 100%);
  max-height: min(90vh, 900px);
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 19px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(.2,.8,.2,1) both;
  overflow: hidden;
}
.modal.modal-lg { width: min(720px, 100%); }
.modal.modal-xl { width: min(930px, 100%); }
.modal.modal-sm { width: min(400px, 100%); }
.modal-head { flex: 0 0 auto; padding: 19px 21px 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-title { font-family: var(--serif); font-size: 23px; line-height: 1.15; font-weight: 600; letter-spacing: -.4px; }
.modal-sub { color: var(--muted); font-size: 10.5px; margin-top: 4px; line-height: 1.45; }
.modal-close { border: 0; background: transparent; color: var(--muted); width: 31px; height: 31px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { flex: 1; overflow-y: auto; padding: 5px 21px 20px; }
.modal-foot { flex: 0 0 auto; padding: 13px 21px; background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.modal-foot .btn { min-width: 92px; }
.modal-foot.split { justify-content: space-between; }
.form-note { font-size: 10px; color: var(--muted); line-height: 1.5; }
.modal-summary-top { background: var(--mint-2); border: 1px solid #d8e9dc; border-radius: 11px; padding: 12px 13px; margin-bottom: 15px; }
.modal-summary-top .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.modal-summary-top strong { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.modal-summary-top span { color: var(--muted); font-size: 9.5px; }
.payment-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 15px; }
.payment-breakdown > div { border: 1px solid var(--line); background: #fffefa; border-radius: 8px; padding: 7px 9px; }
.payment-breakdown span { display: block; font-size: 8px; color: var(--muted); }
.payment-breakdown strong { display: block; font-size: 11.5px; margin-top: 2px; font-weight: 700; font-variant-numeric: tabular-nums; }
.discount-callout {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #eccfc2;
  border-radius: 8px;
  background: var(--coral-soft);
  color: #8b4532;
}
.discount-callout svg { flex: 0 0 auto; margin-top: 1px; color: #a55339; }
.discount-callout strong { display: block; font-size: 10.5px; font-weight: 700; }
.discount-callout span { display: block; margin-top: 2px; font-size: 9.5px; line-height: 1.4; color: #96604f; }
.payment-success { text-align: center; padding: 8px 6px 5px; }
.success-mark { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 13px; background: var(--mint); color: var(--forest-3); box-shadow: 0 0 0 9px rgba(220, 239, 228, 0.35); }
.payment-success h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.4px; }
.payment-success .success-amount { font-family: var(--serif); font-size: 34px; font-weight: 600; margin: 5px 0 2px; letter-spacing: -.8px; }
.payment-success p { color: var(--muted); font-size: 10.5px; }
.receipt-box { margin: 16px 0; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 11px 13px; background: #fffefa; text-align: left; }
.receipt-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 10.5px; }
.receipt-row span { color: var(--muted); }
.receipt-row strong { font-weight: 650; text-align: right; }
.wa-queued { display: flex; align-items: flex-start; gap: 8px; background: var(--mint-2); border: 1px solid #d7e9dc; border-radius: 8px; padding: 9px 10px; text-align: left; font-size: 9.5px; color: #38614e; line-height: 1.45; margin-top: 12px; }
.wa-queued svg { flex: 0 0 auto; color: var(--forest-3); margin-top: 1px; }
.print-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.print-actions.single { grid-template-columns: 1fr; }
.print-actions .btn { padding: 0 9px; font-size: 10.5px; }
.print-default-note { margin-top: 8px; text-align: center; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.print-default-note strong { color: var(--ink-2); font-weight: 650; }
.print-profile-saved {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding: 8px 10px;
  border: 1px solid #d5e6da;
  border-radius: 8px;
  background: var(--mint-2);
  color: #2e5d49;
  font-size: 10px;
  line-height: 1.4;
}
.print-profile-saved svg { flex: 0 0 auto; color: var(--forest-3); }
.print-profile-saved strong { font-weight: 700; }
.print-profile-saved.saved-flash { animation: savedFlash 0.7s ease; }
@keyframes savedFlash {
  0% { background: #d2efdb; border-color: #8fc5a2; }
  100% { background: var(--mint-2); border-color: #d5e6da; }
}
.confirm-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--amber-soft); color: #9a6416; margin-bottom: 12px; }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-text { color: var(--muted); font-size: 12px; line-height: 1.6; }
.confirm-text strong { color: var(--ink); }
.confirm-list { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; font-size: 10.5px; }
.confirm-list div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.confirm-list span { color: var(--muted); }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 12px; border-radius: 10px;
  background: #173e32; color: #f5f1e5;
  box-shadow: 0 12px 36px rgba(14, 42, 32, 0.24);
  font-size: 11px; line-height: 1.45;
  animation: toastIn 0.22s ease both; pointer-events: auto;
}
.toast .toast-icon { color: #8dd4a8; flex: 0 0 auto; margin-top: 1px; }
.toast.error { background: #7d302a; }
.toast.error .toast-icon { color: #f0b1a9; }
.toast.warning { background: #5e461d; }
.toast.warning .toast-icon { color: #f0c876; }
.toast .toast-body { flex: 1; }
.toast strong { display: block; font-weight: 650; }
.toast button { border: 0; background: transparent; color: rgba(255,255,255,.6); padding: 2px; flex: 0 0 auto; }
.toast.out { animation: toastOut 0.2s ease both; }

/* ==========================================================================
   Loading / skeleton
   ========================================================================== */
.app-loading { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.loading-brand { text-align: center; }
.loading-mark { width: 54px; height: 54px; border-radius: 16px; background: var(--forest); color: #f1e5c8; display: grid; place-items: center; margin: 0 auto 13px; animation: pulse 1.6s ease-in-out infinite; }
.loading-title { font-family: var(--serif); font-size: 24px; color: var(--ink-2); }
.loading-sub { color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.skeleton { position: relative; overflow: hidden; background: #eae7dc; border-radius: 7px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: shimmer 1.3s infinite; }
.skeleton-card { height: 102px; border-radius: 15px; }
.skeleton-line { height: 11px; margin: 8px 0; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-table { padding: 20px; }
.skeleton-row { height: 40px; border-bottom: 1px solid #efede4; display: flex; gap: 15px; align-items: center; }
.loading-block { padding: 55px 20px; text-align: center; color: var(--muted); font-size: 11px; }
.loading-block .spinner { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--forest-3); margin: 0 auto 10px; animation: spin .75s linear infinite; }

/* ==========================================================================
   Misc
   ========================================================================== */
.info-banner {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border: 1px solid #e9dcc2; border-radius: 9px;
  background: var(--amber-soft); color: #74501d; font-size: 10.5px; line-height: 1.5;
  margin-bottom: 14px;
}
.info-banner svg { flex: 0 0 auto; color: #a3711e; margin-top: 1px; }
.info-banner.green { background: var(--mint-2); border-color: #d2e6d9; color: #2e5d49; }
.info-banner.green svg { color: var(--forest-3); }
.info-banner.blue { background: var(--blue-soft); border-color: #d2e2ec; color: #355e77; }
.info-banner.blue svg { color: var(--blue); }
.info-banner.danger { background: var(--danger-soft); border-color: #efcbc5; color: #8a362f; }
.info-banner.danger svg { color: var(--danger); }
.info-banner strong { font-weight: 700; }
.mini-divider { height: 1px; background: var(--line); margin: 13px 0; }
.link { color: var(--forest-3); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 10px; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.span-2 { grid-column: span 2; }
.divider { height: 1px; background: var(--line); }
.mobile-only { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1220px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .85fr); }
  .top-date { display: none; }
}
@media (max-width: 1040px) {
  .wa-layout { grid-template-columns: 1fr; }
  .report-layout { grid-template-columns: 1fr; }
  .report-preview-card { position: static; }
  .settings-layout { grid-template-columns: 1fr; }
  .dashboard-grid, .dashboard-grid.equal { grid-template-columns: 1fr; }
  .queue-card { min-height: 0; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 266px; }
  .sidebar { transform: translateX(-105%); transition: transform .24s cubic-bezier(.2,.8,.2,1); box-shadow: 20px 0 60px rgba(8,25,20,.25); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(12, 31, 25, 0.45); backdrop-filter: blur(2px); display: none; }
  .sidebar-backdrop.open { display: block; animation: fadeIn .18s ease both; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .login-screen { grid-template-columns: 1fr; }
  .login-stage { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 24px; align-items: center; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; }
  .login-mobile-brand .brand-mark { background: var(--forest); color: #f1e5c8; width: 40px; height: 40px; }
  .login-mobile-brand strong { font-family: var(--serif); font-size: 19px; }
  .login-mobile-brand span { display: block; font-size: 8px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
}
@media (max-width: 760px) {
  .page { padding: 20px 14px 45px; }
  .topbar { padding: 0 14px; height: 62px; }
  .topbar-left .crumb { display: none; }
  .topbar-title { font-size: 12.5px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 13px; margin-bottom: 17px; }
  .page-actions { justify-content: flex-start; }
  .page-title { font-size: 29px; }
  .welcome-panel { padding: 21px 20px; flex-direction: column; align-items: flex-start; gap: 18px; }
  .welcome-actions { justify-content: flex-start; }
  .stat-grid { gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 9px; }
  .class-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .promo-setup { grid-template-columns: 1fr; }
  .fee-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .report-summary { gap: 8px; }
  .report-stat { padding: 11px; }
  .report-stat strong { font-size: 19px; }
  .summary-grid { gap: 6px; }
  .mini-stat { padding: 8px; }
  .mini-stat strong { font-size: 11.5px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; border: 0; }
  .modal-head { padding: 17px 17px 11px; }
  .modal-body { padding: 4px 17px 17px; }
  .modal-foot { padding: 11px 17px calc(11px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; min-width: 0; }
  .drawer { width: 100%; }
  .drawer-head { padding: 19px 17px 15px; }
  .drawer-body { padding: 14px 14px 22px; }
  .drawer-foot { padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); }
  .toolbar { padding: 10px 12px; }
  .toolbar .search-field { width: 100%; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-right .select { flex: 1; }
  .promo-steps { flex-direction: column; }
  .promo-step { border-right: 0; border-bottom: 1px solid var(--line); }
  .promo-step:last-child { border-bottom: 0; }
  .promo-footer { flex-direction: column; align-items: stretch; }
  .promo-footer .btn { width: 100%; }
  .print-actions { grid-template-columns: 1fr; }
  .topbar .wa-pill { height: 28px; padding: 0 8px; font-size: 9.5px; }
  .login-box h2 { font-size: 32px; }
  .invoice-choice {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 4px 9px;
    align-items: center;
  }
  .invoice-choice-icon { grid-row: 1 / 3; }
  .invoice-choice-copy { grid-column: 2; grid-row: 1; min-width: 0; }
  .invoice-choice-status { grid-column: 2; grid-row: 2; justify-self: start; }
  .invoice-choice-amount { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .invoice-choice-arrow { display: none; }
  .search-result-arrow { display: none; }
  .search-result-amount strong { font-size: 10px; }
  .login-mobile-brand { margin-bottom: 28px; }
  .mobile-only { display: initial; }
  .desktop-only { display: none !important; }
  .toast-stack { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
  .page-actions .btn { flex: 1; }
  .payment-breakdown { grid-template-columns: 1fr 1fr; }
  .drawer-identity h2 { font-size: 22px; }
  .btn { padding: 0 11px; }
  .topbar-right { gap: 5px; }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: .85; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Pembayaran gabungan */
.batch-bills {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 310px;
  overflow: auto;
  padding-right: 2px;
}
.batch-bill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.batch-bill:hover { border-color: var(--line-strong, #c9d3cb); }
.batch-bill.selected { border-color: #8bbfa2; background: #f2faf5; }
.batch-bill input[type="checkbox"] { width: 17px; height: 17px; accent-color: #1f6b4e; }
.batch-bill-copy { min-width: 0; }
.batch-bill-copy strong { display: block; font-size: 12px; color: var(--ink); }
.batch-bill-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.batch-bill-copy .badge { display: inline-block; margin-left: 4px; }
.batch-bill-amount { text-align: right; }
.batch-bill-amount small { display: block; color: var(--muted); font-size: 9.5px; margin-bottom: 3px; }
.batch-bill-amount .input { width: 112px; text-align: right; }
.batch-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #edf5ef;
  border: 1px solid #d8e9dd;
}
.batch-total span { display: block; color: #587268; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.batch-total strong { display: block; margin-top: 2px; font-family: var(--serif); font-size: 20px; color: #18332d; }
.batch-success-lines {
  margin-top: 13px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  padding: 7px 0;
  text-align: left;
}
.batch-success-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 11px; }
.batch-success-lines span { color: var(--muted); }
.batch-success-lines strong { white-space: nowrap; }
@media (max-width: 640px) {
  .batch-bill { grid-template-columns: auto minmax(0, 1fr); }
  .batch-bill-amount { grid-column: 2; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .batch-bill-amount small { margin: 0; }
}

.batch-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #dfeae3;
  background: rgba(255,255,255,.72);
  border-radius: 9px;
  position: relative;
}
.batch-step > span {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1f6b4e;
  color: #fff;
  font: 700 11px/1 var(--sans);
}
.batch-step strong { display: block; font-size: 11px; color: var(--ink); }
.batch-step small { display: block; color: var(--muted); font-size: 9.5px; margin-top: 1px; }
@media (max-width: 760px) {
  .batch-page-hero { grid-template-columns: 1fr !important; }
}

.nav-badge-new {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 99px;
  background: #f1c27d;
  color: #5b3a13;
  font: 700 8px/1.1 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sidebar-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 99px; }
.topbar-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d8e3da;
  background: #f3f8f4;
  color: #245241;
  border-radius: 8px;
  padding: 6px 9px;
  font: 600 9.5px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.topbar-shortcut:hover { background: #e9f3ec; border-color: #bfd5c6; }
.topbar-shortcut span { line-height: 1; }
@media (max-width: 900px) {
  .topbar-shortcut span { display: none; }
  .topbar-shortcut { padding: 6px; }
}

.wa-template-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.wa-template-tab { border: 0; background: transparent; padding: 9px 12px 10px; color: var(--muted); font: 600 11px/1 var(--sans); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; border-radius: 6px 6px 0 0; }
.wa-template-tab:hover { background: var(--surface-2, #f7f5ee); color: var(--ink); }
.wa-template-tab.active { color: #1f6b4e; border-bottom-color: #1f6b4e; background: #f2f8f4; }
.wa-template-panel .form-field { margin-top: 13px; }
.wa-template-preview-label { margin-top: 14px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.wa-template-preview { margin-top: 6px; padding: 12px 13px; border-radius: 10px; border: 1px dashed #cddbd1; background: #f6faf7; white-space: pre-wrap; font-size: 11px; line-height: 1.55; color: #29433a; max-height: 230px; overflow: auto; }
.wa-template-preview.disabled { background: #f5f3ee; border-color: #ddd8cb; color: #8a8478; font-style: italic; }
.settings-subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px dashed var(--line); }
.settings-subhead strong { display: block; font-size: 11px; color: var(--ink); }
.settings-subhead span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.wa-template-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.logo-settings { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.logo-preview { width: 120px; height: 120px; border-radius: 12px; border: 1px dashed #d7d2c5; background: #fffef9; display: grid; place-items: center; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.logo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #9aa39d; font-size: 9px; text-align: center; }
.logo-settings-copy strong { display: block; font-size: 11px; color: var(--ink); }
.logo-settings-copy p { margin: 3px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.45; }
@media (max-width: 560px) { .logo-settings { grid-template-columns: 1fr; } .logo-preview { width: 96px; height: 96px; } }

.fee-scope-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.fee-check-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; min-width: 130px; }
.fee-check-row:has(input:checked) { border-color: #8bbfa2; background: #f2faf5; }
.fee-check-row input { accent-color: #1f6b4e; }
.fee-check-row strong { display: block; font-size: 11px; color: var(--ink); }
.fee-check-row small { display: block; color: var(--muted); font-size: 9px; margin-top: 1px; }
.fee-exempt-list { max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 5px; background: #fffef9; }
.fee-exempt-row { display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 6px; cursor: pointer; }
.fee-exempt-row:hover { background: #f2f8f4; }
.fee-exempt-row input { accent-color: #1f6b4e; }
.fee-exempt-row strong { display: block; font-size: 10.5px; color: var(--ink); }
.fee-exempt-row small { display: block; color: var(--muted); font-size: 9px; margin-top: 1px; }

.fee-due-grid { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(130px, 1.2fr) minmax(100px, .8fr); gap: 10px; }
.fee-due-grid .form-field { margin: 0; }
@media (max-width: 560px) { .fee-due-grid { grid-template-columns: 1fr; } }

.topbar-logo-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid #d8e3da;
  background: #f3f8f4; display: grid; place-items: center; cursor: pointer;
  color: #245241; overflow: hidden; padding: 3px;
}
.topbar-logo-btn img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.topbar-logo-btn:hover { background: #e9f3ec; }

.announce-classes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }

.link-btn { border: 0; background: transparent; color: var(--green-700,#1f5c49); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }

.loading-mark:empty { visibility: hidden; }
