/* =====================================================================
   MUV DESIGN SYSTEM — muv-theme.css
   Diekstrak & disesuaikan daripada prototaip USM i-Visa untuk MUV (CI4).
   Kendiri (tiada framework/build). Muatkan bersama fon:
   Plus Jakarta Sans (400-800) + IBM Plex Mono (400,500) dari Google Fonts.
   Token utama: ungu #5b2d8e / gradien #33195c→#6d3aa6 / aksen oren #f58220.
   Guna kelas komponen: .app .sidebar .topbar .card .stat .badge .btn
   table.data .tab .rail-step .visa-card .drawer .modal .toast .demo-banner
   ===================================================================== */
/* ==========================================================================
   USM i-Visa Command Centre — stylesheet
   Soft pastel purple dashboard. Plus Jakarta Sans throughout; IBM Plex Mono
   reserved for machine data (MRZ strip, timestamps, references).
   ========================================================================== */

:root {
  /* surfaces */
  --bg: #f5f2fa;
  --surface: #ffffff;
  --line: #e9e2f3;

  /* purple ramp */
  --primary: #5b2d8e;
  --primary-deep: #33195c;
  --primary-mid: #6d3aa6;
  --primary-soft: #f0eaf8;
  --gradient: linear-gradient(120deg, #33195c 0%, #5b2d8e 55%, #6d3aa6 100%);

  /* ink */
  --ink: #2e2044;
  --muted: #6f6382;
  --muted-2: #9a90aa;

  /* accents */
  --orange-line: #f58220;
  --amber: #e8a317;

  /* semantic cards */
  --red-bg: #fcebeb;
  --red-line: #f0c4c4;
  --red: #a83232;

  --amber-bg: #fdf3dc;
  --amber-line: #f2dfae;
  --amber-ink: #9a6b00;

  --orange-bg: #fdf0e0;
  --orange-line-soft: #f3d9b4;
  --orange-ink: #b36a0a;

  --green-bg: #e7f4ec;
  --green-line: #c8e5d5;
  --green: #1f6b42;

  /* geometry */
  --r-btn: 12px;
  --r-card: 18px;
  --r-lg: 20px;
  --r-pill: 999px;

  --shadow: 0 1px 2px rgba(60, 30, 110, .05);
  --shadow-md: 0 4px 16px -6px rgba(60, 30, 110, .14);
  --shadow-lg: 0 18px 50px -18px rgba(60, 30, 110, .34);

  --sidebar-w: 252px;
  --banner-h: 34px;

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font); font-weight: 800; letter-spacing: -.015em; margin: 0; }
a { color: var(--primary); }
button { font-family: inherit; }

.mono { font-family: var(--font-mono); }
.u-right { text-align: right; }
.u-center { text-align: center; }
.u-muted { color: var(--muted); }
.u-nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* eyebrow: uppercase, medium-bold, loose tracking */
.eyebrow, .stat .l, .nav-label, .topbar .crumb, .section-title .tag,
.visa-card .vc-grid .l, .visa-card .vc-issuer, .demo-banner, table.data th {
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
}

/* ---------- Logos -------------------------------------------------------
   The USM lockup is vertical (crest + USM + wordmark stacked), so it needs
   real height to stay legible. The crest alone is used wherever space is
   tight: the sidebar rail and the Visa Health Card.
   ----------------------------------------------------------------------- */

.logo-chip {
  background: #fff; border-radius: 12px;
  display: inline-flex; align-items: center; box-shadow: var(--shadow);
}
.logo-chip img { display: block; width: auto; height: 34px; }

.logo-chip--hero { padding: 14px 18px; }
.logo-chip--hero img { height: 60px; }

.logo-chip--card { padding: 6px 8px; border-radius: 9px; }
.logo-chip--card img { height: 30px; }

/* full USM + APEX lockup, sized by width so the wordmarks stay legible */
.logo-lockup { display: block; width: 100%; max-width: 206px; height: auto; }
.logo-mark { display: block; height: 62px; width: auto; }
.logo-crest { display: block; height: 42px; width: auto; flex: none; }

/* ---------- Demo banner ------------------------------------------------- */

.demo-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--banner-h);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--amber-bg); color: var(--amber-ink);
  border-bottom: 1px solid var(--amber-line);
  font-size: 11px; letter-spacing: .1em;
}
.demo-banner .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .2 } }

/* ---------- Login ------------------------------------------------------
   Split screen. Left: a passport-page in spirit — engraved guilloche, the
   university mark, and a rubber stamp that lands on load. Right: the four
   demo roles, nothing else competing for attention.
   ----------------------------------------------------------------------- */

.login-wrap {
  min-height: calc(100vh - var(--banner-h));
  padding: 24px 22px 30px;
  display: grid; grid-template-columns: 1.08fr 1fr; gap: 22px;
  background: var(--bg);
}

.login-hero {
  background: var(--gradient); color: #fff;
  border-radius: var(--r-lg); border-bottom: 4px solid var(--orange-line);
  padding: 40px 44px 36px;
  display: flex; flex-direction: column; gap: 30px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
/* engraved security pattern, as on a visa page */
.login-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .16;
  background-image: repeating-radial-gradient(circle at 88% 14%, transparent 0 17px, rgba(245, 130, 32, .5) 17px 17.8px);
}
.login-hero::after {
  content: ""; position: absolute; left: -140px; bottom: -180px;
  width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .09) 0%, transparent 64%);
}
.login-hero > * { position: relative; z-index: 1; }

.hero-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-eyebrow {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
  color: #f6c98a; line-height: 1.7; max-width: 22ch;
}

.hero-mid { margin-top: auto; }
.hero-mid h1 { font-size: clamp(30px, 3.3vw, 46px); line-height: 1.06; color: #fff; font-weight: 800; }
.hero-sub-en {
  margin-top: 14px; padding-top: 13px; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 600; color: #cbbadf; line-height: 1.7;
  border-top: 1px solid rgba(255, 255, 255, .18); max-width: 46ch;
}
.hero-mid .sub { margin: 16px 0 0; font-size: 14.5px; line-height: 1.65; color: #ddd2ec; max-width: 46ch; }

/* live case-load ticker, drawn from the mock data */
.ticker { margin-top: auto; }
.ticker-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: #b9a8cf;
}
.ticker-head .n { margin-left: auto; font-family: var(--font-mono); letter-spacing: .06em; color: #fff; }
.ticker-bar {
  display: flex; height: 9px; border-radius: var(--r-pill); overflow: hidden;
  background: rgba(255, 255, 255, .12);
}
.ticker-bar span { height: 100%; transform-origin: left; animation: growX .9s .25s both cubic-bezier(.22, 1, .36, 1); }
@keyframes growX { from { transform: scaleX(0) } }
.ticker-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.ticker-legend div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #cbbadf; }
.ticker-legend .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ticker-legend .n { font-family: var(--font-mono); color: #fff; font-size: 12.5px; }

/* the stamp: lands once, then sits there */
.stamp {
  position: absolute; right: 38px; bottom: 46px; z-index: 1;
  border: 2.5px double rgba(245, 130, 32, .6); border-radius: 7px;
  padding: 9px 16px 8px; text-align: center; color: rgba(249, 201, 143, .82);
  transform: rotate(-8deg); pointer-events: none;
  animation: stampIn .5s .45s both cubic-bezier(.2, .85, .25, 1);
}
.stamp span { display: block; font-family: var(--font-mono); text-transform: uppercase; }
.stamp .l1 { font-size: 13px; font-weight: 500; letter-spacing: .16em; }
.stamp .l2 { font-size: 9px; letter-spacing: .18em; margin-top: 3px; opacity: .78; }
.stamp .rule { height: 1px; background: rgba(245, 130, 32, .45); margin: 6px 0 5px; }
@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-16deg) scale(1.6) }
  65% { opacity: 1; transform: rotate(-8deg) scale(.95) }
  100% { opacity: 1; transform: rotate(-8deg) scale(1) }
}

/* right panel */
.login-panel { display: flex; align-items: center; justify-content: center; padding: 20px 10px; }
.panel-inner { width: 100%; max-width: 460px; }
.login-panel h2 { font-size: 27px; margin-bottom: 5px; }
.login-panel .lead { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.demo-cards { display: grid; gap: 11px; }
.demo-card {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  padding: 15px 16px 15px 17px; text-align: left; width: 100%; cursor: pointer;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: border-color .16s, transform .16s, box-shadow .16s;
  animation: fadeUp .5s both; animation-delay: calc(var(--i) * 70ms + 120ms);
}
.demo-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--primary)); opacity: 0; transition: opacity .16s;
}
.demo-card:hover { border-color: var(--accent, var(--primary)); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.demo-card:hover::before { opacity: 1; }
.demo-card:hover .go { transform: translateX(3px); }
.demo-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px) } }

.demo-card[data-role="student"] { --accent: #1f6b42; }
.demo-card[data-role="secretariat"] { --accent: #5b2d8e; }
.demo-card[data-role="director"] { --accent: #f58220; }
.demo-card[data-role="admin"] { --accent: #6f6382; }

.demo-card .avatar {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: .02em;
  background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent);
}
.demo-card .dc-text { min-width: 0; }
.demo-card .role { display: block; font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.demo-card .creds { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); margin-top: 1px; }
.demo-card .note { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.demo-card .go { color: var(--accent, var(--primary)); font-size: 17px; transition: transform .16s; }

.manual-login { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.manual-login summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.manual-login summary::-webkit-details-marker { display: none; }
.manual-login summary::before { content: "+ "; font-family: var(--font-mono); color: var(--primary); }
.manual-login[open] summary::before { content: "− "; }
.manual-login .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.manual-login .row input { flex: 1 1 140px; }

.disclaimer {
  margin-top: 20px; font-size: 11.5px; line-height: 1.65; color: var(--amber-ink);
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  border-radius: var(--r-btn); padding: 12px 14px;
}
.disclaimer b { font-weight: 700; }

/* ---------- App shell --------------------------------------------------- */

.app { display: none; }
.app.active { display: block; }

.sidebar {
  position: fixed; top: var(--banner-h); left: 0; bottom: 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px 14px;
  /* The aside itself never scrolls — only .nav inside it does, so the brand
     stays at the top and the account row stays at the bottom. */
  overflow: hidden;
}
.sidebar .brand {
  padding: 0 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
}
.sidebar .brand b { display: block; font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.15; }
.sidebar .brand small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--muted-2); }

.nav { display: flex; flex-direction: column; gap: 2px; }

/* A staff account holding several roles renders every section, which on a
   laptop is taller than the viewport. Without this the overflow was simply
   cut off: Administration and the logout row could not be reached at all.
   min-height:0 is the part that matters — a flex child will not shrink below
   its content without it, so overflow-y alone would do nothing. */
.sidebar .nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  /* room for the scrollbar so it never sits on the active item's edge */
  margin-right: -6px; padding-right: 6px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.sidebar .nav::-webkit-scrollbar { width: 8px; }
.sidebar .nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.sidebar .nav::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
.sidebar .nav::-webkit-scrollbar-track { background: transparent; }
.nav-label { font-size: 10px; letter-spacing: .12em; color: var(--muted-2); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-btn);
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; cursor: pointer;
  border-left: 3px solid transparent;
}
.nav a:hover { background: var(--primary-soft); color: var(--primary); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; border-left-color: var(--orange-line); }
.nav .ico { width: 16px; text-align: center; }
.nav .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--red); }

.sidebar .who {
  margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px;
  display: flex; align-items: center; gap: 10px;
  /* Pinned: the nav scrolls past it, this row does not scroll away. */
  flex: none;
}
.sidebar .who .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.sidebar .who b { font-size: 13px; font-weight: 700; display: block; line-height: 1.2; }
.sidebar .who small { font-size: 11px; color: var(--muted-2); }
.sidebar .who button { margin-left: auto; background: none; border: none; color: var(--muted-2); cursor: pointer; font-size: 16px; }
.sidebar .who button:hover { color: var(--red); }

.main { margin-left: var(--sidebar-w); padding-top: var(--banner-h); min-height: 100vh; }

/* purple gradient banner with the thin orange accent line beneath */
.topbar {
  position: sticky; top: var(--banner-h); z-index: 30;
  background: var(--gradient); color: #fff;
  border-bottom: 3px solid var(--orange-line);
  padding: 18px 30px; display: flex; align-items: center; gap: 16px;
}
.topbar h1 { font-size: 22px; color: #fff; }
.topbar .crumb { font-size: 10.5px; color: #c9b8dd; }
.topbar .spacer { flex: 1; }
.topbar .chip {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; border-radius: var(--r-pill); padding: 5px 12px; font-size: 11.5px; font-weight: 600;
}
.content { padding: 24px 30px 70px; max-width: 1500px; }

/* ---------- Cards ------------------------------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card > header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card > header h3 { font-size: 16.5px; font-weight: 800; }
.card > header .spacer { flex: 1; }
.card-sub { font-size: 12.5px; color: var(--muted); margin: -8px 0 14px; }

.section-title { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { font-size: 19px; }
.section-title .rule { flex: 1; height: 1px; background: var(--line); }
.section-title .tag { font-size: 10px; color: var(--muted-2); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }

/* colour-coded stat cards */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.stat.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat .l { font-size: 10.5px; color: var(--muted); }
.stat .n { font-size: 32px; font-weight: 800; line-height: 1.1; margin-top: 5px; letter-spacing: -.02em; }
.stat .d { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; font-weight: 500; }

.stat.is-red { background: var(--red-bg); border-color: var(--red-line); }
.stat.is-red .n { color: var(--red); }
.stat.is-red .l { color: var(--red); opacity: .82; }

.stat.is-orange { background: var(--orange-bg); border-color: var(--orange-line-soft); }
.stat.is-orange .n { color: var(--orange-ink); }

.stat.is-yellow { background: var(--amber-bg); border-color: var(--amber-line); }
.stat.is-yellow .n { color: var(--amber); }

.stat.is-green { background: var(--green-bg); border-color: var(--green-line); }
.stat.is-green .n { color: var(--green); }

/* ---------- Buttons ----------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-btn); padding: 9px 15px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(91, 45, 142, .3);
}
.btn-primary:hover { background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; }
.btn-gold {
  background: var(--orange-line); border-color: var(--orange-line); color: #fff;
  box-shadow: 0 2px 8px rgba(245, 130, 32, .3);
}
.btn-gold:hover { background: #dd7016; border-color: #dd7016; color: #fff; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Badges ------------------------------------------------------ */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--primary-soft); color: var(--primary); white-space: nowrap;
  border: 1px solid transparent;
}
.badge.green { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.badge.yellow { background: var(--amber-bg); color: var(--amber-ink); border-color: var(--amber-line); }
.badge.orange { background: var(--orange-bg); color: var(--orange-ink); border-color: var(--orange-line-soft); }
.badge.red { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.badge.grey { background: #f2eff7; color: var(--muted); }
.badge .pip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.sim-tag {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange-ink); background: var(--orange-bg); border: 1px solid var(--orange-line-soft);
  border-radius: var(--r-pill); padding: 2px 8px; vertical-align: middle;
}

/* ---------- Inputs ------------------------------------------------------ */

/*
 * Every text-like control, matched by EXCLUSION rather than by listing types.
 * Listing them is how email, search, file and datetime-local ended up as raw
 * browser boxes sitting next to a themed password field — the next new input
 * type would have done it again. :where() keeps the specificity at 0,0,1 so any
 * existing class rule still overrides it.
 */
input:where(:not(
  [type="checkbox"], [type="radio"], [type="range"], [type="color"],
  [type="hidden"], [type="submit"], [type="button"], [type="reset"]
)),
select,
textarea,
.input {
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

/* The native control keeps its own inset box on iOS unless this is cleared. */
input:where(:not(
  [type="checkbox"], [type="radio"], [type="range"], [type="color"],
  [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="file"]
)),
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--muted-2); opacity: 1; }

/*
 * Focus: a purple border plus a soft halo. The outline stays as well — removing
 * it would leave keyboard users with nothing in forced-colours mode, where
 * box-shadow is not painted.
 */
input:focus, select:focus, textarea:focus, .input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--bg);
  color: var(--muted-2);
  cursor: not-allowed;
}

/*
 * Select. appearance:none above removed the native arrow, so one is drawn back
 * in — identical in every browser, and the same height as a text input.
 *
 * The chevron is a data URI, which cannot read a CSS variable, so it carries
 * the literal value of --muted (#6f6382). Keep the two in step if that token
 * ever changes.
 */
select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236f6382' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
select:disabled { opacity: .75; }

textarea { min-height: 96px; resize: vertical; }

/* Date pickers: tone the browser's icon down to match the muted labels. */
input::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input:hover::-webkit-calendar-picker-indicator,
input:focus::-webkit-calendar-picker-indicator { opacity: 1; }

/*
 * File input. The control itself becomes the frame; its button is restyled to
 * match .btn so "Choose file" stops looking like a stray piece of the browser.
 */
input[type="file"] {
  padding: 7px 12px 7px 7px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--line);
  border-radius: calc(var(--r-btn) - 4px);
  padding: 7px 13px;
  margin-right: 11px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
input[type="file"]:hover::file-selector-button {
  background: var(--surface);
  border-color: var(--primary);
}

label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ---------- Tables ------------------------------------------------------ */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 10px; color: var(--muted); padding: 12px;
  background: #faf8fd; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #f4f1f8; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fbf9fd; }
table.data tbody tr.sel { background: var(--primary-soft); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); }
.empty { padding: 44px; text-align: center; color: var(--muted); }
.empty b { display: block; font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }

/* ---------- Tabs / filters ---------------------------------------------- */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--line); background: var(--surface); padding: 8px 13px; font-size: 12.5px;
  color: var(--muted); cursor: pointer; border-radius: var(--r-pill); font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(91, 45, 142, .28); }
.tab .count { font-family: var(--font-mono); font-size: 11px; background: var(--primary-soft); color: var(--primary); padding: 1px 7px; border-radius: var(--r-pill); }
.tab.active .count { background: rgba(255, 255, 255, .22); color: #fff; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }

/* ---------- Visa Health Card (signature element) ------------------------- */

.visa-card {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--gradient); color: #fff; box-shadow: var(--shadow-lg);
}
.visa-card .guilloche {
  position: absolute; inset: 0; opacity: .13; pointer-events: none;
  background-image: repeating-radial-gradient(circle at 84% 20%, transparent 0 13px, rgba(245, 130, 32, .55) 13px 13.7px);
}
.visa-card .vc-body { position: relative; padding: 22px 24px 20px; }
.visa-card .vc-top { display: flex; align-items: flex-start; gap: 14px; }
.visa-card .vc-issuer { font-size: 9.5px; letter-spacing: .14em; color: #f6c98a; }
.visa-card .vc-title { font-size: 21px; font-weight: 800; margin-top: 2px; }
.visa-card .vc-risk { margin-left: auto; text-align: right; }
.visa-card .vc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; margin-top: 24px; }
.visa-card .vc-grid .l { font-size: 9px; letter-spacing: .13em; color: #b9a8cf; }
.visa-card .vc-grid .v { font-family: var(--font-mono); font-size: 15px; margin-top: 4px; color: #fff; }
.visa-card .vc-grid .v.big { font-family: var(--font); font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.visa-card .vc-next {
  margin-top: 20px; padding: 12px 15px; border-radius: var(--r-btn);
  background: rgba(245, 130, 32, .15); border: 1px solid rgba(245, 130, 32, .4);
  font-size: 13.5px; display: flex; align-items: center; gap: 10px;
}
.visa-card .vc-next b { color: #f9c98f; font-weight: 700; }
.visa-card .mrz {
  background: #f4f1f8; color: #2e2044; padding: 11px 24px 13px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; line-height: 1.5;
  border-top: 2px dashed rgba(255, 255, 255, .4); overflow: hidden; white-space: nowrap;
}

/* ---------- Passport chain-of-custody rail ------------------------------- */

.rail { position: relative; padding: 26px 4px 4px; overflow-x: auto; }
.rail-track { display: flex; min-width: 780px; }
.rail-step { flex: 1; position: relative; text-align: center; padding-top: 26px; }
.rail-step::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 2px; background: var(--line); }
.rail-step:first-child::before { left: 50%; }
.rail-step:last-child::before { right: 50%; }
.rail-step .knob {
  position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--line); z-index: 1;
}
.rail-step.done::before { background: var(--primary); }
.rail-step.done .knob { background: var(--primary); border-color: var(--primary); }
.rail-step.now .knob { background: var(--orange-line); border-color: var(--orange-line); box-shadow: 0 0 0 5px rgba(245, 130, 32, .2); }
.rail-step.now::before { background: linear-gradient(90deg, var(--primary) 50%, var(--line) 50%); }
.rail-step .s-name { font-size: 11.5px; font-weight: 600; padding: 0 4px; }
.rail-step .s-date { font-family: var(--font-mono); font-size: 10px; color: var(--muted-2); }
.rail-step.pending .s-name { color: var(--muted-2); font-weight: 400; }

/* ---------- Timeline ----------------------------------------------------- */

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 5px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--line);
}
.tl-item.done::before { background: var(--primary); border-color: var(--primary); }
.tl-item.now::before { background: var(--orange-line); border-color: var(--orange-line); box-shadow: 0 0 0 4px rgba(245, 130, 32, .18); }
.tl-item .t { font-size: 13.5px; font-weight: 600; }
.tl-item.pending .t { color: var(--muted-2); font-weight: 400; }
.tl-item .m { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }

/* ---------- Lists -------------------------------------------------------- */

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f4f1f8; }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-size: 13.5px; font-weight: 600; }
.list-row .m { font-size: 12px; color: var(--muted); }
.list-row .ico-box {
  width: 34px; height: 34px; border-radius: 11px; background: var(--primary-soft);
  color: var(--primary); display: grid; place-items: center; font-size: 14px; flex: none;
}
.list-row.urgent .ico-box { background: var(--red-bg); color: var(--red); }

.log { font-size: 12.5px; }
.log-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f6f3fa; }
.log-row:last-child { border-bottom: none; }
.log-row .ts { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.log-row .who { font-weight: 700; }
.log-row .delta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.log-row .delta ins { text-decoration: none; color: var(--green); }
.log-row .delta del { color: var(--red); }

/* ---------- Bars / charts ------------------------------------------------ */

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 58px; align-items: center; gap: 12px; }
.bar-row .lbl { font-size: 12.5px; font-weight: 500; }
.bar-track { height: 10px; border-radius: var(--r-pill); background: #f0ebf7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-pill); background: var(--primary); transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.bar-fill.green { background: var(--green); }
.bar-fill.yellow { background: var(--amber); }
.bar-fill.orange { background: var(--orange-ink); }
.bar-fill.red { background: var(--red); }
.bar-row .val { font-family: var(--font-mono); font-size: 12.5px; text-align: right; color: var(--muted); }

.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; font-size: 13px; min-width: 180px; }
.donut-legend div { display: flex; align-items: center; gap: 9px; }
.donut-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend .n { font-family: var(--font-mono); margin-left: auto; color: var(--muted); }

/* ---------- Overlays ----------------------------------------------------- */

.scrim {
  position: fixed; inset: 0; background: rgba(46, 32, 68, .42); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 94vw); z-index: 80;
  background: var(--bg); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.22, 1, .36, 1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  background: var(--gradient); color: #fff; border-bottom: 3px solid var(--orange-line);
  padding: 20px 24px; display: flex; align-items: flex-start; gap: 14px; flex: none;
}
.drawer-head h2 { font-size: 21px; color: #fff; }
.drawer-head .m { font-family: var(--font-mono); font-size: 11.5px; color: #c9b8dd; }
.drawer-head .x { margin-left: auto; background: none; border: none; font-size: 24px; color: #c9b8dd; cursor: pointer; line-height: 1; }
.drawer-head .x:hover { color: #fff; }
.drawer-body { overflow-y: auto; padding: 20px 24px 60px; }

.modal {
  position: fixed; z-index: 90; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.98);
  width: min(560px, 92vw); max-height: 84vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { padding: 22px 24px 0; }
.modal-head h3 { font-size: 19px; }
.modal-head p { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.modal-body { padding: 18px 24px; }
.modal-foot { padding: 0 24px 22px; display: flex; gap: 8px; justify-content: flex-end; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-btn);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px; animation: rise .25s cubic-bezier(.22, 1, .36, 1);
}
.toast .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--orange-line); flex: none; }
@keyframes rise { from { transform: translateY(8px); opacity: 0 } }

/* ---------- Kanban board -------------------------------------------------- */

.board { display: grid; grid-template-columns: repeat(8, minmax(164px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: #f4f1f9; border: 1px solid var(--line); border-radius: 14px; padding: 11px; min-width: 164px; }
.board-col h4 { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.board-col .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--primary); }
.board-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 10px; margin-top: 8px; font-size: 12px; cursor: pointer; box-shadow: var(--shadow);
}
.board-card:hover { border-color: var(--primary); }
.board-card b { display: block; font-size: 12.5px; font-weight: 700; }
.board-card .m { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); }
.board-col.overdue { background: var(--red-bg); border-color: var(--red-line); }
.board-col.overdue .board-card { border-left: 3px solid var(--red); }

/* ---------- Misc ---------------------------------------------------------- */

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; }

.brief {
  background: var(--gradient); color: #e6def0; border-radius: var(--r-lg); padding: 22px 24px;
  border-bottom: 3px solid var(--orange-line); box-shadow: var(--shadow-md);
}
.brief h3 { color: #fff; font-size: 18px; margin-bottom: 6px; }
.brief .date { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #f6c98a; }
.brief p { margin: 10px 0 0; font-size: 14px; line-height: 1.65; }
.brief b { color: #f9c98f; font-weight: 700; }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }
input[type="checkbox"] { width: auto; accent-color: var(--primary); }

.note-card { background: #faf8fd; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; font-size: 13px; }
.note-card .m { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }

.callout {
  border: 1px solid var(--line); background: var(--primary-soft); border-radius: 14px;
  padding: 13px 15px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; color: var(--ink);
}
.callout.warn { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber-ink); }

/* ---------- Bilingual overlay --------------------------------------------
   The Chinese gloss rides alongside the English, never replaces it. It is
   smaller, lighter and never inherits uppercase or letter-spacing from the
   element it sits inside.
   ------------------------------------------------------------------------- */

.zh {
  font-size: .84em; font-weight: 500; opacity: .72;
  margin-left: .38em; letter-spacing: normal; text-transform: none;
  white-space: nowrap;
}
.stat .n .zh { font-size: .4em; }
.visa-card .zh, .brief .zh, .drawer-head .zh, .topbar .zh { opacity: .85; }
table.data th .zh { font-weight: 500; }

.lang-toggle {
  display: inline-flex; gap: 2px; flex: none;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--r-pill); padding: 3px;
}
.lang-toggle button {
  border: none; background: none; color: #d8cbe8; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600;
  padding: 5px 13px; border-radius: var(--r-pill); white-space: nowrap;
}
.lang-toggle button:hover { color: #fff; }
.lang-toggle button.on { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.lang-toggle button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* ---------- Responsive ----------------------------------------------------- */

@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 34px 30px 32px; gap: 26px; }
  .stamp { right: 24px; bottom: 26px; }
}
@media (max-width: 900px) {
  .g3, .g2 { grid-template-columns: 1fr; }
  .visa-card .vc-grid { grid-template-columns: repeat(2, 1fr); }
  .visa-card .mrz { font-size: 9px; padding-left: 16px; padding-right: 16px; letter-spacing: .02em; }
  .logo-chip--hero { padding: 10px 12px; max-width: 100%; }
  .logo-chip--hero img { height: auto; width: 100%; max-width: 230px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex !important; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; }
  .topbar .chip { display: none; }
  .lang-toggle button { padding: 5px 9px; font-size: 10.5px; }
  .login-panel { padding: 4px 0 10px; }
  .login-wrap { padding: 16px 14px 24px; gap: 16px; }
  .login-hero { padding: 28px 22px 26px; }
  .hero-mid h1 { font-size: 29px; }
  .stamp { position: static; align-self: flex-start; transform: rotate(-4deg); margin-top: 4px; }
  .ticker-legend { gap: 8px 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
.menu-btn { display: none; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .25); color: #fff; }
.menu-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; border-color: rgba(255, 255, 255, .35); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Print (executive report) --------------------------------------- */

@media print {
  .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .report { max-width: none; padding: 0; }
  .report .card, .report .table-wrap, .report .stat { box-shadow: none; break-inside: avoid; }
  .report h2 { break-after: avoid; }
  @page { size: A4; margin: 16mm 14mm; }
}

/* ---- list tables: shared footer, sortable headings, row numbers ---- */
.jadual-kaki {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-top: 14px;
}
.pager-ringkas { display: flex; align-items: center; gap: 10px; }

table.data th a.th-sort {
  color: inherit; text-decoration: none; display: inline-block; white-space: nowrap;
}
table.data th a.th-sort:hover { color: var(--primary); }
table.data th a.th-sort.sort-aktif { color: var(--primary); }

/* The row-number column: present, and quiet. */
table.data td.no-baris, table.data th.no-baris {
  width: 46px; text-align: right; color: var(--muted-2);
  font-family: var(--font-mono); font-size: 11.5px;
}
