/* ==========================================================================
   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 ------------------------------------------------------- */

.login-wrap {
  min-height: calc(100vh - var(--banner-h));
  padding: 26px 22px 34px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  background: var(--bg);
}
.login-hero {
  background: var(--gradient); color: #fff;
  border-radius: var(--r-lg); border-bottom: 4px solid var(--orange-line);
  padding: 46px 44px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.login-hero::after {
  content: ""; position: absolute; right: -110px; bottom: -150px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 130, 32, .16) 0%, transparent 62%);
}
.login-hero h1 { font-size: 42px; line-height: 1.08; margin: 26px 0 12px; color: #fff; font-weight: 800; }
.login-hero .sub { font-size: 15px; color: #ddd2ec; max-width: 44ch; line-height: 1.6; }
.login-hero .eyebrow { font-size: 11px; color: #f6c98a; margin-top: 28px; position: relative; z-index: 1; }
.hero-stats { display: flex; gap: 32px; margin-top: 26px; position: relative; z-index: 1; }
.hero-stats div span { display: block; }
.hero-stats .n { font-size: 32px; font-weight: 800; color: #fff; line-height: 1.1; }
.hero-stats .l { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: #b9a8cf; margin-top: 2px; }

.login-panel { padding: 38px 46px; display: flex; flex-direction: column; justify-content: center; }
.login-panel h2 { font-size: 26px; margin-bottom: 4px; }
.login-panel .lead { color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.demo-cards { display: grid; gap: 12px; }
.demo-card {
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  padding: 14px 16px; text-align: left; width: 100%; cursor: pointer;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.demo-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.demo-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.demo-card .avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.demo-card .role { display: block; font-weight: 700; font-size: 14.5px; }
.demo-card .creds { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.demo-card .go { color: var(--primary); font-size: 18px; }

.manual-login { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.manual-login summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.manual-login .row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.disclaimer {
  margin-top: 24px; font-size: 12px; line-height: 1.6; color: var(--amber-ink);
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  border-radius: var(--r-btn); padding: 12px 14px;
}

/* ---------- 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;
}
.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; }
.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;
}
.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 ------------------------------------------------------ */

input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  font-family: inherit; font-size: 13.5px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-btn); background: var(--surface); color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; 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, .hero-stats .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: 38px 30px; }
  .login-hero h1 { font-size: 34px; }
}
@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: 30px 22px; }
  .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; }
}
