/* ==========================================================================
   deJournal UI — Fluent-inspired design system, palet biru Dapodik
   Layout: desktop = ribbon (M365), tablet = sidebar, mobile = bottom nav
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Palet biru Dapodik */
  --brand-900: #012d74;
  --brand-800: #033b8e;
  --brand-700: #024095;
  --brand: #0a4da3;
  --brand-600: #0f5cc0;
  --brand-500: #1a6fd0;
  --brand-100: #dce9f9;
  --brand-50: #eef5fc;

  --bg: #f4f8fd;
  --surface: #ffffff;
  --surface-2: #f7fafe;
  --text: #1f2a44;
  --text-2: #5b6b85;
  --text-3: #8a99b5;
  --line: #d9e4f2;
  --line-soft: #e8f0fa;

  --ok: #107c10;      --ok-bg: #e8f4e8;
  --warn: #9d5d00;    --warn-bg: #fff4ce;  --warn-line: #efd28b;
  --danger: #d13438;  --danger-bg: #fdeaea;
  --info: #0a5fa8;    --info-bg: #e8f1fb;

  --r-s: 6px; --r-m: 8px; --r-l: 12px; --r-xl: 16px; --r-pill: 999px;

  --shadow-2: 0 1px 2px rgba(1, 45, 116, .08), 0 2px 6px rgba(1, 45, 116, .06);
  --shadow-8: 0 4px 10px rgba(1, 45, 116, .08), 0 10px 28px rgba(1, 45, 116, .10);
  --shadow-16: 0 8px 20px rgba(1, 45, 116, .14), 0 20px 48px rgba(1, 45, 116, .16);

  --ease: cubic-bezier(.33, 0, .67, 1);
  --dur: 130ms;

  --topbar-h: 52px;
  --ribbon-h: 46px;
  --bottomnav-h: 62px;

  --font: "Segoe UI", system-ui, -apple-system, "Segoe UI Web (West European)", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset & dasar ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c3d3ea; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9c0e2; background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Ikon ---------- */
.icon { width: 1em; height: 1em; fill: currentColor; flex: 0 0 auto; vertical-align: -0.14em; }
.ic-12 { font-size: 12px; } .ic-14 { font-size: 14px; } .ic-16 { font-size: 16px; }
.ic-18 { font-size: 18px; } .ic-20 { font-size: 20px; } .ic-24 { font-size: 24px; }
.ic-32 { font-size: 32px; } .ic-48 { font-size: 48px; }

/* ---------- Splash boot ---------- */
.splash {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--brand); background: linear-gradient(150deg, var(--brand-900), var(--brand) 65%, #0148a0);
}
.splash-logo {
  width: 64px; height: 64px; border-radius: 18px; background: #fff; color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800;
  box-shadow: var(--shadow-16); animation: pulse 1.4s var(--ease) infinite;
}
.splash-name { color: #fff; font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.splash-bar { width: 120px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.splash-bar::after { content: ""; display: block; height: 100%; width: 40%; background: #fff; border-radius: 3px; animation: slide 1.1s var(--ease) infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes slide { 0% { transform: translateX(-120%);} 100% { transform: translateX(320%);} }

/* ==========================================================================
   LOGIN — layar biru Dapodik (dot pattern) + kartu putih
   ========================================================================== */
.login-wrap {
  min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr;
  background:
    radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.6px),
    linear-gradient(140deg, var(--brand-900) 0%, #02337e 42%, var(--brand-700) 100%);
  background-size: 24px 24px, cover;
}
.login-hero { display: flex; flex-direction: column; justify-content: center; padding: 56px 64px; color: #fff; gap: 18px; }
.login-hero .lh-logo { display: flex; align-items: center; gap: 14px; }
.login-hero .lh-mark {
  width: 54px; height: 54px; border-radius: 14px; background: #fff; color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px;
  box-shadow: var(--shadow-8);
}
.login-hero .lh-mark img { width: 34px; height: 34px; object-fit: contain; }
.login-hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -.5px; }
.login-hero p.lh-tag { color: #cfe0f7; font-size: 15px; max-width: 420px; }
.login-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.login-feats div { display: flex; gap: 12px; align-items: center; color: #e4eefb; font-size: 14px; }
.login-feats .icon { color: #8fc0ff; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 28px; }
.login-card {
  width: min(460px, 100%); background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-16); padding: 30px 30px 26px; animation: rise .3s var(--ease);
  max-height: calc(100dvh - 56px); overflow: auto;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.lc-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; text-align: center; }
.lc-logo { width: 58px; height: 58px; border-radius: 15px; background: var(--brand-50); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; border: 1px solid var(--brand-100); }
.lc-logo img { width: 38px; height: 38px; object-fit: contain; }
.lc-brand h1 { font-size: 21px; color: var(--text); font-weight: 700; }
.lc-brand p { color: var(--text-2); font-size: 13px; }

.lc-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.lc-sub { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }

.login-search { position: relative; margin-bottom: 14px; }
.login-search input { min-height: 42px; background: var(--surface-2); }
.login-search .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.login-search input { padding-inline-start: 36px; }

.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.school-card {
  border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--surface-2);
  padding: 14px 10px 12px; text-align: center; cursor: pointer; transition: all var(--dur) var(--ease);
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0;
}
.school-card:hover { border-color: var(--brand-500); background: var(--brand-50); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.school-card .sc-logo { width: 52px; height: 52px; border-radius: 13px; background: #fff; border: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--brand); font-weight: 800; font-size: 18px; }
.school-card .sc-logo img { width: 100%; height: 100%; object-fit: contain; }
.school-card b { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.school-card small { color: var(--text-2); font-size: 11px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lc-divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 18px 0 14px; }
.lc-divider::before, .lc-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.lc-foot { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lc-lang { display: flex; gap: 6px; }
.lc-offline { display: flex; align-items: center; gap: 8px; background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: #6b4b00; font-size: 12.5px; padding: 8px 12px; border-radius: var(--r-m); margin-bottom: 12px; }

/* keypad PIN */
.pin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pin-head .ph-school { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pin-head .ph-school img, .pin-head .ph-initial { width: 38px; height: 38px; border-radius: 10px; object-fit: contain;
  border: 1px solid var(--line-soft); background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-weight: 800; }
.pin-head .ph-school b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-head .ph-school small { color: var(--text-2); font-size: 12px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 20px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); transition: all var(--dur) var(--ease); }
.pin-dots span.f { background: var(--brand); border-color: var(--brand); transform: scale(1.12); }
.pin-dots.err span { border-color: var(--danger); }
.pin-dots.err span.f { background: var(--danger); border-color: var(--danger); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 290px; margin: 0 auto; }
.keypad button {
  height: 58px; border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--surface);
  font-size: 20px; font-weight: 600; color: var(--text); cursor: pointer; box-shadow: var(--shadow-2);
  transition: all var(--dur) var(--ease); display: flex; align-items: center; justify-content: center; gap: 6px;
}
.keypad button:hover { background: var(--brand-50); border-color: var(--brand-100); }
.keypad button:active { transform: scale(.95); background: var(--brand-100); }
.keypad button.ctl { color: var(--brand); font-size: 15px; }
.keypad button.ok { background: var(--brand); color: #fff; border-color: var(--brand); }
.keypad button.ok:hover { background: var(--brand-800); }

/* form login admin */
.eye-btn { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); }

/* ==========================================================================
   SHELL — topbar + ribbon / sidebar / bottom nav
   ========================================================================== */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- Top bar ---- */
.shell-top {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  position: sticky; top: 0; z-index: 60;
}
.st-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.st-right { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none !important; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(140deg, var(--brand-700), var(--brand-500));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.2px; white-space: nowrap; }
.brand-name span { color: var(--brand); }
.brand-tag { color: var(--text-3); font-size: 11px; white-space: nowrap; }

.chip-school { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-50); color: var(--brand-700);
  border: 1px solid var(--brand-100); border-radius: var(--r-pill); padding: 4px 12px; font-size: 12px; font-weight: 600;
  max-width: 260px; white-space: nowrap; overflow: hidden; }
.chip-school .icon { font-size: 12px; }

/* tombol ikon umum */
.icon-btn {
  width: 36px; height: 36px; border: none; background: transparent; border-radius: var(--r-m); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand-700); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }

/* chip sinkronisasi */
.sync-chip {
  display: inline-flex; align-items: center; gap: 7px; border-radius: var(--r-pill); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 600; padding: 5px 12px; transition: all var(--dur) var(--ease);
}
.sync-chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.sync-chip .icon { font-size: 14px; }
.sync-chip.ok { color: var(--ok); border-color: #cdeacd; background: var(--ok-bg); }
.sync-chip.pending { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.sync-chip.offline { color: var(--danger); border-color: #f3c1c3; background: var(--danger-bg); }
.sync-chip .spin { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.sync-count { background: var(--danger); color: #fff; border-radius: var(--r-pill); font-size: 10.5px; padding: 1px 7px; }

/* avatar + menu */
.avatar-wrap { position: relative; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--brand-100); background: var(--brand-700);
  color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
}
.avatar:hover { border-color: var(--brand-500); }
.menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 240px; background: #fff;
  border: 1px solid var(--line-soft); border-radius: var(--r-l); box-shadow: var(--shadow-8); padding: 6px;
  display: none; z-index: 80; animation: pop .16s var(--ease);
}
.menu.open { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.menu .mu-user { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.menu .mu-user b { display: block; font-size: 13.5px; }
.menu .mu-user small { color: var(--text-2); font-size: 12px; word-break: break-all; }
.menu .mu-role { margin-top: 6px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: none; background: none;
  border-radius: var(--r-m); font-size: 13px; color: var(--text); cursor: pointer; text-align: start; transition: background var(--dur) var(--ease);
}
.menu-item:hover { background: var(--brand-50); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); }
.menu-item .icon { color: var(--text-2); font-size: 15px; }
.menu-item.danger .icon { color: var(--danger); }
.menu-langs { display: flex; gap: 4px; padding: 4px 8px 8px; }

/* ---- Ribbon ala M365 (desktop) ---- */
.ribbon {
  background: linear-gradient(180deg, #eef5fc, #e6effb); border-bottom: 1px solid var(--line-soft);
  position: sticky; top: var(--topbar-h); z-index: 55; display: none;
}
.ribbon-inner {
  display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 1160px; margin: 0 auto;
  padding: 5px 12px; overflow-x: auto; scrollbar-width: none;
}
.ribbon-inner::-webkit-scrollbar { display: none; }
.rtab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: var(--r-pill);
  color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; transition: all var(--dur) var(--ease); text-decoration: none !important;
}
.rtab .icon { font-size: 17px; }
.rtab:hover { background: rgba(255,255,255,.75); color: var(--brand-800); }
.rtab.on { background: #fff; color: var(--brand-700); border-color: var(--line-soft); box-shadow: var(--shadow-2); }
.rtab .rtab-badge { background: var(--warn); color: #fff; font-size: 10px; border-radius: var(--r-pill); padding: 1px 6px; }

/* ---- Sub-nav chip (anak menu, desktop) ---- */
.subnav {
  background: #fff; border-bottom: 1px solid var(--line-soft); position: sticky;
  top: calc(var(--topbar-h) + var(--ribbon-h)); z-index: 54; display: none;
}
.subnav-inner { display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 1160px; margin: 0 auto;
  padding: 6px 12px; overflow-x: auto; scrollbar-width: none; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subtab {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: var(--r-pill);
  color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none !important;
  border: 1px solid transparent; cursor: pointer; transition: all var(--dur) var(--ease);
}
.subtab .icon { font-size: 14px; }
.subtab:hover { color: var(--brand-700); background: var(--brand-50); }
.subtab.on { background: var(--brand-700); color: #fff; }

/* ---- Sidebar (tablet/overlay) ---- */
.sidebar {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 266px; z-index: 100;
  background: var(--brand-900); color: #cdddf5; display: flex; flex-direction: column;
  transform: translateX(-105%); transition: transform .22s var(--ease); box-shadow: var(--shadow-16);
}
[dir="rtl"] .sidebar { transform: translateX(105%); }
.shell.sb-open .sidebar { transform: translateX(0); }
.sidebar .sb-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .sb-head .brand-logo { background: #fff; color: var(--brand-800); }
.sidebar .sb-head .brand-name { color: #fff; font-size: 15px; }
.sidebar .sb-head .icon-btn { color: #9db8de; }
.sidebar .sb-head .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 14px; }
.sb-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #7f9cc9; padding: 12px 12px 6px; }
.s-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0; border-radius: var(--r-m);
  color: #cdddf5; font-size: 13.5px; font-weight: 500; text-decoration: none !important; cursor: pointer;
  border: none; background: none; width: 100%; text-align: start; transition: all var(--dur) var(--ease);
}
.s-item .icon { font-size: 17px; color: #9db8de; }
.s-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.s-item.on { background: #fff; color: var(--brand-800); font-weight: 600; }
.s-item.on .icon { color: var(--brand-700); }
.s-item.danger { color: #ffb3b5; } .s-item.danger .icon { color: #ffb3b5; }
.s-item.danger:hover { background: rgba(209,52,56,.25); color: #fff; }
.s-item .rtab-badge { margin-inline-start: auto; }
.scrim { position: fixed; inset: 0; background: rgba(1, 20, 50, .5); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.shell.sb-open .scrim { opacity: 1; pointer-events: auto; }

/* ---- Banner offline ---- */
.offbanner {
  display: flex; align-items: center; gap: 10px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line);
  color: #5c4300; padding: 8px 16px; font-size: 12.5px; font-weight: 500; position: sticky; z-index: 56;
}
.offbanner[hidden] { display: none; }
.offbanner .icon { font-size: 16px; color: var(--warn); }
.offbanner .ob-text { flex: 1; min-width: 0; }
.offbanner button { flex: 0 0 auto; }

/* ---- Konten ---- */
.content { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px 20px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .ph-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-50); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center; font-size: 19px; border: 1px solid var(--brand-100); flex: 0 0 auto; }
.page-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.page-head p { color: var(--text-2); font-size: 12.5px; }
.page-head .ph-actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Bottom nav (mobile) ---- */
.bottomnav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 70; background: #fff;
  border-top: 1px solid var(--line-soft); box-shadow: 0 -2px 12px rgba(1,45,116,.06);
  display: none; padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
}
.bottomnav .bn-inner { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; margin: 0 auto; }
.b-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 2px 5px; border: none; background: none; color: var(--text-2); font-size: 10.5px; font-weight: 600;
  cursor: pointer; border-radius: var(--r-m); transition: color var(--dur) var(--ease); text-decoration: none !important;
  position: relative; min-width: 0;
}
.b-item .icon { font-size: 21px; }
.b-item span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-item.on { color: var(--brand-700); }
.b-item.on::before { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand-700); }
.b-item .rtab-badge { position: absolute; top: 2px; inset-inline-end: calc(50% - 22px); }
.b-item.center .icon {
  background: linear-gradient(140deg, var(--brand-600), var(--brand-800)); color: #fff; width: 44px; height: 44px;
  border-radius: 15px; padding: 11px; margin-top: -20px; box-shadow: var(--shadow-8); border: 3px solid #fff;
}

/* ==========================================================================
   Komponen umum
   ========================================================================== */
/* ---- Kartu ---- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-l);
  box-shadow: var(--shadow-2); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 .icon { color: var(--brand-600); font-size: 17px; }
.card-head .ch-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card.sub { padding: 14px; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.grow { flex: 1; }
.center { text-align: center; }
.right { text-align: end; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ---- Tombol ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; padding: 8px 16px; cursor: pointer; transition: all var(--dur) var(--ease);
  text-decoration: none !important; white-space: nowrap; min-height: 36px;
}
.btn:hover { background: var(--surface-2); border-color: #c3d3ea; box-shadow: var(--shadow-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .icon { font-size: 15px; }
.btn.primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn.primary:hover { background: var(--brand-800); border-color: var(--brand-800); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #b02b2f; border-color: #b02b2f; }
.btn.danger-soft { background: var(--danger-bg); border-color: #f3c1c3; color: var(--danger); }
.btn.danger-soft:hover { background: #fbd8d9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--brand-50); box-shadow: none; }
.btn.big { padding: 11px 22px; font-size: 14.5px; min-height: 44px; border-radius: var(--r-l); }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 0 1 auto; }
.btn-row.tight { gap: 8px; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading .icon { animation: rot 1s linear infinite; }

/* ---- Form ---- */
label.f-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 5px; }
label.f-label:first-child { margin-top: 0; }
label.f-label .req { color: var(--danger); }
label.f-label .hint { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="time"], input[type="month"], input[type="search"], input[type="tel"], input[type="url"],
input:not([type]), select, textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-m); background: #fff;
  padding: 8px 12px; transition: border var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #b9cee9; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500);
  box-shadow: inset 0 0 0 1px var(--brand-500); }
input:disabled, input[readonly], textarea:disabled, select:disabled { background: var(--surface-2); color: var(--text-2); }
::placeholder { color: var(--text-3); }
.f-check { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 8px 2px; cursor: pointer; }
.f-check input { width: 17px; height: 17px; accent-color: var(--brand-700); cursor: pointer; }
.f-check.f-switch input { width: 34px; height: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.input-wrap { position: relative; }
.input-wrap .icon { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 14px; }
.input-wrap input { padding-inline-start: 34px; }

/* ---- Toolbar tabel ---- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input-wrap { flex: 1; min-width: 170px; }
.toolbar select { width: auto; min-width: 120px; }
.toolbar .btn.primary { margin-inline-start: auto; }

/* ---- Tabel ---- */
.tbl-wrap { overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--r-m); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.tbl th {
  position: sticky; top: 0; background: var(--surface-2); text-align: start; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1;
}
table.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr { transition: background var(--dur) var(--ease); }
table.tbl tbody tr:hover { background: var(--brand-50); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.tbl-empty { padding: 28px !important; text-align: center; color: var(--text-3); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .icon-btn { width: 30px; height: 30px; font-size: 14px; border-radius: var(--r-s); }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pager .pg-info { flex: 1; text-align: center; color: var(--text-2); font-size: 12.5px; }

/* ---- Tag & chip ---- */
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-pill); font-size: 11.5px;
  font-weight: 700; padding: 2.5px 10px; white-space: nowrap; }
.tag .icon { font-size: 11px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.off { background: #eef1f6; color: var(--text-3); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.brand { background: var(--brand-50); color: var(--brand-700); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; padding: 6px 14px; cursor: pointer;
  transition: all var(--dur) var(--ease); min-height: 32px;
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.chip.on { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.chip .icon { font-size: 13px; }

/* ---- Kotak catatan/peringatan (info & warning) ---- */
.note-box {
  display: flex; align-items: flex-start; gap: 10px; border-radius: var(--r-m);
  padding: 11px 14px; font-size: 12.5px; line-height: 1.5; margin-bottom: 14px;
}
.note-box .icon { flex-shrink: 0; margin-top: 1px; }
.note-box.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.note-box.info { background: var(--info-bg); color: var(--info); border: 1px solid var(--brand-100); }
.note-box a { color: inherit; font-weight: 700; }

/* ---- Kartu statistik ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-l); padding: 15px 16px;
  display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow-2); min-width: 0; }
.stat .st-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex: 0 0 auto; }
.stat .st-ic.brand { background: var(--brand-50); color: var(--brand-700); }
.stat .st-ic.ok { background: var(--ok-bg); color: var(--ok); }
.stat .st-ic.warn { background: var(--warn-bg); color: var(--warn); }
.stat .st-ic.danger { background: var(--danger-bg); color: var(--danger); }
.stat .st-ic.info { background: var(--info-bg); color: var(--info); }
.stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.stat span { color: var(--text-2); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Kartu kelas guru ---- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.class-card {
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-l); padding: 15px; cursor: pointer;
  transition: all var(--dur) var(--ease); position: relative; box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.class-card:hover { border-color: var(--brand-500); transform: translateY(-2px); box-shadow: var(--shadow-8); }
.class-card .cc-top { display: flex; align-items: center; gap: 10px; }
.class-card .cc-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center; font-size: 18px; }
.class-card b { font-size: 15px; font-weight: 700; }
.class-card .cc-sub { color: var(--text-2); font-size: 12px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.cc-badge { position: absolute; top: -7px; inset-inline-end: -7px; border: 2px solid #fff; }

/* ---- Item jurnal (list) ---- */
.j-list { display: flex; flex-direction: column; gap: 8px; }
.j-item {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: var(--r-m); cursor: pointer; transition: all var(--dur) var(--ease);
}
.j-item:hover { background: #fff; border-color: var(--brand-100); box-shadow: var(--shadow-2); }
.j-date { width: 46px; flex: 0 0 auto; text-align: center; background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--r-m); padding: 4px 2px; }
.j-date b { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; color: var(--brand-800); }
.j-date small { font-size: 9.5px; color: var(--text-3); text-transform: uppercase; }
.j-info { flex: 1; min-width: 0; }
.j-info b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.j-info small { color: var(--text-2); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* ==========================================================================
   Wizard jurnal (stepper)
   ========================================================================== */
.stepper { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; position: relative; }
.stepper::before { content: ""; position: absolute; top: 17px; inset-inline-start: 40px; inset-inline-end: 40px; height: 2px; background: var(--line); z-index: 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 1; flex: 1; min-width: 0; }
.step .sp-dot { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2px solid var(--line);
  color: var(--text-3); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
  transition: all var(--dur) var(--ease); }
.step span { font-size: 11px; font-weight: 600; color: var(--text-3); text-align: center; }
.step.done .sp-dot { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.step.done span { color: var(--brand-700); }
.step.on .sp-dot { border-color: var(--brand-700); color: var(--brand-700); box-shadow: 0 0 0 4px var(--brand-50); }
.step.on span { color: var(--brand-800); }

/* pemilih jam pelajaran (pills) */
.period-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.period-pill {
  border: 1.5px solid var(--line); border-radius: var(--r-m); background: #fff; padding: 9px 6px; text-align: center;
  cursor: pointer; transition: all var(--dur) var(--ease); display: flex; flex-direction: column; gap: 2px;
}
.period-pill:hover { border-color: var(--brand-500); background: var(--brand-50); }
.period-pill b { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.1; }
.period-pill small { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.period-pill.sel { border-color: var(--brand-700); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-700); }
.period-pill.sel b { color: var(--brand-800); }
.period-pill.inrange { border-color: var(--brand-100); background: var(--brand-50); }

/* absensi */
.att-summary { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sum { flex: 1; min-width: 110px; border-radius: var(--r-m); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.sum > div { display: flex; flex-direction: column; gap: 1px; }
.sum b { font-size: 20px; font-weight: 800; line-height: 1; }
.sum span { font-size: 11.5px; font-weight: 600; }
.sum.ok { background: var(--ok-bg); color: var(--ok); }
.sum.warn { background: var(--warn-bg); color: var(--warn); }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: var(--r-m); }
.att-row .avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700);
  font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.att-info { flex: 1; min-width: 0; }
.att-info b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-info small { color: var(--text-2); font-size: 11.5px; }
.att-info .att-why { color: var(--warn); font-size: 11.5px; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; flex: 0 0 auto; }
.seg button { border: none; background: #fff; color: var(--text-2); font-size: 12.5px; font-weight: 700;
  padding: 7px 15px; cursor: pointer; transition: all var(--dur) var(--ease); }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.h.on { background: var(--ok); color: #fff; }
.seg button.i.on { background: #d99000; color: #fff; }

/* sukses */
.success-page { text-align: center; padding: 42px 16px; }
.success-page .sp-ic { width: 84px; height: 84px; border-radius: 50%; background: var(--ok-bg); color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 44px; margin: 0 auto 18px; animation: pop .3s var(--ease); }

/* ==========================================================================
   Dialog internal (bukan dialog browser) & toast
   ========================================================================== */
.modal-back {
  position: fixed; inset: 0; z-index: 200; background: rgba(1, 22, 54, .48);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .16s var(--ease); backdrop-filter: blur(2px);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(480px, 100%); background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-16);
  display: flex; flex-direction: column; max-height: calc(100dvh - 40px); animation: zoom .18s var(--ease);
}
@keyframes zoom { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 11px; padding: 16px 20px 0; }
.modal-head .mh-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.modal-head .mh-ic.brand { background: var(--brand-50); color: var(--brand-700); }
.modal-head .mh-ic.danger { background: var(--danger-bg); color: var(--danger); }
.modal-head .mh-ic.ok { background: var(--ok-bg); color: var(--ok); }
.modal-head .mh-ic.warn { background: var(--warn-bg); color: var(--warn); }
.modal-head h3 { font-size: 16px; font-weight: 700; flex: 1; min-width: 0; }
.modal-body { padding: 14px 20px 4px; overflow-y: auto; }
.modal-body p { font-size: 13.5px; color: var(--text); }
.modal-body p + p { margin-top: 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; flex-wrap: wrap; }
.modal-foot .btn { min-width: 110px; }
.modal-confirm-ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 4px auto 12px; }
.modal-confirm-ic.danger { background: var(--danger-bg); color: var(--danger); }
.modal-confirm-ic.warn { background: var(--warn-bg); color: var(--warn); }

/* toast */
.toasts { position: fixed; bottom: 18px; inset-inline: 0; z-index: 300; display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--r-m); box-shadow: var(--shadow-8); padding: 11px 18px; font-size: 13.5px; font-weight: 500;
  animation: toastin .25s var(--ease); max-width: 480px; pointer-events: auto;
}
.toast .icon { font-size: 17px; flex: 0 0 auto; }
.toast.ok .icon { color: var(--ok); }
.toast.err .icon { color: var(--danger); }
.toast.warn .icon { color: var(--warn); }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s var(--ease); }

/* ==========================================================================
   Halaman khusus
   ========================================================================== */
/* Draf & sinkron */
.draft-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-soft);
  border-radius: var(--r-m); background: var(--surface-2); }
.draft-item .di-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--warn-bg); color: var(--warn);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.draft-item .di-body { flex: 1; min-width: 0; }
.draft-item .di-body b { font-size: 13.5px; display: block; }
.draft-item .di-body small { color: var(--text-2); font-size: 11.5px; }

/* profil */
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 20px; background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  border-radius: var(--r-l); color: #fff; margin-bottom: 16px; box-shadow: var(--shadow-8); }
.profile-hero .ph-av { width: 62px; height: 62px; border-radius: 50%; background: #fff; color: var(--brand-800);
  font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 3px solid rgba(255,255,255,.4); }
.profile-hero h3 { font-size: 18px; }
.profile-hero p { color: #cfe0f7; font-size: 12.5px; }

/* branding (super admin) */
.brand-preview { border: 1px dashed var(--brand-100); border-radius: var(--r-l); padding: 18px;
  background: linear-gradient(140deg, var(--brand-900), #02337e 55%, var(--brand-700)); display: flex;
  flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.brand-preview .bp-logo { width: 64px; height: 64px; border-radius: 16px; background: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: var(--brand); overflow: hidden; }
.brand-preview .bp-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-preview h3 { color: #fff; font-size: 19px; }
.brand-preview p { color: #cfe0f7; font-size: 12.5px; }
.upload-tile { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line-soft); border-radius: var(--r-m);
  padding: 12px 14px; background: var(--surface-2); }
.upload-tile .ut-preview { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 22px; overflow: hidden; flex: 0 0 auto; }
.upload-tile .ut-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-tile .ut-body { flex: 1; min-width: 0; }
.upload-tile .ut-body b { font-size: 13px; display: block; }
.upload-tile .ut-body small { color: var(--text-2); font-size: 11.5px; }

/* laporan tabs */
.rep-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rep-tabs .chip .icon { color: inherit; }

/* print */
.print-bar { display: flex; gap: 10px; max-width: 820px; margin: 16px auto; }
.print-doc { background: #fff; max-width: 820px; margin: 0 auto 30px; padding: 34px 40px; border-radius: var(--r-m);
  box-shadow: var(--shadow-2); min-height: 900px; }
.print-head { display: flex; align-items: center; gap: 16px; border-bottom: 4px double var(--text); padding-bottom: 12px; margin-bottom: 16px; }
.print-head .ph-logo { width: 72px; flex: 0 0 auto; display: flex; justify-content: center; }
.print-head .ph-logo img { height: 64px; max-width: 72px; object-fit: contain; }
.print-head .ph-text { flex: 1; text-align: center; }
.print-head small { color: var(--text-2); }
.print-sign { margin-top: 36px; text-align: center; width: 260px; margin-inline-start: auto; }
.print-sign p { margin: 0; font-size: 13px; }
.print-sign .sign-space { height: 64px; }
.print-sign .sign-name { font-weight: 700; text-decoration: underline; }

/* empty state */
.empty { text-align: center; padding: 38px 16px; color: var(--text-3); }
.empty .icon { font-size: 42px; display: block; margin: 0 auto 10px; color: #c3d3ea; }
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }
.empty p { font-size: 12.5px; }

/* loading skeleton */
.loading-row { display: flex; gap: 10px; padding: 10px 2px; align-items: center; color: var(--text-3); font-size: 13px; }
.loading-row .icon { animation: rot 1s linear infinite; }

/* ==========================================================================
   RESPONSIVE — desktop ribbon / tablet sidebar / mobile bottom nav
   ========================================================================== */

/* --- Tablet 768–1023px: sidebar via burger --- */
@media (max-width: 1023px) {
  .ribbon, .subnav { display: none !important; }
  .brand-tag { display: none; }
  .content { padding: 16px 16px 40px; }
}

/* --- Desktop ≥1024px: ribbon M365 --- */
@media (min-width: 1024px) {
  .ribbon { display: block; }
  .shell.has-subnav .ribbon { box-shadow: none; }
  .shell.has-subnav .subnav { display: block; }
  .st-burger { display: inline-flex; }
}

/* --- Mobile <768px: bottom nav --- */
@media (max-width: 767px) {
  .shell-top { padding: 0 10px; gap: 6px; }
  .brand-name { font-size: 14px; }
  .chip-school { display: none; }
  .sync-chip .sc-label { display: none; }
  .sync-chip { padding: 5px 10px; }
  .bottomnav { display: block; }
  .content { padding: 14px 12px calc(var(--bottomnav-h) + 30px + env(safe-area-inset-bottom)); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { padding: 18px 14px; align-items: flex-start; padding-top: max(18px, env(safe-area-inset-top)); }
  .login-card { padding: 22px 18px 20px; max-height: none; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh;
    animation: sheetup .22s var(--ease); }
  @keyframes sheetup { from { transform: translateY(40px); opacity: 0; } }
  .page-head h2 { font-size: 17px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat b { font-size: 19px; }
  .class-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .toolbar .btn.primary { margin-inline-start: 0; order: -1; width: 100%; }
  .toasts { bottom: calc(var(--bottomnav-h) + 14px + env(safe-area-inset-bottom)); }
  .stepper span { display: none; }
  .stepper::before { inset-inline: 60px; }
  .school-grid { grid-template-columns: repeat(2, 1fr); }
  .j-info small { font-size: 11px; }
  .profile-hero { padding: 16px; }
  .print-doc { padding: 20px 16px; border-radius: 0; }
  .print-bar { padding: 0 8px; }
}

/* --- Desktop kecil / layar besar --- */
@media (min-width: 1400px) {
  .content { max-width: 1280px; }
}

/* ==========================================================================
   DROPDOWN RIBBON (grup dgn anak — ala Office 365) + MODE NAVIGASI (print2)
   ========================================================================== */
.rtab.has-dd .dd-caret { font-size: 11px; opacity: .65; transition: transform var(--dur) var(--ease); }
.rtab.dd-open { background: #fff; color: var(--brand-700); border-color: var(--line-soft); }
.rtab.dd-open .dd-caret { transform: rotate(180deg); }
.rtab-dd {
  position: fixed; z-index: 120; min-width: 232px; max-width: 300px; background: #fff;
  border: 1px solid var(--line-soft); border-radius: var(--r-l); box-shadow: var(--shadow-16); padding: 6px;
  display: flex; flex-direction: column; animation: pop .16s var(--ease);
}
.rtab-dd-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-m);
  color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  text-decoration: none !important; transition: background var(--dur) var(--ease);
}
.rtab-dd-item .icon { color: var(--text-2); font-size: 16px; }
.rtab-dd-item:hover { background: var(--brand-50); color: var(--brand-800); }
.rtab-dd-item:hover .icon { color: var(--brand-700); }

/* Mode navigasi (html[data-nav]; dari Pengaturan > Tampilan, per perangkat).
   'auto' = perilaku default lebar layar (ribbon >=1024px, sidebar <1024px).
   'ribbon'  = paksa menu bar di semua lebar layar (bottom-nav disembunyikan).
   'sidebar' = paksa sidebar di semua lebar layar (ribbon & subnav disembunyikan). */
html[data-nav="sidebar"] .ribbon,
html[data-nav="sidebar"] .subnav { display: none !important; }
html[data-nav="ribbon"] .ribbon { display: block !important; }
html[data-nav="ribbon"] .shell.has-subnav .subnav { display: block !important; }
html[data-nav="ribbon"] .bottomnav { display: none !important; }
html[data-nav="ribbon"] .content { padding-bottom: 40px; }

/* Segmented control (pilihan mode navigasi) */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2, #eef2f8); border: 1px solid var(--line-soft); border-radius: var(--r-pill); flex-wrap: wrap; }
.seg-btn {
  border: none; background: none; padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: all var(--dur) var(--ease);
}
.seg-btn:hover { color: var(--brand-800); }
.seg-btn.on { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-2); }

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  body { background: #fff; }
  .no-print, .shell-top, .ribbon, .subnav, .bottomnav, .sidebar, .scrim, .toasts, .offbanner, .print-bar { display: none !important; }
  .content { max-width: none; padding: 0; margin: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
  .print-doc { box-shadow: none; padding: 0; max-width: none; min-height: 0; }
  .tbl-wrap { overflow: visible; }
  table.tbl th { background: #eee !important; }
}

/* RTL ringan */
[dir="rtl"] .icon { transform: none; }
[dir="rtl"] .input-wrap .icon { inset-inline-start: auto; inset-inline-end: 11px; }
[dir="rtl"] .input-wrap input { padding-inline-start: 12px; padding-inline-end: 34px; }

/* ================= TAMBAHAN WORKFLOW BARU (djn-ui2) ================= */

/* Bar aksi sticky (Lanjut/Simpan) — menempel di bawah viewport */
.sticky-bar {
  position: sticky; bottom: 10px; z-index: 30;
  display: flex; gap: 10px; align-items: center;
  margin-top: 16px; padding: 10px 12px;
  background: color-mix(in srgb, var(--surface, #fff) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: 0 6px 22px rgba(2, 64, 149, .14);
}
.sticky-bar .btn { flex: 0 0 auto; }
.sticky-bar .sb-grow { flex: 1; min-width: 0; font-size: 12px; color: var(--text-3); }
.sticky-bar .sb-grow b { color: var(--brand-800); font-size: 13px; }

/* Kartu jam pelajaran multi-pilih */
.period-pill { position: relative; user-select: none; -webkit-user-select: none; }
.period-pill .pp-check {
  position: absolute; top: 6px; inset-inline-end: 6px; width: 18px; height: 18px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--brand-700); color: #fff;
}
.period-pill.sel .pp-check { display: flex; }
.pick-total {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--brand-50, #eef4fc); color: var(--brand-800);
  font-size: 12.5px; font-weight: 700; border: 1px solid var(--brand-100);
}

/* Kotak status pencocokan jadwal (sesuai / menggantikan / luar jadwal) */
.sch-note { display: flex; align-items: flex-start; gap: 10px; border-radius: var(--r-m);
  padding: 10px 13px; font-size: 12.5px; line-height: 1.5; margin-top: 12px; border: 1px solid var(--line); background: var(--surface-2, #f8fafd); }
.sch-note .icon { flex-shrink: 0; margin-top: 1px; }
.sch-note.ok { background: var(--ok-bg, #e9f9ef); border-color: var(--ok-line, #b7e6c6); color: var(--ok-text, #0a7a3d); }
.sch-note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.sch-note b { font-weight: 800; }

/* Badge status penggantian di daftar */
.tag.sub { background: var(--warn-bg); color: var(--warn); }
.tag.out { background: var(--surface-3, #eef1f5); color: var(--text-2); }

/* Absensi: alasan izin lewat MODAL radio (djn-fix7: klik huruf I -> modal di depan,
   pilih satu alasan = simpan & modal langsung tertutup) */
.att-row .att-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.att-row.iz { border-color: var(--warn-line, #f0d3a0); background: #fffdf6; }
.iz-stu { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px;
  background: #fffdf6; border: 1px solid var(--warn-line, #f0d3a0); border-radius: var(--r-m); }
.iz-stu-body { flex: 1; min-width: 0; }
.iz-stu-body b { font-size: 13.5px; display: block; }
.iz-stu-body small { color: var(--text-3); font-size: 11px; }
.iz-stu .tag { flex: 0 0 auto; background: var(--warn-bg, #fdf3e3); color: var(--warn, #b7791f); }
.rr-list { display: flex; flex-direction: column; gap: 2px; }
.rr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-m);
  cursor: pointer; border: 1.5px solid transparent; transition: all var(--dur) var(--ease); }
.rr-item:hover { background: var(--brand-50, #eef4fc); }
.rr-item input[type="radio"] { width: 19px; height: 19px; accent-color: var(--brand-700); margin: 0; flex: 0 0 auto; cursor: pointer; }
.rr-item span { font-size: 13px; font-weight: 600; color: var(--text); }
.rr-item.on { border-color: var(--brand-700); background: var(--brand-50, #eef4fc); }
.rr-item.on span { color: var(--brand-800); font-weight: 700; }
.att-note-in { width: 100%; margin-top: 8px; font-size: 12.5px; padding: 8px 10px; }
.rr-empty { font-size: 12px; color: var(--text-3); padding: 6px 2px; }
/* modal izin: baris radio = kartu besar enak di-tap jempol */
.modal .rr-item { padding: 12px 12px; border-color: var(--line-soft, #e6eaf0); }

/* Halaman login: tombol sidik jari */
.fp-btn { border: 1.5px dashed var(--brand-500); background: var(--brand-50, #f0f5fc); color: var(--brand-800);
  font-weight: 700; letter-spacing: .2px; }
.fp-btn:active { transform: scale(.98); }
.fp-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 11.5px;
  font-weight: 700; letter-spacing: .5px; margin: 16px 0 10px; }
.fp-or::before, .fp-or::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* Profil: kartu biometrik & daftar perangkat */
.wa-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.wa-row:last-child { border-bottom: none; }
.wa-row .wr-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50, #eef4fc);
  color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.wa-row .wr-body { flex: 1; min-width: 0; }
.wa-row .wr-body b { font-size: 13px; display: block; }
.wa-row .wr-body small { color: var(--text-3); font-size: 11.5px; }

@media (max-width: 767px) {
  .sticky-bar { bottom: calc(var(--bottomnav-h, 62px) + 10px + env(safe-area-inset-bottom)); }
  .modal .rr-item { padding: 14px 12px; }
}
