/* Portal Guru in the look of Portal Staf 3.0. Most of this file is Portal Staf's dashboard-design.css, so both
   portals share one design: cream star chart (Cerah) and galaxy glass (Gelap), the cream sidebar, plain top tabs, frosted cards, and Portal Staf's night-sky login. Loaded after styles.css,
   theme.css and guru.css, so it wins over Portal Admin's look where they differ. */

/* Base rules of Portal Staf (from its inline stylesheet) that the design layer below builds on. */
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); --placeholder: #8f9a8b; --amber-9: #e0a93a; }
.home-view { display: flex; flex-direction: column; gap: 20px; padding: 6px 0 8px; }
.home-greet { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; color: var(--gray-12); }
.home-welcome { margin: 0; }
.home-clock { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.home-clock-now { display: flex; align-items: baseline; gap: 2px; line-height: 1.1; color: var(--gray-12); }
.home-clock-sec { font-weight: 600; color: var(--gray-10); }
.home-clock-part { color: var(--gray-11); letter-spacing: 0; }
.home-stat { color: var(--gray-12); text-align: left; font: inherit; border: 0; }
.home-stat-n { color: var(--gray-12); }
.home-stat-label { color: var(--gray-11); }
.home-stat:active { transform: scale(.97); }
.home-card { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.hc-head { display: flex; flex-wrap: wrap; align-items: center; }
.hc-head .to-title { display: flex; align-items: center; margin: 0; }
.to-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--gray-12); }
.hc-sum { margin-left: auto; }
.home-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1024px) { .home-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hc-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.hc-empty { margin: 0; padding: 6px 0; font-size: 13px; color: var(--gray-10); }

:root {
  --page: #f5f6f2;
  --panel: #ffffff;
  --chrome: #ffffff;
  --chrome-line: #e4e8e1;
  --gray-1: #ffffff;
  --gray-2: #f7f8f5;
  --gray-3: #eff2ec;
  --gray-4: #e7ebe3;
  --gray-5: #dfe5db;
  --gray-6: #d2dbcd;
  --gray-7: #c1ccbc;
  --gray-8: #a3b19e;
  --gray-9: #84917e;
  --gray-10: #667362;
  --gray-11: #61705f;
  --gray-12: #26352b;
  --line: #e7ebe3;
  --line-strong: #d5ddd0;
  --brand: #315b45;
  --brand-soft: #eaf0e5;
  --gold: #d7b773;
  --heading-font: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  --shadow-card: 0 1px 3px #233a2710, 0 0 0 1px var(--line);
  --shadow-card-hover: 0 5px 20px #233a2710, 0 0 0 1px var(--line-strong);
}

/* Gelap = galaxy, like the login screen: deep-space navy, gold accents (the logo's), and glass panels
   over the night sky drawn on #app-sky. */
:root[data-theme="dark"] {
  --page: #05060c;
  --panel: #10131f;
  --chrome: rgba(7, 9, 18, .55);
  --chrome-line: rgba(255, 255, 255, .07);
  --gray-1: #0b0d17;
  --gray-2: #131726;
  --gray-3: #1b2033;
  --gray-4: #23293e;
  --gray-5: #2b3248;
  --gray-6: #353c54;
  --gray-7: #444b65;
  --gray-8: #5d6582;
  --gray-9: #757d99;
  --gray-10: #9097b0;
  --gray-11: #b5bacd;
  --gray-12: #eef0f7;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --brand: #f1c35a;
  --brand-soft: rgba(241, 195, 90, .13);
  --glass: rgba(16, 19, 31, .72);
  --shadow-card: 0 0 0 1px var(--line);
  --shadow-card-hover: 0 0 0 1px var(--line-strong);
}

body { font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif; }
button, input, select, textarea { font-family: inherit; }

/* A quiet, persistent navigation rail. Its palette also works in dark mode. */
.sidebar {
  --panel: #284235;
  --gray-1: #192e24;
  --gray-2: #223c2e;
  --gray-3: #2d4838;
  --gray-9: #92aa97;
  --gray-10: #a1b5a3;
  --gray-11: #b7c8b8;
  --gray-12: #f3f4e9;
  --line: #ffffff13;
  --line-strong: #ffffff26;
  --blue-9: #d7b773;
  --green-9: #79bd88;
  width: 240px;
  gap: 28px;
  padding: max(28px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: #1d3528;
  border-right: 1px solid #1d3528;
  color: var(--gray-12);
}
.side-top { gap: 28px; }
.side-top > div:first-child { padding-left: 0; }
.brand-link { flex-direction: row; align-items: center; gap: 10px; padding: 0; }
.brand-mark {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 43px;
  border: 1px solid #dfc79255;
  border-radius: 12px 12px 12px 3px;
  color: #eddbad;
  background: #dfc7920c;
  font-family: var(--heading-font);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -2px;
}
.brand-mark > span { align-self: flex-start; margin: 7px 0 0 1px; font-size: 15px; letter-spacing: 0; }
.brand-copy { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font-family: var(--heading-font); font-size: 17px; letter-spacing: -.6px; }
.brand-company { font-size: 9.5px; font-weight: 400; letter-spacing: .1px; }
.side-eyebrow { margin: 14px 12px -14px; color: #95ad98; font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.nav-group { gap: 14px; }
.nav-group-label { min-height: 44px; gap: 12px; padding: 10px 13px; border-radius: 9px; background: #d9e4ba12; color: #e7edd9; font-size: 12px; }
.nav-group-label .ph { color: #cfdbb2; font-size: 18px; }
.side-note { padding: 0 12px; font-size: 11px; line-height: 1.8; color: #a1b5a3; }
.nav-item { min-height: 37px; height: auto; padding: 9px 10px; font-size: 12px; }
.nav-item[aria-current="page"] { background: #d9e4ba1a; box-shadow: none; color: #f5f3dc; }
.nav-group-items { gap: 4px; margin-left: 20px; }
.side-middle { padding-top: 24px; }
.side-label { padding: 0 10px; margin-bottom: 12px; font-size: 10px; font-weight: 500; letter-spacing: .5px; }
.side-bottom { gap: 17px; padding-top: 24px; }
.sidebar .segmented { padding: 4px; border-radius: 9px; background: #12271c80; box-shadow: none; }
.sidebar .segmented button { height: 30px; font-size: 11px; }
.sidebar .segmented button[aria-pressed="true"] { background: #3b5140; color: #f1f1df; box-shadow: 0 1px 3px #0002; }
.user-card { gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.user-avatar { display: grid; place-items: center; flex-shrink: 0; width: 35px; height: 37px; border-radius: 10px; color: #e7dcbb; background: #e7dcbb17; }
.sidebar #role-badge { background: transparent; padding: 0; height: auto; margin-bottom: 3px; color: #a1b5a3; font-size: 10px; }
.sidebar #user-name { font-size: 11.5px; }
.sidebar .status-line { padding: 0 5px; font-size: 10px; color: #a1b5a3; }
.sidebar .status-dot { width: 6px; height: 6px; }
.sidebar #sign-out-btn, .sidebar #password-btn { width: 27px; min-width: 27px; }

/* Primary topics remain exactly where the existing navigation expects them. */
.app-header { height: calc(64px + env(safe-area-inset-top, 0px)); background: var(--chrome); backdrop-filter: none; -webkit-backdrop-filter: none; }
.topic-tabs { align-items: center; gap: 5px; }
.topic-tab { height: 42px; gap: 8px; border-radius: 8px; padding: 0 12px; font-size: 12px; font-weight: 500; }
.topic-tab .ph { color: var(--gray-10); font-size: 17px; }
.topic-tab + .topic-tab::before, .topic-tab::after { display: none; }
.topic-tab[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.topic-tab[aria-current="page"] .ph { color: var(--brand); }
#main { max-width: none; padding-top: 24px; padding-bottom: 24px; min-height: calc(100dvh - 64px); }
.page-title { font-family: var(--heading-font); }

/* Welcome, local time, and the three daily summaries form a single reading path. */
.home-view { gap: 20px; padding: 0; }
.home-breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--gray-10); font-size: 11px; }
.home-breadcrumb .ph { font-size: 14px; }
.home-breadcrumb > span:last-child { color: var(--gray-12); font-weight: 500; }
.breadcrumb-divider { color: var(--gray-8); margin: 0 3px; }
.home-top { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(480px, 2fr) auto; grid-template-areas: 'intro stats clock'; align-items: center; gap: 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.home-intro { grid-area: intro; min-width: 0; }
.home-welcome { margin-bottom: 5px; color: var(--gray-11); font-size: 12px; }
.home-greet { font-family: var(--heading-font); font-size: clamp(24px, 1.85vw, 32px); font-weight: 700; letter-spacing: -1px; line-height: 1.3; overflow-wrap: anywhere; text-wrap: initial; }
.greet-dot { color: #b9954b; }
.home-hint { margin: 0; font-size: 12px; }
.home-clock { grid-area: clock; align-items: flex-end; gap: 7px; padding: 4px 0 4px 24px; border-left: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; white-space: nowrap; }
.home-clock-now { gap: 2px; font-family: var(--heading-font); font-size: 28px; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.home-clock-sec { font-size: 14px; font-weight: 500; color: var(--gray-10); letter-spacing: 0; }
.home-clock-part { margin-left: 6px; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 400; }
.home-clock-date { color: var(--gray-11); font-size: 12px; font-weight: 500; }
.home-stats { grid-area: stats; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.home-stat {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border-radius: 11px;
  background: var(--gray-2);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.home-stat::before {
  content: '';
  grid-column: 2;
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border: 7px solid color-mix(in srgb, var(--stat-color) 9%, var(--panel));
  border-radius: 9px;
  background-color: color-mix(in srgb, var(--stat-color) 9%, var(--panel));
  background-image: var(--stat-icon);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
  box-sizing: border-box;
}
.home-stat.is-kerja { --stat-color: #4e8b62; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235b8063' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='14' rx='3'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12c5 3 13 3 18 0M10 13h4'/%3E%3C/svg%3E"); }
.home-stat.is-off { --stat-color: #8290ab; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2379829c' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h12v7a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4V8ZM16 8h2a3 3 0 1 1 0 6h-2M3 22h15M7 2v3M12 2v3'/%3E%3C/svg%3E"); }
.home-stat.is-cuti { --stat-color: #b18c45; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ad8946' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 6 2 5 8 2-1-2-7 6-6c3-3 1-5-2-2l-6 6-7-2-2 2Z'/%3E%3C/svg%3E"); }
.home-stat.is-mc { --stat-color: #c0564b; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c0564b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E"); }
.home-stat-n { grid-column: 1; grid-row: 2; font-family: var(--heading-font); font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: -1px; }
.home-stat-label { grid-column: 1; grid-row: 1; font-size: 11px; font-weight: 400; }
.home-stat:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.home-stat.is-holiday { grid-column: 1 / -1; }
.home-stat.is-holiday::before { display: none; }
.home-stat.is-holiday .home-stat-n { font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }

/* Branch colors remain the familiar colors from the offday calendar. */
.home-card { gap: 16px; padding: 20px; border-radius: 16px; box-shadow: var(--shadow-card); }
.hc-head { gap: 10px; }
.home-view .to-title { gap: 10px; font-family: var(--heading-font); font-size: 15px; font-weight: 700; letter-spacing: -.35px; }
.hc-head .to-title > .ph { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 17px; }
.hc-sum { color: var(--gray-10); font-size: 11px; }
.hc-head > .link-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 11px; font-weight: 500; color: var(--brand); }
.hc-head > .hc-link { margin-left: auto; }
.hc-head > .link-btn .ph { font-size: 13px; }
.hb-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 174px), 1fr)); gap: 12px; }
.hb-col { gap: 0; padding: 14px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); box-shadow: none; }
.hb-col-head { gap: 9px; padding-bottom: 12px; }
.hb-col-head .od-code { min-width: 34px; width: 34px; height: 34px; border-radius: 9px; font-size: 10px; font-weight: 700; }
.hb-col-head .to-name { font-family: var(--heading-font); font-size: 13px; font-weight: 700; letter-spacing: -.2px; }
.hb-col-head .to-role { margin-top: 3px; font-size: 10.5px; }
.hb-slot { gap: 4px; padding: 9px 0; }
.hb-slot:last-child { padding-bottom: 0; margin-top: auto; }
.hb-slot-head { gap: 5px; }
.hb-when { font-size: 11px; font-weight: 500; }
.home-view .hb-pill { max-width: 100%; padding: 3px 8px; border-radius: 5px; font-size: 9.5px; line-height: 1.5; white-space: normal; text-align: center; }
.home-view .hb-pill.is-on { background: color-mix(in srgb, var(--green-9) 9%, transparent); }
.hb-cover { font-size: 10.5px; line-height: 1.65; overflow-wrap: anywhere; }
.hb-cover .link-btn { padding: 1px 5px; margin-left: 1px; border-radius: 4px; background: var(--gray-3); color: var(--gray-12); font-size: 10px; }
.hb-missing { font-weight: 500; }

/* Leave cards keep their status colors but place people and dates first. */
.hcu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-height: none; overflow: visible; }
.hcu { gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: none; }
.hcu-top { margin-bottom: 4px; }
.hcu .pf-swatch { width: 29px; min-width: 29px; height: 18px; border-radius: 5px; font-size: 9px; box-shadow: none; }
.hcu .to-name { font-family: var(--heading-font); font-size: 13px; font-weight: 700; letter-spacing: -.1px; }
.hcu .to-role { font-size: 10.5px; }
.hcu-when { padding-top: 7px; margin-top: 5px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 500; }
.hcu .hc-tag { padding: 3px 7px; border-radius: 5px; font-size: 9px; font-weight: 500; }
.hcu .hc-tag.is-now { background: color-mix(in srgb, var(--green-9) 9%, transparent); }
.home-card .count-badge { min-width: 22px; height: 22px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 10px; }

@media (min-width: 1440px) {
  #main.safe-x { --px: 44px; }
  .hb-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hb-col-head .to-name, .hcu .to-name { font-size: 14px; }
  .hb-col-head .to-role, .hcu .to-role { font-size: 12px; }
  .hb-when, .hcu-when { font-size: 12px; }
  .home-view .hb-pill { font-size: 10px; }
  .hb-cover { font-size: 11px; }
}
/* Keep the complete overview on one row on laptops as well as wide monitors. */
@media (min-width: 1200px) and (max-width: 1439px) {
  .home-top { grid-template-columns: minmax(180px, 1fr) minmax(400px, 2fr) auto; gap: 18px; padding: 20px; }
  .home-greet { font-size: 24px; }
  .home-stats { gap: 8px; }
  .home-stat { padding: 12px 10px; gap: 4px 6px; }
  .home-stat::before { width: 26px; height: 26px; border-width: 5px; background-size: 16px; }
  .home-clock { padding-left: 18px; }
  .home-clock-now { font-size: 26px; }
  .home-clock-date { font-size: 11px; }
}
@media (max-width: 1199px) {
  .home-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'intro clock' 'stats stats'; gap: 20px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .hcu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-card { padding: 20px; }
  .hc-sum { order: 3; flex-basis: 100%; margin-left: 41px; }
  #home-branches .hc-head > .link-btn { margin-left: auto; }
}
@media (max-width: 1023px) {
  .app-header { height: calc(64px + env(safe-area-inset-top, 0px)); }
  .topic-tabs { gap: 4px; }
  .topic-tab { flex-shrink: 0; padding: 0 12px; font-size: 12px; }
  .hcu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #main { padding-top: 24px; }
}
@media (max-width: 767px) {
  .home-view { gap: 22px; }
  .home-top { gap: 20px 12px; padding: 20px; }
  .home-welcome { font-size: 12px; }
  .home-greet { font-size: 28px; letter-spacing: -1px; }
  .home-hint { font-size: 11px; }
  .home-clock { padding-left: 16px; }
  .home-clock-now { font-size: 23px; }
  .home-clock-sec { font-size: 13px; }
  .home-clock-part { font-size: 10px; margin-left: 3px; }
  .home-clock-date { font-size: 11px; }
  .home-stats { gap: 10px; }
  .home-stat { padding: 14px; gap: 6px; }
  .home-stat::before { width: 28px; height: 28px; border-width: 5px; border-radius: 8px; background-size: 16px; }
  .home-stat-n { font-size: 25px; }
  .home-stat-label { font-size: 11px; }
  .home-card { padding: 18px; gap: 18px; }
  .home-view .to-title { gap: 8px; font-size: 13px; }
  .hc-head { gap: 8px; }
  .hc-sum { order: 3; flex-basis: 100%; margin-left: 0; font-size: 10px; }
  .hc-head > .link-btn { font-size: 10px; margin-left: auto; }
  .hb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hb-col { padding: 13px; }
  .hcu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hcu { padding: 13px; }
}
@media (max-width: 599px) {
  .home-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'stats' 'clock'; gap: 18px; }
  .home-clock { flex-direction: row; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 599px) { .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) {
  .home-breadcrumb { font-size: 10px; }
  .home-top { padding: 18px; }
  .home-intro { padding-right: 0; }
  .home-clock-now { font-size: 24px; }
  .home-stats { gap: 8px; }
  .home-stat { padding: 12px; grid-template-columns: 1fr; }
  .home-stat::before { display: none; }
  .home-stat-n { font-size: 27px; }
  .home-stat-label { display: flex; align-items: center; gap: 5px; font-size: 10px; }
  .home-stat-label::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--stat-color); }
  .home-card { padding: 16px; }
  .hc-head > .link-btn { flex-basis: 100%; margin-left: 0; padding: 4px 6px; }
  .hc-sum { margin-top: 0; }
  .hb-grid, .hcu-grid { grid-template-columns: minmax(0, 1fr); }
  .hb-col { padding: 16px; }
  .hb-col-head .to-name, .hcu .to-name { font-size: 14px; }
  .hb-col-head .to-role, .hcu .to-role { font-size: 12px; }
  .hb-when, .hcu-when { font-size: 12px; }
  .home-view .hb-pill { font-size: 11px; }
  .hb-cover { font-size: 12px; }
  .hcu { padding: 16px; }
  .hcu .hc-tag { font-size: 10px; }
}
@media (hover: hover) and (pointer: fine) {
  .home-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
  .topic-tab:not([aria-current]):hover { background: var(--gray-3); color: var(--brand); }
  .hc-head > .link-btn:hover { background: var(--brand-soft); color: var(--brand); }
  .sidebar .nav-item:not([aria-current]):hover { background: #ffffff0c; }
}
@media (prefers-reduced-motion: reduce) {
  .home-stat, .home-stat:hover, .home-stat:active { transition: none; transform: none; }
}

/* ---------- Gelap = galaxy: glass over the night sky ---------- */
/* The sidebar trades its forest green for frosted night glass with gold accents. */
:root[data-theme="dark"] .sidebar {
  --panel: #161a2b;
  --gray-1: #0b0d17;
  --gray-2: #141829;
  --gray-3: #1c2136;
  --gray-9: #8f96b0;
  --gray-10: #a3a9c0;
  --gray-11: #bcc1d4;
  --gray-12: #f3f0e4;
  --blue-9: #f1c35a;
  background: rgba(7, 9, 18, .62);
  border-right-color: rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
:root[data-theme="dark"] .side-eyebrow,
:root[data-theme="dark"] .side-note,
:root[data-theme="dark"] .sidebar #role-badge,
:root[data-theme="dark"] .sidebar .status-line { color: #9aa1ba; }
:root[data-theme="dark"] .nav-group-label { background: rgba(241, 195, 90, .08); color: #f3ead2; }
:root[data-theme="dark"] .nav-group-label .ph { color: #f1c35a; }
:root[data-theme="dark"] .nav-item[aria-current="page"] { background: rgba(241, 195, 90, .13); color: #fff6dc; }
:root[data-theme="dark"] .sidebar .segmented { background: rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .sidebar .segmented button[aria-pressed="true"] { background: rgba(241, 195, 90, .18); color: #fff3d0; }
:root[data-theme="dark"] .user-avatar { color: #f1c35a; background: rgba(241, 195, 90, .1); }

/* Top bar and cards: see-through enough to keep the stars, solid enough to read on. */
:root[data-theme="dark"] .app-header {
  background: rgba(7, 9, 18, .55);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .home-top {
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
}

/* ---------- Cerah = Peta bintang: white frosted glass over the star chart ---------- */
/* The sidebar keeps its forest green; the top bar and cards let the chart show through softly. */
:root:not([data-theme="dark"]) .app-header {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}
:root:not([data-theme="dark"]) .card,
:root:not([data-theme="dark"]) .home-top {
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  backdrop-filter: blur(8px) saturate(130%);
}

/* Cerah sidebar: cream frosted glass with gold accents, matching the star chart (Gelap has its own above). */
:root:not([data-theme="dark"]) .sidebar {
  --panel: #ffffff;
  --gray-1: #ffffff;
  --gray-2: #f7f5ee;
  --gray-3: #efeadd;
  --gray-9: #9a917c;
  --gray-10: #7d7665;
  --gray-11: #625c4d;
  --gray-12: #2b2a22;
  --line: rgba(120, 95, 40, .12);
  --line-strong: rgba(120, 95, 40, .2);
  --blue-9: #b8892a;
  --green-9: #30a46c;
  background: rgba(238, 229, 207, .84);
  border-right: 1px solid rgba(168, 124, 36, .22);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
:root:not([data-theme="dark"]) .brand-mark { color: #a87c24; border-color: rgba(168, 124, 36, .4); background: rgba(241, 195, 90, .12); }
:root:not([data-theme="dark"]) .side-eyebrow,
:root:not([data-theme="dark"]) .side-note,
:root:not([data-theme="dark"]) .sidebar #role-badge,
:root:not([data-theme="dark"]) .sidebar .status-line { color: #8a8270; }
:root:not([data-theme="dark"]) .nav-group-label { background: rgba(241, 195, 90, .16); color: #3b2f12; }
:root:not([data-theme="dark"]) .nav-group-label .ph { color: #a87c24; }
:root:not([data-theme="dark"]) .nav-item[aria-current="page"] { background: rgba(241, 195, 90, .22); color: #2b2a22; }
:root:not([data-theme="dark"]) .nav-item[aria-current="page"] .ph { color: #a87c24; }
:root:not([data-theme="dark"]) .sidebar .segmented { background: rgba(168, 124, 36, .09); }
:root:not([data-theme="dark"]) .sidebar .segmented button[aria-pressed="true"] { background: #ffffff; color: #2b2a22; box-shadow: 0 1px 3px rgba(60, 45, 10, .12); }
:root:not([data-theme="dark"]) .user-avatar { color: #a87c24; background: rgba(241, 195, 90, .16); }
@media (hover: hover) and (pointer: fine) {
  :root:not([data-theme="dark"]) .sidebar .nav-item:not([aria-current]):hover { background: rgba(168, 124, 36, .08); }
}

/* ---------- Sky behind the app (drawn on #app-sky by app.js) ---------- */
/* Gelap = the login's night sky; Cerah = a star chart on cream paper with a faint grid. */
.app-sky { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; pointer-events: none; }
:root[data-theme="dark"] body { background: radial-gradient(ellipse 120% 90% at 50% 35%, #0b0e19 0%, #05060c 55%, #020308 100%) fixed; }
:root:not([data-theme="dark"]) body { background:
  linear-gradient(rgba(168, 124, 36, .05) 1px, transparent 1px) 0 0/96px 96px fixed,
  linear-gradient(90deg, rgba(168, 124, 36, .05) 1px, transparent 1px) 0 0/96px 96px fixed,
  #f7f5ee; }

/* Portal Staf has no banner strip: the sidebar and the top bar already say where you are. */
.page-strip { display: none; }
#side-nav { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Connection status (sidebar, under the user) ---------- */
.status-line { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12px; line-height: 1.3; color: var(--gray-11); }
.status-line[hidden] { display: none; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--gray-8); }
.status-dot[data-state="connecting"] { animation: pulse 1.2s ease-in-out infinite; }
.status-dot[data-state="online"] { background: var(--green-9); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-9) 20%, transparent); }
.status-dot[data-state="offline"] { background: var(--amber-9); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Sidebar middle: empty space between the pages and the settings, as in Portal Staf ---------- */
.side-middle { display: flex; flex-direction: column; justify-content: flex-end; }

/* ---------- Laman Utama: Portal Guru's tiles and lists ---------- */
.home-stat.is-proses { --stat-color: #4e8b62; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235b8063' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.8-3.6 3.4-5.5 6.5-5.5s5.7 1.9 6.5 5.5M16 4.8a3.5 3.5 0 0 1 0 6.4M18.5 14.8c1.6.8 2.6 2.5 3 5.2'/%3E%3C/svg%3E"); }
.home-stat.is-temuduga { --stat-color: #b18c45; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ad8946' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4M8 14h3'/%3E%3C/svg%3E"); }
.home-stat.is-lulus { --stat-color: #8290ab; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2379829c' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V7l8-4 8 4v12M9 21v-6h6v6M2 21h20'/%3E%3C/svg%3E"); }
.home-stat.is-diterima { --stat-color: #c0564b; --stat-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c0564b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E"); }
.hc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 11px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.hc-row:first-child { border-top: 0; }
.hc-date { display: grid; place-items: center; min-width: 48px; padding: 6px 4px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); line-height: 1.1; text-align: center; }
.hc-date strong { font-family: var(--heading-font); font-size: 17px; font-weight: 700; }
.hc-date span { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.hc-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hc-name { overflow: hidden; font-size: 13.5px; font-weight: 600; color: var(--gray-12); white-space: nowrap; text-overflow: ellipsis; }
.hc-what { font-size: 12px; color: var(--gray-10); }
.hc-tag { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--gray-11); background: var(--gray-3); }
.hc-tag.is-now { color: var(--green-11); background: color-mix(in srgb, var(--green-9) 14%, transparent); }
.hc-tag.is-soon { color: var(--amber-11); background: color-mix(in srgb, var(--amber-9) 16%, transparent); }
@media (hover: hover) { a.hc-row:hover .hc-name { text-decoration: underline; text-underline-offset: 3px; } }

/* ---------- Login: Portal Staf's night sky, the same in both themes ---------- */
/* Dark tokens on the login screen, whatever the theme (it sits on a night sky). */
.sl-screen {
  --gray-1: #111111; --gray-2: #191919; --gray-3: #222222; --gray-4: #2a2a2a; --gray-5: #313131; --gray-6: #3a3a3a;
  --gray-7: #484848; --gray-8: #606060; --gray-9: #6e6e6e; --gray-10: #8a8a8a; --gray-11: #b4b4b4; --gray-12: #eeeeee;
  --page: #111111; --panel: #191919; --placeholder: #858585;
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .14);
  --red-3: #3b1219; --red-11: #ff9592; --green-3: #132d21; --green-11: #3dd68c;
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(ellipse 120% 90% at 50% 35%, #0b0e19 0%, #05060c 55%, #020308 100%);
  color: var(--gray-12); color-scheme: dark;
  transition: opacity 420ms var(--ease-out) 180ms;
}
.sl-screen[hidden] { display: none; }
.starfield { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* Glass: a 30% tint with a light blur, so the drifting stars stay visible behind the card. */
.sl-shell { position: relative; z-index: 1; width: 100%; max-width: 860px; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 30%, transparent);
  -webkit-backdrop-filter: blur(4px) saturate(130%); backdrop-filter: blur(4px) saturate(130%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), 0 24px 48px -12px rgba(0, 0, 0, .6);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
@starting-style { .sl-shell { opacity: 0; transform: scale(.97) translateY(4px); } }
@media (min-width: 768px) { .sl-shell { grid-template-columns: 1.1fr 1fr; } }
.sl-brand { display: grid; place-items: center; padding: 36px 24px 28px; border-bottom: 1px solid var(--line);
  background: radial-gradient(closest-side at 50% 45%, color-mix(in srgb, var(--amber-9) 14%, transparent), transparent); }
@media (min-width: 768px) { .sl-brand { min-height: 440px; padding: 48px 40px; border-bottom: 0; border-right: 1px solid var(--line); } }
.sl-card { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 32px 28px; }
@media (min-width: 768px) { .sl-card { padding: 48px 40px; } }
.sl-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--gray-12); }
.sl-card .label { color: var(--gray-12); }
.sl-card .input { background: var(--panel); border-color: var(--line-strong); color: var(--gray-12); }
.sl-card .input::placeholder { color: var(--placeholder); opacity: 1; }
.sl-card .input:focus { outline: none; border-color: var(--gray-8); box-shadow: 0 0 0 3px var(--gray-4); }
.sl-card .btn-primary { justify-content: center; gap: 8px; height: 40px; border: 0; border-radius: 8px; background: var(--gray-12); color: var(--gray-1); font-weight: 500; }
.sl-pw { position: relative; }
.sl-pw .input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--gray-10); cursor: pointer; transition: color 150ms ease, background-color 150ms ease; }
.pw-toggle[aria-pressed="true"] { color: var(--gray-12); }
@media (hover: hover) { .pw-toggle:hover { color: var(--gray-12); background: var(--gray-3); } }
@media (pointer: coarse) { .pw-toggle { width: 38px; height: 34px; } }
.sl-caps { margin: 6px 0 0; font-size: 12px; color: var(--gray-11); }
.sl-card .form-msg { margin: 0; }

/* The logo swings slowly left and right in 3D, with a glint on the gold lettering and a floor shadow. */
.logo-stage { width: min(300px, 78%); display: flex; flex-direction: column; align-items: center; gap: 20px; perspective: 900px; }
.logo-3d { position: relative; width: 100%; transform-style: preserve-3d; animation: logo-swing 7s cubic-bezier(.37, 0, .63, 1) infinite alternate; }
.logo-3d img { display: block; width: 100%; height: auto; }
.logo-3d::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 42%, rgba(255, 244, 214, .55) 50%, transparent 58%) 0 0/300% 100% no-repeat;
  -webkit-mask: url(logo-dark.png) center/contain no-repeat; mask: url(logo-dark.png) center/contain no-repeat;
  animation: logo-glint 7s cubic-bezier(.37, 0, .63, 1) infinite alternate; }
.logo-floor { width: 72%; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--gray-12) 20%, transparent), transparent);
  animation: logo-floor 7s cubic-bezier(.37, 0, .63, 1) infinite alternate; }
@keyframes logo-swing { from { transform: rotateX(4deg) rotateY(-30deg); } to { transform: rotateX(4deg) rotateY(30deg); } }
@keyframes logo-floor { from { transform: translateX(-5%) scaleX(.87); } 50% { transform: translateX(0) scaleX(1); } to { transform: translateX(5%) scaleX(.87); } }
@keyframes logo-glint { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* After login: the card blurs away, then the sky fades while the app comes into focus. */
.sl-screen[data-leaving="true"] { opacity: 0; pointer-events: none; }
.sl-screen[data-leaving="true"] .sl-shell { opacity: 0; transform: scale(.96); filter: blur(8px);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), filter 220ms var(--ease-out); }
body[data-reveal="start"] .app-layer { filter: blur(14px); opacity: .35; }
body[data-reveal="go"] .app-layer { transition: filter 600ms var(--ease-out) 160ms, opacity 600ms var(--ease-out) 160ms; }
@media (prefers-reduced-motion: reduce) {
  .logo-3d, .logo-floor, .logo-3d::after { animation: none !important; }
  .sl-shell { transition: opacity 200ms ease; }
  .sl-screen[data-leaving="true"] .sl-shell { transform: none; filter: none; }
  body[data-reveal="start"] .app-layer { filter: none; }
}

/* ---------- Matching Portal Staf over Portal Admin's sizes ---------- */
/* Top tabs: plain words, no icons, normal case. Sidebar text at Portal Staf's size. */
.topic-tab { text-transform: none; letter-spacing: 0; font-size: 12px; }
.topic-tab .ph { display: none; }
@media screen and (min-width: 768px) {
  .sidebar .nav-item { font-size: 12.5px; min-height: 37px; }
  .sidebar .user-name { font-size: 11.5px; }
}
@media screen and (min-width: 1440px) { .topic-tab { font-size: 12px; } }
.hc-head > .link-btn { text-decoration: none; padding: 4px 6px; margin: -4px 0 -4px 10px; }
.hc-head > .hc-link { margin-left: auto; }

/* ---------- Laman Utama: the branches on a map of Kota Kinabalu (Leaflet) ---------- */
/* A tutor's welcome has no recruitment numbers: the greeting and the clock only. */
.home-top.is-plain { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'intro clock'; }
.home-top.is-plain .home-hint { margin-top: 8px; }
.kk-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: stretch; }
.kk-map-slot { position: relative; min-height: 420px; border-radius: 12px; overflow: hidden; background: var(--gray-3); box-shadow: inset 0 0 0 1px var(--line); }
.kk-map-note { display: grid; place-items: center; height: 100%; min-height: 420px; margin: 0; padding: 16px; color: var(--gray-10); font-size: 12px; text-align: center; }
/* isolation keeps Leaflet's panes (z-index 400 and up) under the sidebar and dialogs. */
.kk-map { position: absolute; inset: 0; isolation: isolate; z-index: 0; font: inherit; background: var(--gray-3); }
:root[data-theme="dark"] .kk-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
/* A numbered circle with a point below it; the point is the branch's spot (iconAnchor in app.js). */
.kk-pin { --pin: var(--gray-11); }
.kk-pin.is-mine { --pin: var(--brand); }
.kk-pin span {
  position: relative; display: grid; place-items: center; width: 28px; height: 28px; margin: 1px; border-radius: 50%;
  background: var(--pin); color: #fff; font: 700 12px/1 'DM Sans', sans-serif; box-shadow: 0 2px 6px #0004, 0 0 0 2px #fff;
}
.kk-pin span::after { content: ''; position: absolute; left: 50%; top: 100%; margin: 1px 0 0 -6px; border: 6px solid transparent; border-top: 8px solid var(--pin); }
.kk-map .kk-label { padding: 2px 7px; border: 0; border-radius: 6px; background: var(--panel); color: var(--gray-12); font: 600 11px/1.5 'DM Sans', sans-serif; box-shadow: 0 1px 4px #0003; }
.kk-map .kk-label::before { display: none; }
.kk-map .leaflet-popup-content-wrapper, .kk-map .leaflet-popup-tip { background: var(--panel); color: var(--gray-12); }
.kk-map .leaflet-popup-content { margin: 12px 16px; font: 12px/1.5 'DM Sans', sans-serif; }
.kk-map .kk-pop-name { margin: 0; font-weight: 700; font-size: 13px; }
.kk-map .kk-pop-addr { margin: 2px 0 8px; color: var(--gray-11); }
.kk-pop-link { color: var(--brand); font-weight: 600; }
.kk-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kk-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.kk-row.is-mine { background: color-mix(in srgb, var(--brand) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
.kk-go { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.kk-go:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }
.kk-num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--gray-11); color: #fff; font-size: 11px; font-weight: 700; }
.kk-row.is-mine .kk-num { background: var(--brand); }
:root[data-theme="dark"] :is(.kk-num, .kk-pin span) { color: var(--page); }
.kk-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kk-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--gray-12); font-size: 13px; font-weight: 600; }
.kk-go:hover .kk-name { color: var(--brand); }
.kk-addr { color: var(--gray-10); font-size: 11.5px; line-height: 1.45; }
.kk-gmaps { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: 0 0 0 34px; padding: 2px 0; color: var(--brand); font-size: 11px; text-decoration: none; }
@media (max-width: 1023px) {
  .kk-body { grid-template-columns: minmax(0, 1fr); }
  .kk-map-slot, .kk-map-note { min-height: 340px; }
}
@media (max-width: 599px) {
  .home-top.is-plain { grid-template-areas: 'intro' 'clock'; grid-template-columns: minmax(0, 1fr); }
  .kk-map-slot, .kk-map-note { min-height: 280px; }
}
