/* Portal Tutor Full Time — the classroom look.
   Kertas (light, default): cream exercise-book paper with blue rules and a red margin, navy ink, pencil-yellow accents.
   Papan hitam (dark): a green chalkboard, chalk-white text, chalk-yellow accents.
   The sidebar is always the chalkboard, framed in wood. Headings in Fraunces (a bookish serif), body in DM Sans,
   handwritten notes in Caveat. Layout as in the other MyTuitionA+ portals: a fixed sidebar on wide screens, a drawer on phones. */

:root, :root[data-theme="light"] {
  color-scheme: light;
  --page: #f6f1e4;
  --rule: #8fb4d82e;
  --margin: #e0756b66;
  --paper: #fffdf7;
  --paper-2: #fbf6ea;
  --field: #ffffff;
  --track: #ece5d3;
  --line: #2a33401a;
  --line-strong: #2a33402e;
  --ink: #1d2733;
  --ink-2: #3b4757;
  --muted: #646d7a;
  --faint: #8a919c;
  --pencil: #f2b632;
  --pencil-rgb: 242, 182, 50;
  --pencil-ink: #8a5a00;
  --on-pencil: #2b1d00;
  --red-pen: #cf3f37;
  --good: 30, 122, 76;
  --warn: 166, 104, 0;
  --bad: 196, 52, 46;
  --info: 30, 96, 164;
  --mute: 100, 109, 122;
  --k-kuning: #8a5a00;
  --k-hijau: #1e7a4c;
  --k-biru: #1e60a4;
  --k-merah: #b8352e;
  --k-ungu: #6a43b8;
  --k-oren: #a8521a;
  --shadow: 0 1px 0 #2a33400d, 0 14px 30px -22px #2a334055;
  --dialog-bg: #fffdf7;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #16231e;
  --rule: #ffffff07;
  --margin: #f2a59c22;
  --paper: #1d2d27;
  --paper-2: #22342d;
  --field: #15211c;
  --track: #ffffff14;
  --line: #ffffff14;
  --line-strong: #ffffff26;
  --ink: #eef0e6;
  --ink-2: #cdd3c8;
  --muted: #a1aba0;
  --faint: #7d887c;
  --pencil: #f3d36b;
  --pencil-rgb: 243, 211, 107;
  --pencil-ink: #f3d36b;
  --on-pencil: #2b2200;
  --red-pen: #ff8f82;
  --good: 134, 214, 160;
  --warn: 243, 200, 100;
  --bad: 255, 134, 120;
  --info: 140, 196, 245;
  --mute: 161, 171, 160;
  --k-kuning: #f3d36b;
  --k-hijau: #8fdcab;
  --k-biru: #9cc9f2;
  --k-merah: #ff9a8e;
  --k-ungu: #c6b1f7;
  --k-oren: #f9b27c;
  --shadow: 0 1px 0 #00000033, 0 16px 34px -24px #000000aa;
  --dialog-bg: #1d2d27;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0; min-height: 100vh; background: var(--page); color: var(--ink);
  font: 400 14px/1.55 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(60% 40% at 20% 10%, #ffffff08, transparent 70%),
    radial-gradient(50% 50% at 85% 80%, #ffffff06, transparent 70%),
    var(--page);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
code { padding: 1px 5px; border-radius: 5px; background: var(--track); font-size: .92em; }
kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; font: 600 11px/1.4 'DM Sans', sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--pencil); color: var(--on-pencil); font-weight: 700; text-decoration: none; border-radius: 8px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.tulisan { font-family: 'Caveat', 'Comic Sans MS', cursive; }
[hidden] { display: none !important; }

/* ---------- Sidebar: the chalkboard in its wooden frame ---------- */
.sidebar {
  position: fixed; z-index: 40; inset: 0 auto 0 0; width: 272px;
  display: flex; flex-direction: column; gap: 16px;
  padding: max(22px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)) 16px;
  background:
    radial-gradient(120% 45% at 25% 0%, #ffffff10, transparent 60%),
    radial-gradient(90% 40% at 85% 100%, #ffffff0a, transparent 70%),
    #20382f;
  border-right: 9px solid #8b5a33;
  border-image: linear-gradient(90deg, #6e4424, #a8713f 45%, #7a4b27) 1;
  color: #eef0e6; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #ffffff22 transparent;
}
.side-top { display: flex; flex-direction: column; gap: 12px; }
.side-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand-link { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; min-width: 0; }
/* The gold logo; the PNG has empty margins, so a slight negative margin tightens it */
.brand-logo { display: block; width: 100%; max-width: 220px; height: auto; margin: -6px 0 -4px; }
/* Sidebar section headings (MYTUITIONA+, TUTOR, PENGURUS): centred capitals in gold chalk, a soft glow behind
   and a gold rule fading out to each side */
.side-eyebrow {
  position: relative; display: flex; align-items: center; gap: 10px; margin: 12px 6px 2px; padding: 4px 0;
  color: #f6dc85; font: 700 11px/1 'DM Sans', sans-serif; letter-spacing: .24em; text-align: center; text-transform: uppercase;
  text-shadow: 0 0 6px #f3d36b99, 0 0 16px #f3d36b55;
  animation: aura-eyebrow 4.5s ease-in-out infinite;
}
.side-eyebrow::before, .side-eyebrow::after { content: ''; flex: 1; height: 1px; }
.side-eyebrow::before { background: linear-gradient(90deg, transparent, #f3d36b8c); }
.side-eyebrow::after { background: linear-gradient(270deg, transparent, #f3d36b8c); }
/* the aura: a gold haze behind the word, wider than the text */
.side-eyebrow { background: radial-gradient(closest-side, #f3d36b26, transparent) center / 70% 220% no-repeat; }
.nav > .side-eyebrow:first-child { margin-top: 4px; }
@keyframes aura-eyebrow {
  0%, 100% { text-shadow: 0 0 6px #f3d36b80, 0 0 14px #f3d36b40; }
  50% { text-shadow: 0 0 8px #f3d36bcc, 0 0 22px #f3d36b73; }
}
@media (prefers-reduced-motion: reduce) { .side-eyebrow { animation: none; } }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px;
  border-radius: 8px; color: #eef0e6c7; font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background .2s, color .2s;
}
.nav-item .ph { font-size: 17px; color: #eef0e68a; transition: color .2s; }
.nav-item:hover { background: #ffffff0d; color: #fff; }
.nav-item[aria-current="page"] { background: #ffffff12; color: #fff; }
.nav-item[aria-current="page"] .ph { color: #f3d36b; }
.nav-item[aria-current="page"] .nav-label {
  padding-bottom: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5.5c14-3 28-3 40-1s26 2.5 38 0 26-2.5 38-.5' fill='none' stroke='%23f3d36b' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") 0 100% / 100% 7px no-repeat;
}
.nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: #ffffff14; color: #eef0e6; font: 700 11px/1.7 'DM Sans', sans-serif; text-align: center; }
.nav-count:empty { display: none; }
:root:not([data-peranan="superadmin"]) .nav-super { display: none; }
/* Senarai Tutor CFS: a ruled grid, with a line between every column */
.cfs-nota { margin-bottom: 14px; }
.cfs-wrap { border: 1px solid var(--line-strong); border-radius: 12px; margin: 0; padding: 0; }
.table-grid { border-collapse: separate; border-spacing: 0; }
.table-grid th, .table-grid td { border-right: 1px solid var(--line); }
.table-grid th:last-child, .table-grid td:last-child { border-right: 0; }
.table-grid thead th { position: sticky; top: 0; z-index: 1; padding: 11px 12px; border-bottom: 2px solid var(--line-strong); background: var(--paper); }
.table-grid tbody td { padding: 10px 12px; }
.table-grid tbody tr:last-child td { border-bottom: 0; }
.table-grid tbody tr:nth-child(even) td { background: rgba(var(--pencil-rgb), .045); }
.table-grid tbody tr:hover td { background: rgba(var(--pencil-rgb), .12); }
.cfs-table { min-width: 760px; }
.cfs-table.cfs-penuh { min-width: 1000px; }
.cfs-table .cfs-bil { width: 1%; color: var(--muted); font-size: 12px; }
.cfs-table .cfs-nama b { display: block; font-weight: 600; letter-spacing: .01em; }
.cfs-table .cfs-nama small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.cfs-table .cfs-id { white-space: nowrap; font-weight: 600; color: var(--ink-2); }
.cfs-table .cfs-teks { width: 20%; min-width: 150px; color: var(--ink-2); font-size: 12.5px; } /* Subjek: kept narrow so Cawangan fits on one row */
.cfs-tel { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px dashed transparent; border-radius: 7px; background: none; color: var(--ink); font: 500 13px/1.3 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: copy; transition: background .15s, border-color .15s; }
.cfs-tel .ph { font-size: 14px; color: var(--faint); transition: color .15s; }
.cfs-tel:hover, .cfs-tel:focus-visible { border-color: var(--line-strong); background: rgba(var(--pencil-rgb), .14); }
.cfs-tel:hover .ph, .cfs-tel:focus-visible .ph { color: var(--ink); }
.cfs-cawangan { display: flex; flex-wrap: nowrap; justify-content: center; gap: 4px; }
.cfs-cawangan abbr.ya { border-color: rgba(var(--good), .35); background: rgba(var(--good), .14); color: rgb(var(--good)); }
.cfs-cawangan abbr.tidak { border-color: rgba(var(--bad), .3); background: rgba(var(--bad), .1); color: rgb(var(--bad)); }
/* every column centred, headers and cells alike */
.cfs-table th, .cfs-table td, .cfs-table th.kiri, .cfs-table td.kiri { text-align: center; }
/* Tahap: a narrow column, SK above SMK; green = teaches it, red = does not */
.cfs-table .cfs-tahap-sel { width: 1%; padding-inline: 10px; }
.cfs-tahap { display: inline-flex; flex-direction: column; align-items: stretch; gap: 4px; }
.cfs-tahap > span { padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.cfs-tahap > .ya { border-color: rgba(var(--good), .35); background: rgba(var(--good), .14); color: rgb(var(--good)); }
.cfs-tahap > .tidak { border-color: rgba(var(--bad), .3); background: rgba(var(--bad), .1); color: rgb(var(--bad)); }
.cfs-cawangan abbr { padding: 2px 7px; border: 1px solid rgba(var(--info), .3); border-radius: 6px; background: rgba(var(--info), .09); color: rgb(var(--info)); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-decoration: none; cursor: help; }
.cfs-tiada { color: var(--faint); }

/* Calendar notes in the sidebar */

.side-panduan {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px;
  border: 1px solid #ffffff26; border-radius: 12px; background: #ffffff08; color: #eef0e6; text-align: left; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.side-paparan:empty + .side-panduan { margin-top: auto; }
/* Whose records the pages show: one button per tutor + Pengurusan, above Panduan */
.side-paparan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: auto; }
.side-paparan:empty { display: none; }
.paparan-btn {
  display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; min-height: 38px; padding: 5px 8px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: #eef0e6c7;
  font: 500 13px/1.2 'DM Sans', sans-serif; text-align: left; cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.paparan-btn:hover { background: #ffffff0d; color: #fff; }
.paparan-btn[aria-pressed="true"] { border-color: #f3d36b99; background: #ffffff12; color: #fff; font-weight: 600; }
.paparan-tanda { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #eef0e666; color: #eef0e6b0; font: 700 11px/1 'Fraunces', serif; }
.paparan-tanda .ph { font-size: 15px; }
.paparan-btn[aria-pressed="true"] .paparan-tanda { border-color: #f3d36b; color: #f3d36b; }
.paparan-nama { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paparan-btn small { color: #eef0e680; font-size: 10.5px; font-weight: 500; }
.paparan-balik { grid-column: 1 / -1; }
.side-panduan:hover { background: #ffffff12; border-color: #f3d36b88; }
.side-panduan-ikon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #f3d36b22; color: #f3d36b; font-size: 18px; }
.side-panduan-teks { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.side-panduan-teks b { font-size: 13px; }
.side-panduan-teks small { color: #eef0e699; font-size: 11px; }
/* the account card stays in view at the bottom while the rest of the sidebar scrolls on short screens */
.side-bottom { position: sticky; bottom: calc(-1 * max(14px, env(safe-area-inset-bottom))); z-index: 1; margin: 0 -6px calc(-1 * max(14px, env(safe-area-inset-bottom))); padding: 8px 6px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #20382f00, #20382f 14px); }
/* The account card: a gold tab like the page cards, the name in the chalkboard's serif with a chalk underline,
   then the account's three buttons, each with its label */
.user-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 12px 12px; border: 1px solid #ffffff17; border-radius: 14px; background: linear-gradient(180deg, #1d372b, #13241c); box-shadow: inset 0 1px 0 #ffffff0d, 0 6px 18px -10px #000a; }
.user-card::before { content: ''; position: absolute; top: -1px; left: 16px; width: 40px; height: 4px; border-radius: 0 0 4px 4px; background: #f3d36b; }
.user-card .user-main { padding: 0 4px; }
.user-card .user-name { position: relative; width: fit-content; max-width: 100%; padding-bottom: 6px; color: #fff; font: 600 18px/1.15 'Fraunces', Georgia, serif; letter-spacing: .01em; }
.user-card .user-name::after { content: ''; position: absolute; left: 0; bottom: 0; width: 70%; min-width: 34px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #f3d36b, #f3d36b00); }
.user-aksi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.user-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 2px 7px; border: 1px solid #ffffff14; border-radius: 10px; background: #ffffff08; color: #eef0e6c2; font: 600 10px/1.1 'DM Sans', sans-serif; letter-spacing: -.01em; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.user-btn .ph { font-size: 18px; }
.user-btn span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.user-btn:hover { border-color: #f3d36b66; background: #f3d36b1a; color: #f3d36b; }
.user-btn.keluar:hover { border-color: #f2a59b66; background: #e0786c1f; color: #f2a59b; }
.user-btn:focus-visible { outline: 2px solid #f3d36b; outline-offset: 1px; }
.user-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #f3d36b; color: #f3d36b; font: 700 15px/1 'Fraunces', serif; }
.user-main { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.user-role { overflow: hidden; color: #f3d36bcc; font: 600 15px/1 'Caveat', cursive; text-overflow: ellipsis; white-space: nowrap; }
.user-name { overflow: hidden; color: #fff; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-card .user-name { color: #fff; font: 600 16px/1.2 'Fraunces', Georgia, serif; letter-spacing: .01em; }
.sidebar .icon-btn { color: #eef0e6b0; }
.sidebar .icon-btn:hover { background: #ffffff14; color: #fff; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 17px; cursor: pointer;
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--track); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.backdrop { position: fixed; inset: 0; z-index: 39; background: #0b1410aa; opacity: 0; pointer-events: none; transition: opacity .25s; }

/* ---------- App frame ---------- */
.app { position: relative; display: flex; flex-direction: column; min-height: 100vh; margin-left: 272px; }
/* The exercise-book page: blue rules and a red margin behind the cards */
.app::before {
  content: ''; position: fixed; inset: 0 0 0 272px; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 38px, var(--margin) 38px 40px, transparent 40px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
}
.demo-pita {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px clamp(16px, 3vw, 36px);
  background: repeating-linear-gradient(45deg, #f2b632 0 10px, #1d2733 10px 20px) top / 100% 4px no-repeat, #fff4cf;
  color: #5a3d00; font-size: 12.5px; padding-top: 12px;
}
.demo-pita b { font: 700 19px/1 'Caveat', cursive; }
.demo-pita .select { width: auto; min-height: 30px; padding: 3px 28px 3px 9px; font-size: 12.5px; background-color: #fff; color: #1d2733; }
.demo-pita .link-btn { color: #5a3d00; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 64px;
  padding: 10px clamp(16px, 3vw, 36px) 10px clamp(16px, 3vw, 56px);
  background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-name { overflow: hidden; min-width: 0; font: 600 17px/1.2 'Fraunces', Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
/* Centred in the space beside the sidebar, so the page stays balanced at any zoom or screen width */
.main { flex: 1; width: 100%; max-width: 1360px; margin-inline: auto; padding: 24px clamp(16px, 3vw, 36px) 40px clamp(16px, 3vw, 56px); outline: none; }
.site-footer { width: 100%; max-width: 1360px; margin-inline: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 16px clamp(16px, 3vw, 36px) 22px clamp(16px, 3vw, 56px); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-motto { font: 600 16px/1 'Caveat', cursive; color: var(--pencil-ink); }

/* ---------- Page headings ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 18px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--paper); }
.month-nav strong { min-width: 128px; padding: 0 6px; font-size: 13.5px; text-align: center; }
.month-nav .input { width: auto; min-height: 30px; border: 0; padding: 2px 6px; background: transparent; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .1s, box-shadow .2s;
}
.btn .ph { font-size: 16px; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
/* Shown but not for this role: still clickable, so a click can say why (a toast) */
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 12.5px; }
.btn-primary { border-color: #d39a1a; background: var(--pencil); color: var(--on-pencil); box-shadow: 0 2px 0 #c38b12; }
.btn-primary:hover { border-color: #b7830f; background: #f5c044; }
:root[data-theme="dark"] .btn-primary { border-color: #d9b64e; box-shadow: 0 2px 0 #a88a2e; }
.btn-danger { border-color: rgba(var(--bad), .45); color: rgb(var(--bad)); }
.btn-danger:hover { border-color: rgb(var(--bad)); background: rgba(var(--bad), .08); }
.link-btn { padding: 0; border: 0; background: none; color: var(--k-biru); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field-label { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--field); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23808a96' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pencil); box-shadow: 0 0 0 3px rgba(var(--pencil-rgb), .28); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.tiga { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: #d39a1a; }
.chips-check { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-check label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 12.5px; cursor: pointer; }
.chips-check input { margin: 0; accent-color: #d39a1a; }
/* Timetable class form: tahap in two rows of seven (Pra, D1-D6 / T1-T6, Lain), the seven days in one row */
.chips-tahap, .chips-hari { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.chips-tahap label, .chips-hari label { justify-content: center; padding: 6px 4px; }
.chips-tahap input, .chips-hari input { position: absolute; opacity: 0; pointer-events: none; }
.chips-tahap label, .chips-hari label { position: relative; font-weight: 600; }
.chips-tahap label:has(input:focus-visible), .chips-hari label:has(input:focus-visible) { outline: 2px solid var(--pencil); outline-offset: 1px; }
/* ...and the student count for each week of the month */
.jd-minggu-kepala { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.jd-minggu-kepala .pb-tahun { padding-left: 0; border-left: 0; }
.jd-minggu-kepala .pb-tahun b { min-width: 120px; font-size: 14px; }
.jd-minggu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.jd-mg { display: flex; flex-direction: column; gap: 4px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.jd-mg span { display: flex; justify-content: space-between; gap: 4px; color: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.jd-mg small { color: var(--muted); font-weight: 600; }
.jd-mg.kini { border-color: var(--pencil); }
.jd-mg .input { padding: 6px 8px; text-align: center; }
.jd-mg input[type="date"] { padding: 5px 4px; font-size: 12px; }
.jd-mg.pindah { border-color: var(--k-biru); border-style: dashed; }
.jd-mg.kosong { border-style: dashed; background: transparent; }
.chips-kategori { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips-kategori label { position: relative; justify-content: center; padding: 10px 8px; font-size: 14px; font-weight: 700; }
.chips-kategori input { position: absolute; opacity: 0; pointer-events: none; }
.chips-kategori label:has(input:focus-visible) { outline: 2px solid var(--pencil); outline-offset: 1px; }
.chips-check label:has(input:checked) { border-color: #d39a1a; background: rgba(var(--pencil-rgb), .18); }
/* Tetapan: its four parts as tabs under the banner (superadmin) */
.tab-tetapan { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--paper); }
.tab-tetapan a { display: inline-flex; flex: 1 1 140px; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 6px 14px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.tab-tetapan a .ph { font-size: 16px; }
.tab-tetapan a:hover { background: rgba(var(--pencil-rgb), .12); color: var(--ink); }
.tab-tetapan a[aria-current="page"] { background: var(--pencil); color: var(--on-pencil); }
.tab-tetapan .nav-count { margin-left: 2px; background: rgba(0, 0, 0, .12); color: inherit; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--paper); }
.segmented button { min-height: 30px; padding: 4px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--pencil); color: var(--on-pencil); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .input { max-width: 260px; }
.toolbar .select { width: auto; min-width: 140px; }
.cari { position: relative; flex: 1 1 220px; max-width: 300px; }
.cari .ph { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.cari .input { max-width: none; padding-left: 33px; }
/* Senarai Tutor CFS: the counts stretched across the row, Kemas kini at its end */
.cfs-baris { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-bottom: 16px; }
.cfs-baris .cfs-chips { flex: 1 1 480px; margin: 0; }
.cfs-chips > span { flex: 1 1 auto; justify-content: center; align-items: center; }
.cfs-baris > .head-actions { flex: 0 0 auto; }
.cfs-baris > .head-actions > .btn { height: 100%; }
/* Kemas kini dialog: the last update */
.cfs-terakhir { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.cfs-terakhir > .ph { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: rgba(var(--pencil-rgb), .2); color: var(--pencil-ink); font-size: 18px; }
.cfs-terakhir > span { display: flex; flex-direction: column; line-height: 1.3; }
.cfs-terakhir small { color: var(--muted); font-size: 11.5px; }
.cfs-terakhir small:first-child { color: var(--pencil-ink); font: 600 15px/1.1 'Caveat', cursive; }
.cfs-terakhir b { font-size: 13.5px; }
/* A toolbar whose search and filters share the whole row */
.toolbar-penuh .cari { flex: 2 1 220px; max-width: none; }
.toolbar-penuh .select { flex: 1 1 150px; }

/* ---------- Cards: index cards with a coloured divider tab ---------- */
.acc-kuning { --acc: 242, 182, 50; --acc-ink: var(--k-kuning); }
.acc-hijau { --acc: 52, 168, 105; --acc-ink: var(--k-hijau); }
.acc-biru { --acc: 66, 139, 214; --acc-ink: var(--k-biru); }
.acc-merah { --acc: 222, 86, 76; --acc-ink: var(--k-merah); }
.acc-ungu { --acc: 139, 103, 222; --acc-ink: var(--k-ungu); }
.acc-oren { --acc: 232, 132, 60; --acc-ink: var(--k-oren); }
.card { --acc: 242, 182, 50; --acc-ink: var(--k-kuning);
  position: relative; min-width: 0; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); box-shadow: var(--shadow);
}
.card::before { content: ''; position: absolute; top: -1px; left: 22px; width: 46px; height: 5px; border-radius: 0 0 5px 5px; background: rgb(var(--acc)); }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
/* A card named by its kicker alone: the kicker and the tag on one line */
.card-head:not(:has(.card-title)) { align-items: center; margin-bottom: 12px; }
.card-kicker { display: inline-flex; align-items: center; gap: 5px; color: var(--acc-ink); font: 600 18px/1.1 'Caveat', cursive; }
.card-kicker .ph { font-size: 15px; }
.card-title { margin: 1px 0 0; font: 600 18px/1.25 'Fraunces', Georgia, serif; letter-spacing: -.2px; }
.card-tag { padding: 3px 10px; border-radius: 99px; background: var(--track); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-lebar { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.grid-laporan { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mt { margin-top: 16px; }
.kecil { color: var(--muted); font-size: 12px; }
.note-box { margin: 0; padding: 10px 13px; border-left: 3px solid var(--pencil); border-radius: 0 10px 10px 0; background: rgba(var(--pencil-rgb), .12); color: var(--ink-2); font-size: 13px; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
/* Jadual Mengajar: the three summary cells (classes, students per M, branches) beside Kelas baharu */
.chips-baris { align-items: stretch; flex-wrap: nowrap; }
.chips-baris > .head-actions { align-self: stretch; }
.chips-baris > .head-actions > .btn { flex-direction: column; justify-content: center; gap: 6px; height: 100%; padding-inline: 22px; border-radius: 12px; line-height: 1.2; text-align: center; }
.chips-baris > .head-actions > .btn .ph { font-size: 22px; }
.ringkas-jadual { flex: 1 1 auto; display: grid; grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.2fr) minmax(240px, 1.5fr); gap: 10px; }
.rj-sel { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.rj-tajuk { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rj-tajuk small { margin-left: 4px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.rj-besar { color: var(--ink); font: 600 28px/1 'Fraunces', Georgia, serif; }
.rj-baris { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12.5px; }
.rj-baris b { color: var(--ink); font-weight: 700; }
.rj-m { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; margin-top: 2px; }
.rj-m span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 9px; background: rgba(var(--pencil-rgb), .1); }
.rj-m small { color: var(--muted); font-size: 10.5px; font-weight: 700; }
.rj-m b { color: var(--ink); font: 600 20px/1 'Fraunces', Georgia, serif; }
.rj-cawangan { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 6px; margin-top: 2px; }
.rj-cawangan span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 9px; }
.rj-cawangan small { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.rj-cawangan b { font: 600 20px/1 'Fraunces', Georgia, serif; }
.rj-cawangan .ada { background: rgba(var(--good), .16); color: rgb(var(--good)); box-shadow: inset 0 0 0 1px rgba(var(--good), .35); }
.rj-cawangan .tiada { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--faint); }
@media (max-width: 1100px) {
  .chips-baris { flex-wrap: wrap; }
  .ringkas-jadual { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
.summary-chips > span { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--muted); font-size: 12.5px; }
.summary-chips b { color: var(--ink); font: 600 18px/1 'Fraunces', Georgia, serif; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 16px; color: var(--muted); text-align: center; }
.empty > .ph { font-size: 38px; color: var(--faint); }
.empty p { max-width: 420px; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; color: var(--muted); font-size: 11.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
/* Jadual Mengajar: the branch colour key, and the swatch beside Lokasi */
.legenda-tempat { justify-content: center; gap: 8px 18px; font-size: 12px; }
.legenda-tempat b { color: var(--ink); font-weight: 700; letter-spacing: .03em; }
.tempat-warna { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
/* Pengurusan Kelas: one card per class, in its branch colour */
.kelas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kelas-kad {
  display: flex; flex-direction: column; gap: 8px; padding: 13px 14px 12px; border: 1px solid var(--line-strong); border-top: 4px solid rgb(var(--c));
  border-radius: 12px; background: linear-gradient(180deg, rgba(var(--c), .1), transparent 60%), var(--paper); color: var(--ink);
  font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; transition: transform .12s, box-shadow .2s, border-color .2s;
}
.kelas-kad:hover, .kelas-kad:focus-visible { transform: translateY(-2px); border-color: rgba(var(--c), .7); box-shadow: 0 10px 22px -14px #0007; }
.kk-atas { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kk-atas b { font: 600 15px/1.25 'Fraunces', Georgia, serif; }
.kk-atas small { flex: none; padding: 1px 8px; border-radius: 99px; background: var(--track); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.kk-masa, .kk-matlamat { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.kk-matlamat { align-items: flex-start; color: var(--ink-2); font-style: italic; }
.kk-masa .ph, .kk-matlamat .ph { flex: none; color: rgb(var(--c)); font-size: 14px; }
.kk-kemajuan { display: flex; flex-direction: column; gap: 4px; }
.kk-bar { height: 7px; overflow: hidden; border-radius: 99px; background: var(--track); }
.kk-bar span { display: block; height: 100%; border-radius: inherit; background: rgb(var(--c)); }
.kk-baris { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line-strong); }
.kk-baris > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-label { color: var(--faint); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding-top: 1px; }
.kk-lewat { color: rgb(var(--bad)); font-weight: 600; }
/* the plan in the class dialog: one row per class date */
.kelas-rancangan td { vertical-align: top; }
.kelas-rancangan .input { min-height: 34px; padding: 6px 10px; }
.kelas-rancangan tr.kl-lepas .input { background: transparent; }
.kelas-rancangan tr.kl-bulan th { padding: 14px 10px 6px; border-bottom: 1px solid var(--line-strong); background: none; color: var(--ink); font: 600 14px/1.2 'Fraunces', Georgia, serif; letter-spacing: 0; text-transform: none; }
.kl-tahun-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.kl-tahun-bar .lap-sub { margin: 0; }
.kl-diajar { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: rgb(var(--good)); font-size: 11.5px; font-weight: 600; }
.kl-butiran { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kl-rekod { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.kl-pelajar td { vertical-align: middle; }
.kl-pelajar .input, .kl-pelajar .select { min-height: 34px; padding: 6px 10px; }
.kl-pelajar .select { min-width: 120px; }
.kl-hadir { width: 18px; height: 18px; accent-color: var(--k-biru); cursor: pointer; }
.kl-tambah { display: flex; gap: 8px; margin-top: 10px; }
.kl-tambah .input { flex: 1; min-width: 0; }
.tg-kemajuan { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.tg-kemajuan .textarea { min-height: 42px; }
.tg-terkini { display: flex; align-items: center; gap: 5px; color: var(--k-biru) !important; }

/* Status badges and subject pills */
.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 99px; background: rgba(var(--s), .13); color: rgb(var(--s)); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.status .ph-fill, .status .ph { font-size: 13px; }
/* Jadual Mengajar · Semua kelas: M1–M4, this month's class dates */
.jadual-senarai td.mg-sel, .jadual-senarai th.mg-sel { width: 58px; padding-left: 6px; padding-right: 6px; text-align: center; }
.mg { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 40px; min-height: 38px; padding: 4px 5px 3px; border: 1px solid transparent; border-radius: 8px; line-height: 1; }
.mg b { min-height: 15px; font: 700 15px/1 'DM Sans', sans-serif; }
.mg small { font-size: 10px; font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.mg-buat { background: rgb(var(--good)); color: #fff; }
.mg-cover { background: rgba(var(--good), .2); border-color: rgba(var(--good), .45); color: rgb(var(--good)); }
.mg-tidak { background: rgb(var(--bad)); color: #fff; }
.mg-akan { border: 1px dashed var(--line-strong); color: var(--muted); }
.mg-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; }
.mg-legenda .mg-kecil { min-width: 16px; min-height: 16px; padding: 0; margin-left: 8px; border-radius: 4px; }
.st-good { --s: var(--good); } .st-warn { --s: var(--warn); } .st-bad { --s: var(--bad); } .st-info { --s: var(--info); } .st-mute { --s: var(--mute); }
.pill { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 9px 2px 7px; border-left: 3px solid rgb(var(--c, 242, 182, 50)); border-radius: 4px 8px 8px 4px; background: rgba(var(--c, 242, 182, 50), .16); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-kecil { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--track); color: var(--ink-2); font-size: 11px; font-weight: 600; vertical-align: 1px; }

/* Tables: ruled like an exercise book */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { padding: 8px 10px; border-bottom: 2px solid var(--line-strong); color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; white-space: nowrap; }
.table th.kiri, .table td.kiri { text-align: left; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.table td.judul { text-align: left; font-weight: 600; }
.table td.judul small { display: block; color: var(--muted); font-weight: 400; }
.table td.act { width: 1%; white-space: nowrap; }
.table tbody tr.row-click { cursor: pointer; transition: background .15s; }
.table tbody tr.row-click:hover, .table tbody tr.row-click:focus-visible { background: rgba(var(--pencil-rgb), .1); }
.table tfoot td { border-bottom: 0; border-top: 2px solid var(--line-strong); font-weight: 700; }
.table tr.pilih td { background: rgba(var(--pencil-rgb), .12); }
.tarikh-sel { display: flex; align-items: center; gap: 9px; text-align: left; }
.tarikh-sel b { display: grid; place-items: center; width: 36px; height: 38px; border: 1px solid var(--line-strong); border-top: 5px solid var(--red-pen); border-radius: 6px; background: var(--paper-2); font: 600 15px/1 'Fraunces', serif; }
.tarikh-sel span { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.kehadiran { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.kh-bar { flex: 1; height: 7px; border-radius: 99px; background: var(--track); overflow: hidden; }
.kh-bar { display: block; }
.kh-isi { display: block; height: 100%; border-radius: 99px; background: rgb(var(--k, var(--good))); }
.tutor-sel { display: flex; align-items: center; gap: 10px; text-align: left; }
.tutor-sel .user-avatar { border-color: var(--pencil); color: var(--pencil-ink); }
.tutor-sel { min-width: 190px; }
.tutor-sel b { display: block; font-size: 13px; white-space: nowrap; }
.tutor-sel small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.kehadiran b { min-width: 52px; font-size: 12px; text-align: right; }

/* ---------- Pencil progress bars (colour pencils: green on target, yellow close, red behind) ---------- */
.pensel { --pc: 242, 182, 50; position: relative; height: 13px; margin-right: 12px; border-radius: 7px; background: var(--track); }
.pensel[data-tahap="good"] { --pc: 74, 178, 116; }
.pensel[data-tahap="bad"] { --pc: 226, 92, 80; }
.pensel-isi {
  position: relative; height: 100%; min-width: 16px; border-radius: 7px 0 0 7px;
  background: linear-gradient(180deg, #ffffff59 0 32%, transparent 32% 68%, #00000014 68%), rgb(var(--pc));
  transition: width .7s cubic-bezier(.2, .7, .2, 1);
}
.pensel-isi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; border-radius: 7px 0 0 7px; background: #f29aa0; box-shadow: inset -3px 0 0 #c8c2b4; }
.pensel-isi::after { content: ''; position: absolute; right: -11px; top: 0; width: 11px; height: 100%; background: linear-gradient(90deg, #ebcda4 0 58%, #3b3b3b 58%); clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* ---------- Grade stamp (red-pen circle on the report card) ---------- */
.gred { --g: var(--bad); flex: none; display: grid; place-items: center; align-content: center; width: 96px; height: 96px; border: 3px solid rgb(var(--g)); border-radius: 50%; box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5.5px rgba(var(--g), .8); color: rgb(var(--g)); transform: rotate(-9deg); text-align: center; }
.gred[data-tahap="good"] { --g: var(--good); } .gred[data-tahap="warn"] { --g: var(--warn); }
.gred b { font: 700 34px/1 'Fraunces', Georgia, serif; letter-spacing: -1px; }
.gred small { margin-top: 3px; font: 700 9.5px/1 'DM Sans', sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.gred.kecil { width: 46px; height: 46px; border-width: 2px; box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px rgba(var(--g), .8); transform: rotate(-7deg); }
.gred.kecil b { font-size: 17px; }
.gred.kecil small { display: none; }
.gred-teks { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 2px 7px; border: 1.5px solid rgb(var(--g)); border-radius: 99px; color: rgb(var(--g)); font: 700 13px/1.2 'Fraunces', serif; }
.gred-teks[data-tahap="good"] { --g: var(--good); } .gred-teks[data-tahap="warn"] { --g: var(--warn); } .gred-teks[data-tahap="bad"] { --g: var(--bad); }
.gred-teks[data-tahap="mute"] { --g: var(--mute); border-style: dashed; }

/* ---------- Laman Utama ---------- */
/* The chalkboard banner (greeting on Laman Utama, topic on every other page):
   a board (::before) set in a wooden frame (the element's own background), a stick of chalk on the ledge (::after) */
.papan { position: relative; isolation: isolate; margin-bottom: 18px; border-radius: 18px; color: #eef0e6;
  background: repeating-linear-gradient(92deg, #ffffff0d 0 2px, transparent 2px 9px, #0000000f 9px 11px, transparent 11px 23px), linear-gradient(180deg, #9a6a3f, #7c4f2c 55%, #6a4224);
  box-shadow: 0 1px 0 #ffffff26 inset, 0 -2px 0 #00000033 inset, var(--shadow); }
.papan::before { content: ''; position: absolute; inset: 9px; z-index: -1; border-radius: 11px;
  background: radial-gradient(38% 70% at 22% 30%, #ffffff10, transparent 70%), radial-gradient(30% 60% at 70% 80%, #ffffff0a, transparent 70%), radial-gradient(120% 140% at 0% 0%, #2b4a3e, transparent 65%), #1f362d;
  box-shadow: inset 0 2px 6px #00000066, inset 0 0 0 1px #00000040; }
/* A stick of chalk resting on the frame's ledge */
.papan::after { content: ''; position: absolute; right: 72px; bottom: 3px; width: 34px; height: 6px; border-radius: 3px; background: linear-gradient(180deg, #fbfaf3, #d9d6c7); box-shadow: 0 1px 1px #00000055; transform: rotate(-2deg); }
/* Greeting layout: greeting | portal name | clock */
.salam { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px 32px; padding: 26px 30px 28px; }
/* Topic banner: the page's eyebrow and name, its icon chalked faintly on the right */
.papan-topik { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 30px 26px; }
.papan-teks { min-width: 0; }
.papan-h1 { margin: 0; font: 600 clamp(25px, 3.2vw, 34px)/1.15 'Fraunces', Georgia, serif; letter-spacing: -.01em; text-shadow: 0 0 1px #eef0e666; }
/* Right of the topic: today's day (yellow chalk) over the date */
.papan-tarikh { flex: none; display: grid; justify-items: end; gap: 2px; text-align: right; }
.papan-tarikh .salam-hari { font-size: 24px; }
.papan-tarikh b { color: #eef0e6; font: 600 20px/1.1 'Fraunces', Georgia, serif; white-space: nowrap; }
/* The row under the banner: buttons and period picker, kept to the right */
.page-alat { justify-content: flex-end; }
/* The period picker in the row under the banner: twelve months, then the year switcher at the far right */
.papan-masa { display: inline-flex; align-items: center; gap: 6px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--paper); }
.pb-senarai { display: flex; gap: 1px; }
/* A month picker stretches across the whole row; any buttons beside it keep their own width */
.page-alat .head-actions:has(.pb-senarai) { flex: 1 1 auto; }
.papan-masa:has(.pb-senarai) { display: flex; flex: 1 1 auto; }
.papan-masa .pb-senarai { flex: 1 1 auto; }
.pb-senarai .pb-bulan { flex: 1 1 0; }
.pb-bulan { min-width: 38px; padding: 7px 4px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink-2); font: 600 12.5px/1 'DM Sans', sans-serif; text-align: center; cursor: pointer; transition: background .15s, color .15s; }
.pb-bulan:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.pb-bulan.kini { border: 1px dashed rgba(var(--pencil-rgb), .9); }
.pb-bulan.aktif { border: 1px solid var(--pencil); background: var(--pencil); color: var(--on-pencil); }
.pb-bulan:disabled { color: var(--faint); opacity: .45; cursor: not-allowed; }
.pb-tahun { display: flex; align-items: center; gap: 2px; padding-left: 6px; border-left: 1px solid var(--line-strong); }
.papan-masa > .pb-tahun:only-child { padding-left: 0; border-left: 0; }
.pb-tahun b { min-width: 48px; color: var(--ink); font: 600 16px/1 'Fraunces', Georgia, serif; text-align: center; }
.pb-panah { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font-size: 15px; cursor: pointer; }
.pb-panah:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.pb-panah:disabled { opacity: .3; cursor: not-allowed; }
.pb-bulan:focus-visible, .pb-panah:focus-visible, .pb-setahun:focus-visible { outline: 2px solid var(--pencil); outline-offset: 1px; }
.pb-setahun { padding: 5px 6px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; transition: background .15s; }
.pb-setahun:hover { background: var(--paper-2); }
.pb-setahun.aktif { border-color: var(--pencil); background: var(--pencil); }
.pb-setahun.aktif b { color: var(--on-pencil); }
/* Left: the greeting */
.salam-teks { min-width: 0; text-align: left; }
.salam-ucap { display: block; margin-bottom: 2px; color: #eef0e6cc; font: 600 clamp(22px, 2.4vw, 27px)/1.1 'Caveat', cursive; }
.salam h1 { margin: 0; font: 600 clamp(26px, 3.6vw, 38px)/1.15 'Fraunces', Georgia, serif; letter-spacing: -.01em; text-shadow: 0 0 1px #eef0e666; }
.salam-nama { position: relative; color: #f3d36b; white-space: nowrap; }
.salam-nama::after { content: ''; position: absolute; left: -2px; right: -4px; bottom: -7px; height: 9px; opacity: .85;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6.5C22 3 44 2.5 64 4.5S100 7.5 118 3' fill='none' stroke='%23f3d36b' stroke-width='2.6' stroke-linecap='round' stroke-dasharray='30 2 18 1.5 60'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.salam-ket { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; color: #eef0e6b8; }
.salam-cip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border: 1px dashed #eef0e64d; border-radius: 99px; background: #ffffff0a; color: #eef0e6d9; font-size: 12.5px; line-height: 1.3; }
.salam-cip i { font-size: 15px; color: #f3d36b; }
.salam-cip b { color: #eef0e6; font-weight: 700; letter-spacing: .06em; }
.salam-cip.cip-ok i { color: #8fd6a8; }
/* Middle: the portal's name, chalked between two short rules */
.salam-portal { display: flex; align-items: center; gap: 10px; margin: 0; color: #f3d36b; font: 600 clamp(22px, 2.3vw, 28px)/1.1 'Caveat', cursive; white-space: nowrap; }
.salam-portal i { font-size: .95em; }
.salam-portal::before, .salam-portal::after { content: ''; width: 26px; height: 0; border-top: 1.5px dashed #f3d36b66; }
/* Right: a chalk clock with day, date and time, set off by a chalk rule */
.salam-masa { justify-self: end; display: flex; align-items: center; gap: 16px;padding-left: 28px; border-left: 1.5px dashed #eef0e640; }
.salam-jam-muka { flex: none; width: 70px; height: 70px; fill: none; stroke: #eef0e6; stroke-linecap: round; }
.salam-jam-muka > circle:first-child { stroke-width: 1.6; stroke-opacity: .7; stroke-dasharray: 40 1.5 60 2 70; }
.salam-jam-muka line { stroke-width: 1.6; stroke-opacity: .75; }
.salam-jam-muka .tik-kecil { stroke-width: 1; stroke-opacity: .45; }
.salam-jam-muka .jarum-jam { stroke-width: 3; stroke-opacity: 1; }
.salam-jam-muka .jarum-minit { stroke: #f3d36b; stroke-width: 2; stroke-opacity: 1; }
.salam-jam-muka .pusat { fill: #f3d36b; stroke: none; }
.salam-masa-teks { display: grid; gap: 1px; text-align: left; }
.salam-hari { color: #f3d36b; font: 600 21px/1 'Caveat', cursive; }
.salam-masa b { color: #eef0e6cc; font: 600 14px/1.3 'DM Sans', sans-serif; letter-spacing: .02em; }
.salam-jam { margin-top: 2px; color: #eef0e6; font: 600 28px/1.05 'Fraunces', Georgia, serif; letter-spacing: -.01em; white-space: nowrap; }
/* Team banner (ket is a sentence) */
.salam-ket b { color: #eef0e6; letter-spacing: .03em; }
.salam-ket .kecil { color: #eef0e68a; font-style: italic; }
.timeline { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.tl-item { position: relative; display: grid; grid-template-columns: 70px 16px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; }
.tl-item + .tl-item { border-top: 1px dashed var(--line-strong); }
.tl-masa { color: var(--ink-2); font: 600 13px/1.25 'DM Sans', sans-serif; text-align: right; }
.tl-masa small { display: block; color: var(--muted); font-weight: 500; }
.tl-titik { width: 14px; height: 14px; border: 3px solid rgb(var(--c, 242, 182, 50)); border-radius: 50%; background: var(--paper); }
.tl-item.selesai .tl-titik { background: rgb(var(--c, 242, 182, 50)); }
.tl-kelas { min-width: 0; }
.tl-kelas b { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.tl-kelas span { color: var(--muted); font-size: 12px; }
.kad-laporan { display: grid; grid-template-columns: minmax(0, 1fr); }
.kl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 10px; }
.kl-sel { display: flex; flex-direction: column; gap: 7px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); text-align: left; cursor: pointer; transition: border-color .2s, transform .15s; }
button.kl-sel { width: 100%; color: inherit; }
.kl-sel:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kl-atas { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.kl-atas .ph { color: var(--muted); font-size: 16px; }
.kl-nilai { font: 600 24px/1 'Fraunces', Georgia, serif; }
.kl-nilai small { margin-left: 3px; color: var(--muted); font: 500 12px/1 'DM Sans', sans-serif; }
.kl-nota { color: var(--muted); font-size: 11.5px; }
.kl-bobot { color: var(--faint); font-size: 11px; font-weight: 600; }
.senarai { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.senarai > li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.senarai > li:last-child { border-bottom: 0; }
/* Hari Bekerja › Time off & ganti masa: the day, then its badges underneath */
.senarai > li.to-hari { flex-direction: column; align-items: stretch; gap: 6px; }
.to-hari a.ev-teks { color: inherit; text-decoration: none; }
.to-hari a.ev-teks:hover b { text-decoration: underline; }
.to-hari .lap-status { margin-top: 0; }
.senarai > li.row-click { cursor: pointer; border-radius: 8px; }
.senarai > li.row-click:hover { background: rgba(var(--pencil-rgb), .09); }
.ev-tarikh { flex: none; display: grid; place-items: center; width: 42px; padding: 3px 0 4px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-2); line-height: 1; text-align: center; }
.ev-tarikh small { width: 100%; padding-bottom: 3px; border-bottom: 1px solid var(--line); color: var(--red-pen); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ev-tarikh b { padding-top: 4px; font: 600 17px/1 'Fraunces', serif; }
.ev-teks { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ev-teks b { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.ev-teks span { color: var(--muted); font-size: 12px; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-txt { fill: var(--muted); font: 500 10.5px 'DM Sans', sans-serif; }
.axis-txt.kini { fill: var(--red-pen); font-weight: 700; }
.bar-mark { fill: rgb(var(--pencil-rgb)); }
.bar-mark.capai { fill: rgb(74, 178, 116); }
.bar-cuti { fill: url(#arsir); }
.target-line { stroke: var(--red-pen); stroke-width: 1.6; stroke-dasharray: 6 5; }
.target-txt { fill: var(--red-pen); font: 600 16px 'Caveat', cursive; }
.line-mark { fill: none; stroke: rgb(var(--info)); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.line-mark.dua { stroke: rgb(var(--good)); stroke-dasharray: 2 5; }
.area-mark { fill: rgba(var(--info), .1); }
.dot-mark { fill: var(--paper); stroke: rgb(var(--info)); stroke-width: 2.5; }
.hit { fill: transparent; cursor: pointer; }
.chart-tip { position: fixed; z-index: 120; max-width: 260px; padding: 8px 11px; border-radius: 10px; background: #1d2733; color: #fff; font-size: 12px; line-height: 1.4; pointer-events: none; box-shadow: 0 8px 24px #0005; }
:root[data-theme="dark"] .chart-tip { background: #eef0e6; color: #1d2733; }

/* ---------- Laporan Harian ---------- */
.lap-bulan { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.lap-hari { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); color: var(--ink); cursor: pointer; transition: transform .12s, border-color .2s; }
.lap-hari b { font: 600 14px/1 'Fraunces', serif; }
.lap-hari i { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 600; }
.lap-hari:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.lap-hari.ada { border-color: rgba(var(--good), .5); background: rgba(var(--good), .12); }
.lap-hari.ada::after { content: '✓'; position: absolute; top: 2px; right: 5px; color: rgb(var(--good)); font: 700 15px/1 'Caveat', cursive; }
.lap-hari.tiada { border-color: rgba(var(--bad), .45); background: rgba(var(--bad), .07); }
.lap-hari.cuti { border-style: dashed; background: repeating-linear-gradient(135deg, var(--track) 0 2px, transparent 2px 7px); }
.lap-hari.draf { border-color: rgba(var(--pencil-rgb), .75); background: rgba(var(--pencil-rgb), .16); }
.lap-hari.draf::after { content: '✎'; position: absolute; top: 2px; right: 5px; color: var(--pencil); font: 700 11px/1 'DM Sans', sans-serif; }
.lap-hari.awal:not(.draf) { border-style: dashed; background: var(--paper); }
.lap-hari.kunci { opacity: .45; cursor: not-allowed; }
.lap-hari.aktif { outline: 2.5px solid var(--pencil); outline-offset: 1px; }
.lap-hari.goyang { animation: goyang .35s; }
@keyframes goyang { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.lg-kotak { display: inline-block; width: 13px; height: 13px; border: 1px solid var(--line-strong); border-radius: 4px; }
.lg-kotak.ada { border-color: rgba(var(--good), .5); background: rgba(var(--good), .2); }
.lg-kotak.draf { border-color: rgba(var(--pencil-rgb), .75); background: rgba(var(--pencil-rgb), .25); }
.lap-buka { display: block; margin-top: 3px; color: var(--ink-2); }
.lg-kotak.tiada { border-color: rgba(var(--bad), .45); background: rgba(var(--bad), .12); }
.lg-kotak.cuti { border-style: dashed; background: repeating-linear-gradient(135deg, var(--track) 0 2px, transparent 2px 5px); }
.lap-sub { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--ink-2); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.lap-sub .ph { color: var(--pencil-ink); font-size: 16px; }
.lap-sub .chip-kecil { margin-left: auto; }
/* Laporan Harian: each part of the report is its own card; the save bar is a slim card pinned to the bottom while scrolling */
.card.lap-kaki-kad { position: sticky; bottom: 12px; z-index: 5; padding: 12px 16px; border-top: 1px solid var(--line); box-shadow: 0 -2px 18px rgba(0, 0, 0, .08), var(--shadow); }
.card.lap-kaki-kad::before { content: none; }
.lap-masa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.syif-pilih label { padding: 8px 14px; font-size: 13px; }
.syif-pilih b { font-weight: 700; }
.lap-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lap-rehat-senarai:empty { display: none; }
.lap-rehat .field small { font-weight: 400; }
.lap-rehat-senarai { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lap-rehat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
/* Meeting and video rows in the daily report */
.lap-mesy { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.lap-mesy .lap-sub { margin: 0; }
.lap-mesy .lap-tambah { margin-top: 0; }
.lap-lain { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.lap-lain .textarea { min-height: 60px; }
.btn-block { width: 100%; justify-content: center; }
.masa-video { display: flex; flex-wrap: wrap; gap: 10px; }
.masa-video label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.masa-video .input { width: 92px; text-align: center; font-variant-numeric: tabular-nums; }
.field [data-durasi-kira] b { color: var(--ink); }
/* Perjumpaan Tutor: one card per tutor (management), and the CFS picker in the dialog */
.jumpa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.jumpa-table th, .jumpa-table td { text-align: center; }
.jumpa-table td.judul, .jumpa-table th.kiri { text-align: left; }
.jumpa-buang { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--faint); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.jumpa-buang .ph { font-size: 15px; }
.jumpa-buang:hover, .jumpa-buang:focus-visible { border-color: rgba(var(--bad), .4); background: rgba(var(--bad), .08); color: rgb(var(--bad)); }
.jumpa-senarai { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.jumpa-calon { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.jumpa-calon[hidden] { display: none; }
.jumpa-calon:has(input:checked) { border-color: #d39a1a; background: rgba(var(--pencil-rgb), .14); }
.jumpa-calon input { margin-top: 3px; }
.jumpa-calon span { display: flex; flex-direction: column; min-width: 0; }
.jumpa-calon b { font-size: 12.5px; font-weight: 600; }
.jumpa-calon small { color: var(--muted); font-size: 11px; }
.jumpa-calon em { color: rgb(var(--warn)); font-style: normal; font-weight: 600; }
/* Livestream: the platform, with its logo, in the dialog and the lists */
.live-pilih label { gap: 6px; }
.live-pilih label .ph { font-size: 16px; }
.live-media { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.live-medium { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
.live-medium .ph { font-size: 16px; }
.live-medium.m-tiktok .ph { color: var(--ink); }
.live-medium.m-facebook .ph { color: #1877f2; }
.live-medium.m-instagram .ph { color: #d62976; }
.live-medium.m-youtube .ph { color: #e62117; }
.lap-dua { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.lap-dua .btn { justify-content: center; }
.lap-tambah { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12.5px; }
.lap-kelas { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lap-kelas li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.lap-kelas li .ev-teks b { font-size: 13px; }
.lap-kelas li.direkod { border-color: rgba(var(--good), .35); }
.lap-kaki { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.baca-sahaja { margin: 0; padding: 0; border: 0; min-width: 0; }

/* ---------- Jadual Mengajar: the school timetable ---------- */
.jw { --jam-h: 54px; overflow-x: auto; }
.jw-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(108px, 1fr)); min-width: 820px; }
.jw-kepala { position: sticky; top: 0; z-index: 2; padding: 8px 6px; border-bottom: 2px solid var(--line-strong); background: var(--paper); font-size: 12px; font-weight: 700; text-align: center; }
.jw-kepala.kini { color: var(--red-pen); }
.jw-kepala small { display: block; color: var(--muted); font-weight: 500; }
.jw-jam { position: relative; border-right: 1px solid var(--line-strong); }
.jw-jam span { position: absolute; right: 8px; color: var(--muted); font-size: 10.5px; transform: translateY(-50%); }
.jw-jam span:first-child { transform: translateY(2px); }
.jw-jam span:last-child { transform: translateY(-100%); }
.jw-hari { position: relative; border-right: 1px solid var(--line); background: repeating-linear-gradient(180deg, transparent 0 calc(var(--jam-h) - 1px), var(--line) calc(var(--jam-h) - 1px) var(--jam-h)); }
.jw-hari.kini { background-color: rgba(var(--pencil-rgb), .07); }
/* the tutor's weekly off day (Hari off): hatched, as on Hari Bekerja */
.jw-hari.off { background-image: repeating-linear-gradient(135deg, var(--track) 0 2px, transparent 2px 7px), repeating-linear-gradient(180deg, transparent 0 calc(var(--jam-h) - 1px), var(--line) calc(var(--jam-h) - 1px) var(--jam-h)); }
.jw-kepala.off { color: var(--muted); }
.jw-kepala.off small { color: var(--faint); font-weight: 700; letter-spacing: .06em; }
.jw-blok {
  position: absolute; left: 4px; right: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; overflow: hidden; padding: 5px 7px;
  border: 0; border-left: 4px solid rgb(var(--c)); border-radius: 5px 9px 9px 5px; color: var(--ink);
  /* opaque: the tint laid over solid paper, so the grid lines and today's column do not show through */
  background: linear-gradient(rgba(var(--c), .22), rgba(var(--c), .22)), var(--paper);
  font-size: 11.5px; line-height: 1.25; text-align: center; cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.jw-blok b, .jw-blok span { max-width: 100%; }
.jw-blok:hover { z-index: 1; transform: scale(1.02); box-shadow: 0 6px 16px -8px #0006; }
.jw-blok b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.jw-blok span { overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.jw-blok.tidak-aktif { opacity: .45; border-left-style: dashed; }
/* two active classes at the same time (saved before the check): flagged until one is moved */
.jw-blok.bertindih { outline: 2px dashed rgb(var(--bad)); outline-offset: -2px; }
.jw-blok.bertindih b .ph-fill { color: rgb(var(--bad)); }
.jw-senarai { display: none; }

/* ---------- Bahan Mengajar: index cards on a board ---------- */
.papan-kad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kolum { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 14px; background: color-mix(in srgb, var(--paper) 55%, transparent); }
.kolum-kepala { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kolum-kepala b { font: 600 19px/1 'Caveat', cursive; }
.kad-nota {
  --c: 250, 204, 21; position: relative; display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 14px 13px 11px;
  border: 0; border-radius: 3px; background: linear-gradient(180deg, rgba(var(--c), .34), rgba(var(--c), .24)), var(--paper);
  box-shadow: 0 1px 0 #00000014, 0 10px 16px -12px #0007; color: var(--ink); text-align: left; cursor: pointer;
  transform: rotate(-.6deg); transition: transform .15s;
}
.kad-nota:nth-child(even) { transform: rotate(.7deg); }
.kad-nota:hover { transform: rotate(0) translateY(-2px); }
.kad-nota::before { content: ''; position: absolute; top: -7px; left: 50%; width: 46px; height: 14px; background: #ffffff8c; transform: translateX(-50%) rotate(-2deg); box-shadow: 0 1px 2px #0002; }
:root[data-theme="dark"] .kad-nota::before { background: #ffffff30; }
.kad-jenis { color: var(--ink-2); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kad-tajuk { font: 600 15px/1.25 'Fraunces', serif; }
.kad-ket { color: var(--ink-2); font-size: 12px; }

/* ---------- Takwim ---------- */
.bulan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.bulan-kad { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.bulan-kad.kini { border-color: var(--pencil); box-shadow: 0 0 0 2px rgba(var(--pencil-rgb), .35), var(--shadow); }
.bulan-kad header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bulan-kad h3 { margin: 0; font: 600 17px/1.2 'Fraunces', serif; }
.ev-item { display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-left: 3px solid rgb(var(--c, 242, 182, 50)); border-radius: 3px 8px 8px 3px; background: rgba(var(--c, 242, 182, 50), .12); color: var(--ink); font-size: 12.5px; text-align: left; cursor: pointer; }
.ev-item .ph { margin-top: 2px; color: rgb(var(--c, 242, 182, 50)); }
.ev-item span { display: flex; flex-direction: column; min-width: 0; }
.ev-item small { color: var(--muted); font-size: 11px; }
.ev-kosong { color: var(--faint); font: 500 16px/1.2 'Caveat', cursive; }

/* ---------- Hari Bekerja ---------- */
.hk-kalendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hk-kepala { padding-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; }
.hk-hari { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); color: var(--ink); cursor: pointer; }
.hk-hari b { font: 600 16px/1 'Fraunces', serif; }
.hk-hari i { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 10.5px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.hk-hari:disabled { cursor: default; }
.hk-hari.kini { outline: 2.5px solid var(--red-pen); outline-offset: 1px; }
.hk-hari.kerja { border-color: rgba(var(--good), .35); }
.hk-hari[class*="c-"] { border-style: dashed; }
.c-PH { --h: 222, 86, 76; } .c-OFF { --h: 120, 128, 140; } .c-AL { --h: 66, 139, 214; } .c-MC { --h: 232, 132, 60; }
.c-EL { --h: 139, 103, 222; } .c-UPL { --h: 160, 120, 80; } .c-CB { --h: 214, 92, 160; } .c-OT { --h: 22, 150, 140; }
.hk-hari[class*="c-"], .lg-kotak[class*="c-"] { border-color: rgba(var(--h), .6); background: rgba(var(--h), .14); }
.hk-hari[class*="c-"] i { color: rgb(var(--h)); }
.lg-kotak.kerja { border-color: rgba(var(--good), .45); background: var(--paper-2); }
/* Hari Bekerja: the weekly off day, a small picker beside Kunci bulan ini */
.hk-offpilih { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.hk-offpilih .select { width: auto; min-width: 104px; min-height: 32px; padding: 4px 30px 4px 10px; font-size: 12.5px; }
.hk-kosong { min-height: 1px; }
.hk-dikunci { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 10px 13px; border-radius: 10px; background: rgba(var(--info), .1); color: var(--ink-2); font-size: 13px; }
.hk-dikunci .ph-fill { color: rgb(var(--info)); font-size: 18px; }
.hk-pilihan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hk-pilihan .check { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.hk-pilihan .check:has(input:checked) { border-color: #d39a1a; background: rgba(var(--pencil-rgb), .12); }

/* ---------- Target Tutor ---------- */
.kpi-bahagian { display: flex; flex-direction: column; gap: 10px; }
.kpi-baris { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
.kpi-baris .pensel { grid-column: 1 / -1; }
.kpi-angka { font: 600 26px/1 'Fraunces', serif; }
.kpi-angka small { color: var(--muted); font: 500 13px 'DM Sans', sans-serif; }
.kpi-ukur { margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 12.5px; }
.kpi-ukur li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dotted var(--line-strong); }
.kpi-ukur li:last-child { border-bottom: 0; }
.kpi-ukur b { font-variant-numeric: tabular-nums; }
.rapor td.gred-sel { padding: 6px 4px; }

/* ---------- Pengguna & Tetapan ---------- */
.peranan-ket { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.peranan-ket li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); color: var(--muted); font-size: 12.5px; }
.peranan-ket b { color: var(--ink); font-size: 13px; }
.peranan-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.tutor-senarai { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tutor-senarai li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); cursor: pointer; }
.tutor-senarai li:hover { border-color: var(--line-strong); }
.tutor-senarai .user-avatar { border-color: var(--pencil); color: var(--pencil-ink); }
.tutor-senarai li.tamat { opacity: .6; }
.pulih-ringkas, .pulih-ralat { margin: 10px 0; padding-left: 18px; font-size: 13px; }

/* ---------- Dialog ---------- */
.dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--dialog-bg); color: var(--ink); box-shadow: 0 30px 80px -20px #0008; }
.dialog.dialog-lebar { width: min(860px, calc(100vw - 24px)); }
.dialog::backdrop { background: #0e1a15a6; backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.dialog-title { margin: 0; font: 600 19px/1.25 'Fraunces', Georgia, serif; }
.dialog-body { overflow-y: auto; padding: 16px 18px; }
.dialog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.dialog-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.form-sub { margin: 6px 0 -4px; padding-top: 12px; border-top: 1px dashed var(--line); font: 600 15px/1.3 'Fraunces', Georgia, serif; color: var(--ink); }
.borang-bahagian { margin: 0 0 14px; padding: 0 0 14px; border: 0; border-bottom: 1px dashed var(--line-strong); }
.borang-bahagian:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.borang-bahagian > legend { padding: 0; margin-bottom: 10px; color: var(--pencil-ink); font: 600 18px/1 'Caveat', cursive; }

/* ---------- Toast & save status ---------- */
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 130; max-width: min(520px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: #1d2733; color: #fff; font-size: 13px; box-shadow: 0 12px 30px #0005; transform: translateX(-50%); }
:root[data-theme="dark"] .toast { background: #eef0e6; color: #1d2733; }
.simpan-status { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; max-width: min(420px, calc(100vw - 32px)); padding: 8px 13px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line-strong); color: var(--ink-2); font-size: 12px; box-shadow: var(--shadow); }
.simpan-status[data-jenis="ok"] { border-color: rgba(var(--good), .5); color: rgb(var(--good)); }
.simpan-status[data-jenis="tunggu"] { border-color: rgba(var(--warn), .6); color: rgb(var(--warn)); }
.simpan-status[data-jenis="gagal"] { border-color: rgba(var(--bad), .6); color: rgb(var(--bad)); }
.lahu-amaran { position: fixed; left: 50%; top: 18px; z-index: 140; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: min(520px, calc(100vw - 24px)); padding: 12px 14px; border: 1px solid rgba(var(--warn), .6); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 40px #0005; transform: translateX(-50%); }
.lahu-amaran > .ph { color: rgb(var(--warn)); font-size: 24px; }
.lahu-amaran > div { display: flex; flex-direction: column; flex: 1; min-width: 180px; font-size: 12.5px; }

/* ---------- Panduan (guide + tour) ---------- */
.panduan { width: min(620px, calc(100vw - 24px)); padding: 0; overflow-y: auto; }
.panduan-kepala { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.panduan-logo { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: rgba(var(--pencil-rgb), .2); color: var(--pencil-ink); font-size: 22px; }
.panduan-kepala > div { flex: 1; }
.panduan-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panduan-pilih { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 18px 18px; }
.panduan-topik { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); color: var(--ink); text-align: left; cursor: pointer; }
.panduan-topik:hover { border-color: var(--pencil); }
.pt-ikon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--paper); color: var(--pencil-ink); font-size: 18px; }
.pt-teks { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.pt-teks b { font-size: 13px; }
.pt-teks small { color: var(--muted); font-size: 11.5px; }
.pt-bil { color: var(--faint); font: 600 18px/1 'Caveat', cursive; }
/* HELP!!!: two buttons stretched across one row (Panduan | Peraturan); the picked one opens below */
.bantuan-pilih { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 18px; }
.bantuan-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper-2); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.bantuan-btn:hover { border-color: var(--pencil); }
.bantuan-btn[aria-pressed="true"] { border-color: var(--pencil); background: rgba(var(--pencil-rgb), .16); }
.bantuan-btn .pt-teks b { font-size: 15px; }
.bantuan-isi { border-top: 1px solid var(--line); }
.bantuan-isi .panduan-pilih { padding-top: 0; }
.bantuan-nota { margin: 0; padding: 12px 18px 10px; color: var(--muted); font-size: 12.5px; }
.peraturan { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 18px; }
.peraturan-sek { border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.peraturan-sek summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.peraturan-sek summary::-webkit-details-marker { display: none; }
.peraturan-sek summary b { flex: 1; font-size: 14px; }
.peraturan-sek summary > .ph:last-child { color: var(--muted); transition: transform .2s; }
.peraturan-sek[open] summary > .ph:last-child { transform: rotate(180deg); }
.peraturan-bil { color: var(--faint); font-size: 11.5px; }
.peraturan-sek ol { margin: 0; padding: 2px 16px 14px 36px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.peraturan-sek li + li { margin-top: 6px; }
.peraturan-sek li::marker { color: var(--pencil-ink); font-weight: 700; }
.tur { position: fixed; inset: 0; z-index: 150; }
.tur-sekat { position: absolute; inset: 0; }
.tur-sorot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 3px var(--pencil), 0 0 0 9999px #0e1a15b0; transition: all .3s ease; pointer-events: none; }
.tur-sorot.tengah { box-shadow: 0 0 0 9999px #0e1a15b0; }
.tur-kotak { position: fixed; padding: 15px 16px 13px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 50px #0007; outline: none; }
.tur-kicker { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--pencil-ink); font: 600 17px/1 'Caveat', cursive; }
.tur-tajuk { margin: 4px 0 6px; font: 600 17px/1.25 'Fraunces', serif; }
.tur-teks { color: var(--ink-2); font-size: 13px; }
.tur-titik { display: flex; gap: 4px; margin: 12px 0 10px; }
.tur-titik i { width: 7px; height: 7px; border-radius: 50%; background: var(--track); }
.tur-titik i.ini { width: 18px; border-radius: 99px; background: var(--pencil); }
.tur-kaki { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------- Login: a chalkboard in a wooden frame, a sheet of paper (the gold logo + form) centred on it ---------- */
.login {
  --bingkai: clamp(8px, 1.6vw, 16px); /* the wooden frame */
  position: fixed; inset: 0; z-index: 90; display: none; overflow: hidden;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  padding: calc(var(--bingkai) + 2px);
  background: radial-gradient(70% 60% at 30% 20%, #ffffff10, transparent 70%), radial-gradient(60% 50% at 80% 90%, #ffffff0b, transparent 70%), #1f3a30;
  box-shadow: inset 0 0 0 var(--bingkai) #8b5a33, inset 0 0 0 calc(var(--bingkai) + 2px) #00000055, inset 0 0 120px #0000006b;
}
.perlu-masuk .login { display: grid; }
.perlu-masuk body { overflow: hidden; }
/* The board: its own cell inside the frame, so the chalk never reaches the wood */
.papan { grid-area: 1 / 1; position: relative; overflow: hidden; pointer-events: none; }
.papan-defs { position: absolute; }
.papan-lukis { display: block; width: 100%; height: 100%; }
.k-tengah { display: none; }
.kapur { fill: #eef0e6; stroke: #eef0e6; opacity: .3; }
.kapur text { stroke: none; font-family: 'Caveat', cursive; font-weight: 600; }
.k-besar { font-size: 58px; } .k-sederhana { font-size: 44px; } .k-kecil { font-size: 34px; } .k-label { font-size: 26px; }
.k-garis { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
/* The card: centred on the board, clear of the frame top and bottom. A board-green header holds the gold logo
   (it is made for a dark ground), cream paper below; it scrolls inside if the screen is short */
.kertas {
  --ink: #173a2d; --ink-2: #2c4a3e; --muted: #5f6d66; --faint: #8a958f; --line: #173a2d1a; --line-strong: #173a2d2e; --field: #ffffff; --paper: #faf6ec; --track: #ece5d3;
  --pencil: #d4a12a; --pencil-rgb: 212, 161, 42; --on-pencil: #2b1d00; --k-biru: #1e60a4; --bad: 196, 52, 46;
  color: var(--ink); color-scheme: light;
}
.login-panel {
  grid-area: 1 / 1; place-self: center; position: relative; z-index: 1; display: flex; flex-direction: column; overflow-y: auto;
  width: min(420px, 100% - 32px); max-height: calc(100% - 40px); border-radius: 16px; background: var(--paper);
  box-shadow: 0 0 0 1px #ffffff26, 0 2px 4px #0000002e, 0 28px 60px -18px #000000c4;
}
.login-logo-papan {
  flex: none; position: relative; display: grid; place-items: center; padding: clamp(18px, 3.4vh, 30px) 28px;
  background: radial-gradient(80% 140% at 30% 0%, #ffffff10, transparent 70%), #13291f;
}
.login-logo-papan::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, #d4a12a 20%, #f0cd6e 50%, #d4a12a 80%, transparent); }
.login-logo { display: block; width: min(100%, 290px, 34vh); height: auto; }
.login-isi { container-type: inline-size; padding: clamp(22px, 4vh, 34px) clamp(22px, 7%, 34px) clamp(24px, 4vh, 34px); }
.login-card { display: flex; flex-direction: column; gap: clamp(12px, 2vh, 16px); }
.login-card > div:first-child { margin-bottom: clamp(4px, 1vh, 8px); text-align: center; }
.login-eyebrow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; color: #9a6e12; font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: .16em; text-transform: uppercase; }
.login-eyebrow::before, .login-eyebrow::after { content: ''; width: 22px; height: 1.5px; border-radius: 2px; background: #d4a12a; }
.login-title { margin: 10px 0 0; color: var(--ink); font: 600 clamp(24px, 8cqi, 30px)/1.15 'Fraunces', Georgia, serif; letter-spacing: -.01em; }
.login-sub { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.login-panel .field { gap: 6px; }
.login-panel .field > span:first-child, .login-panel .field-label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
/* Fields with an icon on the left */
.login-medan { position: relative; display: block; }
.login-medan > .ph { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--faint); font-size: 18px; pointer-events: none; transition: color .2s; }
.login-medan:focus-within > .ph { color: var(--ink); }
.login-panel .input { min-height: 48px; padding: 10px 14px 10px 42px; border: 1.5px solid var(--line-strong); border-radius: 11px; background: var(--field); font-size: 15.5px; }
.login-panel .input:hover { border-color: #173a2d55; }
.login-panel .input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(var(--pencil-rgb), .28); }
/* Browser autofill paints inputs light blue: keep them white */
.login-panel .input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 40px #fff inset; transition: background-color 9999s; }
.login-panel .input:-webkit-autofill:focus { box-shadow: 0 0 0 40px #fff inset, 0 0 0 4px rgba(var(--pencil-rgb), .28); }
.login-pw .input { padding-right: 52px; }
.login-pw-togol { position: absolute; right: 5px; top: 50%; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 19px; translate: 0 -50%; cursor: pointer; }
.login-pw-togol:hover { background: #173a2d0f; color: var(--ink); }
.login-caps { margin: 4px 0 0; color: #a66800; font-size: 12.5px; }
.login-msg { margin: 0; padding: 9px 12px; border-radius: 9px; background: #c4342e14; color: #b02c26; font-size: 13px; }
.login-btn { width: 100%; min-height: 44px; font-size: 14px; }
.login-panel .login-btn { min-height: 48px; margin-top: 4px; border: 1.5px solid var(--line-strong); border-radius: 11px; background: none; font-size: 14.5px; }
.login-panel .login-btn:hover { border-color: var(--ink-2); }
/* "Masuk" in dark green (as specific as the dark theme's gold .btn-primary, and later, so it wins there too) */
.login-panel .btn-primary.login-btn { gap: 8px; border: 0; background: var(--ink); color: #fbf6ea; font-size: 15.5px; font-weight: 700; box-shadow: 0 1px 0 #ffffff1a inset, 0 8px 18px -10px #0b241acc; transition: background .2s, transform .15s, box-shadow .2s; }
.login-panel .btn-primary.login-btn:hover { background: #1f4a39; transform: translateY(-1px); box-shadow: 0 1px 0 #ffffff1a inset, 0 12px 22px -10px #0b241acc; }
.login-panel .btn-primary.login-btn .ph { font-size: 17px; transition: translate .2s; }
.login-panel .btn-primary.login-btn:hover .ph { translate: 3px 0; }
.login-demo { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1.5px dashed #173a2d40; border-radius: 10px; background: #fff8de; color: var(--muted); font-size: 12.5px; }
.login-demo p { margin: 0; }
.akses-mula { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #d4a12a1f; font-size: 13px; }
.akses-mula p { margin: 0; }

/* ---------- Responsive ---------- */
/* Greeting banner: too narrow for three columns, so the portal name gets its own centred row */
@media (max-width: 1360px) {
  .salam { grid-template-columns: minmax(0, 1fr) auto; }
  .salam-portal { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-lebar, .grid-laporan { grid-template-columns: minmax(0, 1fr); }
  .peranan-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { .lg-hide { display: none !important; } }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .28s ease; box-shadow: 10px 0 40px #0006; }
  .sidebar[data-open="true"] { transform: none; }
  .backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }
  .app { margin-left: 0; }
  .app::before { inset: 0; background: linear-gradient(90deg, transparent 10px, var(--margin) 10px 11px, transparent 11px), repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .papan-kad { grid-template-columns: minmax(0, 1fr); }
  .topbar, .main, .site-footer { padding-left: 16px; padding-right: 16px; }
}
/* Login on narrow phones: a wider card */
@media (max-width: 420px) { .login-panel { width: calc(100% - 20px); } }
@media (max-width: 720px) {
  .chips-hari { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .jd-minggu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-kemajuan { grid-template-columns: minmax(0, 1fr) auto; }
  .tg-kemajuan .textarea { grid-column: 1 / -1; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.tiga { grid-template-columns: minmax(0, 1fr); }
  .salam { grid-template-columns: minmax(0, 1fr); padding: 22px 22px 24px; }
  .salam-portal { grid-column: auto; grid-row: auto; justify-self: start; font-size: 22px; }
  .salam-portal::before { display: none; }
  .salam-masa { justify-self: stretch; }
  .salam-masa { gap: 12px; padding: 14px 0 0; border-left: 0; border-top: 1.5px dashed #eef0e640; }
  .salam-jam-muka { width: 52px; height: 52px; }
  .salam-masa-teks { grid-template-columns: auto auto; align-items: baseline; column-gap: 10px; }
  .salam-jam { grid-column: 1 / -1; font-size: 24px; }
  .papan::after { right: 40px; }
  .papan-topik { padding: 18px 22px 22px; }
  /* Phones: the year on top, the months below in two rows of six */
  .papan-masa { flex-direction: column; align-items: stretch; width: 100%; gap: 6px; }
  .pb-senarai { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pb-bulan { min-width: 0; }
  .pb-tahun { order: -1; justify-content: center; padding: 0 0 4px; border-left: 0; border-bottom: 1px solid var(--line); }
  .chart { overflow-x: auto; }
  .chart svg { min-width: 560px; }
  .demo-pita .select { max-width: 100%; }
  .jw-grid { display: none; }
  .jw-senarai { display: flex; flex-direction: column; gap: 12px; }
  .jw-senarai h3 { margin: 0 0 6px; font: 600 15px/1.2 'Fraunces', serif; }
  .jw-senarai .jw-blok { position: relative; left: auto; right: auto; width: 100%; margin-bottom: 6px; }
  .peranan-form { grid-template-columns: minmax(0, 1fr); }
  .panduan-pilih { grid-template-columns: minmax(0, 1fr); }
  .hk-pilihan { grid-template-columns: minmax(0, 1fr); }
  .lap-masa, .lap-rehat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-item { grid-template-columns: 58px 14px minmax(0, 1fr); }
  .tl-item > :last-child { grid-column: 3; justify-self: start; }
  .hk-hari { min-height: 48px; }
  .month-nav strong { min-width: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .site-footer, .demo-pita, .toast, .simpan-status { display: none !important; }
  .app { margin: 0; }
  .app::before { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Chart series colours: a validated categorical order (checked on the paper and chalkboard surfaces), fixed per
   tutor / platform. Dark mode has its own steps, not a flip. */
:root, :root[data-theme="light"] {
  --viz-1: #257de0; --viz-2: #f47230; --viz-3: #00b894; --viz-4: #f2a600;
  --viz-5: #ee7fac; --viz-6: #008a17; --viz-7: #6a4ce2; --viz-8: #ec4647; --viz-lain: #9aa1a9;
}
:root[data-theme="dark"] {
  --viz-1: #338ced; --viz-2: #e76624; --viz-3: #00a888; --viz-4: #d28e05;
  --viz-5: #e24d8b; --viz-6: #0aac23; --viz-7: #9887ef; --viz-8: #eb6263; --viz-lain: #6d7a74;
}

/* Livestream: the summary row (Live · Sosial media engagement · Rekod / Analisis) */
.live-ringkas { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) auto; gap: 10px; align-items: stretch; margin-bottom: 16px; }
.lr-kumpulan { padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.lr-kumpulan h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.lr-jumlah { margin-left: auto; color: var(--ink); font-weight: 700; }
.lr-isi { display: grid; gap: 8px; }
.lr-dua { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lr-empat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lr-stat { display: flex; flex-direction: column; gap: 4px; }
.lr-stat b { color: var(--ink); font: 600 24px/1 'Fraunces', Georgia, serif; }
.lr-stat span { color: var(--muted); font-size: 12px; }
.lr-platform { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; border-left: 1px solid var(--line); }
.lr-platform:first-child { padding-left: 0; border-left: 0; }
.lr-nama { display: flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.lr-nilai { display: flex; align-items: baseline; gap: 5px; }
.lr-nilai b { color: var(--ink); font: 600 18px/1 'Fraunces', Georgia, serif; }
.lr-nilai small { color: var(--muted); font-size: 11.5px; }
.lr-tukar { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.lr-tukar .btn { justify-content: flex-start; }
@media (max-width: 900px) {
  .live-ringkas { grid-template-columns: minmax(0, 1fr); }
  .lr-tukar { flex-direction: row; }
  .lr-tukar .btn { flex: 1; justify-content: center; }
}
@media (max-width: 560px) {
  .lr-empat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lr-platform:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* Livestream: Analisis */
.live-analisis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.viz-donut { display: grid; grid-template-columns: minmax(140px, 210px) minmax(0, 1fr); gap: 18px; align-items: center; }
.viz-donut .chart { width: 100%; max-width: 210px; overflow: visible; }
.viz-donut .chart svg { min-width: 0; }
.viz-ring { stroke: var(--paper); stroke-width: 2; stroke-linejoin: round; }
.viz-ring:hover { opacity: .85; }
.viz-jumlah { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
.viz-jumlah b { color: var(--ink); font: 600 24px/1 'Fraunces', Georgia, serif; }
.viz-legenda { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.viz-legenda li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; color: var(--ink); font-size: 12.5px; }
.viz-legenda i, .viz-legenda-baris i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.viz-legenda small { min-width: 42px; color: var(--muted); text-align: right; }
.viz-kepala { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.viz-legenda-baris { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 2px 0 8px; color: var(--ink); font-size: 12.5px; }
.viz-legenda-baris span { display: inline-flex; align-items: center; gap: 6px; }
.viz-garis { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-titik { stroke: var(--paper); stroke-width: 2; }
.viz-kolum { fill: transparent; }
.viz-kolum:hover { fill: var(--line); }
@media (max-width: 900px) { .live-analisis { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .viz-donut { grid-template-columns: minmax(0, 1fr); justify-items: center; } .viz-donut > div:last-child { width: 100%; } }

/* Pengguna: a suspended account */
.akaun-gantung .judul { color: var(--muted); }
.table td.act [data-act="akaun-gantung"] { margin-right: 6px; white-space: nowrap; }

/* Livestream: Plan, the month's calendar of planned lives */
.lp-alat { display: flex; justify-content: flex-end; margin: -6px 0 10px; }
.lp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lp-hn { padding: 2px 4px 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.lp-hari { display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.lp-hari.luar { border: 0; background: none; }
.lp-hari.lalu { background: var(--paper-2); }
.lp-hari.kini { border-color: var(--pencil); box-shadow: inset 0 0 0 1px var(--pencil); }
.lp-kepala { display: flex; align-items: center; gap: 4px; }
.lp-kepala b { color: var(--ink); font: 600 14px/1 'Fraunces', Georgia, serif; }
.lp-namahari { display: none; color: var(--muted); font-size: 12px; }
.lp-tambah { display: grid; place-items: center; width: 22px; height: 22px; margin-left: auto; padding: 0; border: 1px dashed var(--line-strong); border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: .55; transition: opacity .15s, background .15s; }
.lp-hari:hover .lp-tambah, .lp-tambah:focus-visible { opacity: 1; }
.lp-tambah:hover { background: rgba(var(--pencil-rgb), .18); color: var(--ink); }
.lp-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 4px 6px; border: 1px solid rgba(var(--pencil-rgb), .55); border-left: 3px solid var(--pencil); border-radius: 6px; background: rgba(var(--pencil-rgb), .14); color: var(--ink); font: 600 11.5px/1.25 'DM Sans', sans-serif; text-align: left; cursor: pointer; }
.lp-item:hover { background: rgba(var(--pencil-rgb), .26); }
.lp-item.siap { border-color: rgb(var(--good)); border-left-color: rgb(var(--good)); background: rgba(var(--good), .12); }
.lp-masa { display: flex; align-items: center; gap: 4px; }
.lp-masa .ph-check-circle { color: rgb(var(--good)); }
.lp-plat { display: inline-flex; gap: 2px; margin-left: auto; color: var(--ink-2); font-size: 12px; }
.lp-subjek { overflow: hidden; color: var(--ink-2); font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.lp-direkod { display: flex; align-items: center; gap: 4px; margin-top: auto; color: rgb(var(--good)); font-size: 10.5px; font-weight: 600; }
/* Phones: a list of the days that have something, the weekday beside the date */
@media (max-width: 720px) {
  .lp-grid { grid-template-columns: minmax(0, 1fr); }
  .lp-hn, .lp-hari.luar, .lp-hari:not(.ada):not(.kini) { display: none; }
  .lp-hari { min-height: 0; }
  .lp-namahari { display: inline; }
  .lp-tambah { opacity: 1; }
}

/* Selamat Datang: the welcome after login */
.dialog.dialog-alu { width: min(720px, calc(100vw - 24px)); overflow: hidden; }
.dialog-alu .dialog-head { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 0; border: 0; }
.dialog-alu .dialog-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dialog-alu .dialog-body { padding: 10px 20px 18px; background: radial-gradient(120% 60% at 50% 0%, rgba(var(--pencil-rgb), .16), transparent 70%); }
.alu-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 0 4px; }
.alu-hiasan { position: absolute; inset: 0 auto auto 50%; width: min(420px, 100%); height: 100%; transform: translateX(-50%); pointer-events: none; }
.alu-w1, .alu-w2 { position: relative; font-family: 'Fredoka', 'DM Sans', sans-serif; font-weight: 700; line-height: .95; letter-spacing: .01em; paint-order: stroke fill; -webkit-text-stroke: 7px #6b2f47; text-shadow: 0 4px 0 #6b2f47; animation: alu-masuk .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.alu-w1 { color: #f6c445; font-size: clamp(42px, 9vw, 64px); }
.alu-w2 { color: #f07c7c; font-size: clamp(46px, 10vw, 72px); animation-delay: .12s; }
@keyframes alu-masuk { from { opacity: 0; transform: translateY(14px) scale(.85) rotate(-3deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .alu-w1, .alu-w2 { animation: none; } }
.alu-sapa { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px 0 16px; color: var(--ink); font-size: 15px; text-align: center; }
.alu-tarikh { color: var(--muted); font-size: 12.5px; }
.alu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.alu-kad { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.alu-kad.alu-live { grid-column: 1 / -1; }
.alu-kad h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; color: var(--ink); font: 600 15px/1.2 'Fraunces', Georgia, serif; }
.alu-kad h3 .ph { color: var(--k-biru); font-size: 18px; }
.alu-bil { margin-left: auto; min-width: 24px; padding: 2px 8px; border-radius: 99px; background: rgba(var(--pencil-rgb), .25); color: var(--ink); font: 700 12px/1.4 'DM Sans', sans-serif; text-align: center; }
.alu-senarai { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.alu-senarai li { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; background: var(--paper-2); }
.alu-senarai li > .ph { margin-left: auto; color: rgb(var(--good)); font-size: 18px; }
.alu-senarai li.lewat { box-shadow: inset 3px 0 0 rgb(var(--bad)); }
.alu-senarai li.lewat small { color: rgb(var(--bad)); font-weight: 600; }
.alu-masa { flex: none; min-width: 78px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.alu-teks { display: flex; flex-direction: column; min-width: 0; }
.alu-teks b { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.alu-teks small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.alu-kosong { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.alu-lagi { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.alu-cuti { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 6px 9px; border-radius: 10px; background: rgba(var(--pencil-rgb), .18); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.alu-kira { display: flex; justify-content: center; gap: 10px; }
.alu-digit { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; padding: 10px 8px 8px; border-radius: 12px; background: #1d2d27; color: #eef0e6; box-shadow: inset 0 -3px 0 #0003; }
:root[data-theme="dark"] .alu-digit { border: 1px solid #ffffff1f; background: #12201a; }
.alu-digit b { color: #f6c445; font: 600 30px/1 'Fraunces', Georgia, serif; font-variant-numeric: tabular-nums; }
.alu-digit small { color: #eef0e6b3; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.alu-kira.sedang { padding: 14px; border-radius: 12px; background: rgba(var(--bad), .12); }
.alu-sedang { display: inline-flex; align-items: center; gap: 8px; color: rgb(var(--bad)); font: 600 18px/1 'Fraunces', Georgia, serif; }
.alu-live-ket { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin: 10px 0 0; color: var(--ink); font-size: 13px; text-align: center; }
.alu-live-ket span { color: var(--muted); }
@media (max-width: 560px) {
  .alu-grid { grid-template-columns: minmax(0, 1fr); }
  .alu-digit { min-width: 0; flex: 1; }
  .alu-digit b { font-size: 24px; }
}
