/* ==========================================================================
   PWMP MIS — base, layout and components
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02','cv03','cv04','tnum' 0;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-3);
  color: var(--text);
  letter-spacing: -.008em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p  { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--secondary); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--primary); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

img, svg, video { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--divider); margin: var(--sp-5) 0; }
[hidden] { display: none !important; }

::selection { background: var(--primary-soft); color: var(--text); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); background-clip: content-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--primary); color: #fff; padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--r-md) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.display { font-family: var(--font-display); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-success { color: var(--success-text); }
.text-danger  { color: var(--danger-text); }
.text-warning { color: var(--warning-text); }
.text-info    { color: var(--info-text); }
.text-primary { color: var(--primary); }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-center { text-align: center; } .text-right { text-align: right; } .text-left { text-align: left; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.upper { text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-2xs); font-weight: 600; }

/* Utility layout */
.flex { display: flex; } .grid { display: grid; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1 1 auto; min-width: 0; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.mt-0{margin-top:0}.mt-1{margin-top:var(--sp-1)}.mt-2{margin-top:var(--sp-2)}.mt-3{margin-top:var(--sp-3)}.mt-4{margin-top:var(--sp-4)}.mt-5{margin-top:var(--sp-5)}.mt-6{margin-top:var(--sp-6)}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:var(--sp-1)}.mb-2{margin-bottom:var(--sp-2)}.mb-3{margin-bottom:var(--sp-3)}.mb-4{margin-bottom:var(--sp-4)}.mb-5{margin-bottom:var(--sp-5)}.mb-6{margin-bottom:var(--sp-6)}
.w-full { width: 100%; } .h-full { height: 100%; } .nowrap { white-space: nowrap; }
.relative { position: relative; }
.hide { display: none !important; }

.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.75;
      stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-lg { width: 1.5em; height: 1.5em; }
.ic-sm { width: 1em; height: 1em; }
/* svg is display:block above; an icon written inside a line of text stays on that line. */
h1 > .ic, h2 > .ic, h3 > .ic, p > .ic, b > .ic, .row-sub > .ic, .check > span > .ic { display: inline-block; vertical-align: -.15em; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  z-index: 40;
  transition: width var(--dur-base) var(--ease-out);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar::after {
  /* subtle emblem watermark */
  content: ''; position: absolute; right: -70px; bottom: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(63,180,95,.14) 0%, transparent 68%);
  pointer-events: none;
}
.app.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-brand {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  min-height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex: none;
}
.sidebar-brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; padding: 2px; flex: none; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-text b {
  display: block; font-family: var(--font-display); font-size: var(--fs-md);
  color: #fff; line-height: 1.25; white-space: nowrap;
}
.sidebar-brand-text span { display: block; font-size: var(--fs-2xs); color: var(--sidebar-muted); }
.app.is-collapsed .sidebar-brand-text { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--sp-3) var(--sp-2) var(--sp-6); }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); background-clip: content-box; }

.nav-group-label {
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--sidebar-muted);
}
.app.is-collapsed .nav-group-label { text-align: center; font-size: 0; padding: var(--sp-3) 0; }
.app.is-collapsed .nav-group-label::after {
  content: ''; display: block; height: 1px; background: rgba(255,255,255,.1); margin: 0 var(--sp-3);
}

.nav-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: var(--fs-base); font-weight: 500;
  position: relative;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-item:hover { background: var(--sidebar-hover-bg); color: #fff; }
.nav-item.is-active { background: var(--sidebar-active-bg); color: #fff; font-weight: 600; }
.nav-item.is-active::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: var(--r-full); background: var(--green-400);
}
.nav-item .ic { opacity: .88; }
.nav-item.is-active .ic { opacity: 1; color: var(--green-300); }
.nav-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  background: var(--red-500); color: #fff; font-size: var(--fs-2xs); font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; justify-content: center;
}
.app.is-collapsed .nav-item { justify-content: center; padding: var(--sp-3) 0; }
.app.is-collapsed .nav-item-label, .app.is-collapsed .nav-badge { display: none; }
.app.is-collapsed .nav-item::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--navy-700); color: #fff; padding: 6px 10px; border-radius: var(--r-xs);
  font-size: var(--fs-xs); white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast); z-index: 60; box-shadow: var(--shadow-md);
}
.app.is-collapsed .nav-item:hover::after { opacity: 1; }

.sidebar-foot { flex: none; padding: var(--sp-3); border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2); border-radius: var(--r-sm);
  transition: background var(--dur-fast);
}
.sidebar-user:hover { background: var(--sidebar-hover-bg); }
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-info b { display: block; color: #fff; font-size: var(--fs-sm); font-weight: 600; }
.sidebar-user-info span { display: block; font-size: var(--fs-2xs); color: var(--sidebar-muted); }
.app.is-collapsed .sidebar-user-info { display: none; }

/* ---- Main column -------------------------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-5);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 35;
}
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { font-size: var(--fs-lg); margin: 0; }
.topbar-title .crumb { font-size: var(--fs-xs); color: var(--text-subtle); }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; color: var(--text-muted);
  border-radius: var(--r-sm); cursor: pointer; position: relative;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red-500); border: 2px solid var(--surface);
}

.content {
  flex: 1;
  padding: var(--sp-6) var(--sp-5) var(--sp-12);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5);
}
.page-head h1 { font-size: var(--fs-2xl); margin: 0 0 var(--sp-1); }
.page-head .sub { color: var(--text-muted); font-size: var(--fs-base); margin: 0; max-width: 68ch; }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px 16px;
  font-family: inherit; font-size: var(--fs-base); font-weight: 600; line-height: 1.3;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; position: relative; overflow: hidden;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast),
              border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
  -webkit-user-select: none; user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .58; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: var(--primary-text); box-shadow: var(--shadow-xs); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: var(--blue-600); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--surface-3); border-color: var(--text-subtle); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--red-700); }
.btn-success { background: var(--success); color: #fff; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); }

.btn-sm { padding: 6px 11px; font-size: var(--fs-sm); }
.btn-lg { padding: 12px 22px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }

.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ripple, applied by app.js */
.ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: currentColor; opacity: .28; pointer-events: none;
  animation: ripple .55s var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

.btn-group { display: inline-flex; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.btn-group .btn { border-radius: 0; border: 0; border-right: 1px solid var(--border); box-shadow: none; }
.btn-group .btn:last-child { border-right: 0; }
.btn-group .btn.is-active { background: var(--primary-soft); color: var(--primary); }

/* ==========================================================================
   Cards & surfaces
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--divider);
}
.card-head h2, .card-head h3 { margin: 0; font-size: var(--fs-md); }
.card-head .sub { font-size: var(--fs-xs); color: var(--text-subtle); margin: 2px 0 0; }
.card-body { padding: var(--sp-5); }
.card-body.tight { padding: var(--sp-3); }
.card-body.flush { padding: 0; }
.card-foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--divider);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.card-link { display: block; color: inherit; transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.card-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); color: inherit; }

/* Callout cards — a hairline accent on the leading edge, not a coloured frame. */
.card.is-notice   { border-left: 3px solid var(--warning); }
.card.is-critical { border-left: 3px solid var(--danger); }
.card.is-notice .card-head, .card.is-critical .card-head { background: var(--surface-2); }

.grid-cards { display: grid; gap: var(--sp-4); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.grid-cards > .span-2 { grid-column: span 2; }
@media (max-width: 900px) { .grid-cards > .span-2 { grid-column: auto; } }
.split-2 { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 1100px) { .split-2 { grid-template-columns: 1.6fr 1fr; } }

/* ---- KPI tile -----------------------------------------------------------
   A row of tiles has to read as one instrument panel, so the frame stays
   neutral everywhere: colour is reserved for the status dot and the footing
   badges, which is the only colour on a tile that carries meaning. Tiles are
   flex columns so the footing line sits on a common baseline across the row,
   however much content sits above it.                                       */
.kpi {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-5);
  position: relative;
}
.kpi-label {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500;
  line-height: var(--lh-tight); margin-bottom: var(--sp-2);
}
/* Status dot — same vocabulary as .badge::before. It only takes colour on a
   tile whose --accent is a real status, so a row shows colour exactly where
   something needs attention and keeps a common text inset either way. */
.kpi-label::before {
  content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent, transparent);
}
.kpi-icon + .kpi-label { padding-right: 40px; }
.kpi-value {
  font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 600;
  line-height: 1.12; color: var(--text); font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 6px;
}
/* Money, byte sizes and dates need a step down to stay on one line. */
.kpi-value.compact { font-size: var(--fs-2xl); }
.kpi-value.sm      { font-size: var(--fs-lg); }
.kpi-value.muted   { color: var(--text-subtle); }
.kpi-value.pos     { color: var(--success-text); }
.kpi-value.neg     { color: var(--danger-text); }
.kpi-value small { font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); font-family: var(--font-body); }
.kpi-foot {
  margin-top: auto; padding-top: var(--sp-3);
  font-size: var(--fs-xs); color: var(--text-subtle);
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; row-gap: var(--sp-1);
}
.kpi-trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.kpi-trend.up { color: var(--success-text); } .kpi-trend.down { color: var(--danger-text); }
.kpi-icon {
  position: absolute; right: var(--sp-4); top: var(--sp-4);
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-muted);
}
.kpi-icon .ic { width: 16px; height: 16px; }

/* ==========================================================================
   Badges, chips, pills
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.45;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-plain::before { display: none; }
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-info    { background: var(--info-soft);    color: var(--info-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger-text); }
.badge-neutral { background: var(--neutral-soft); color: var(--neutral-text); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-full);
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted);
}
.chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
label.chip { cursor: pointer; }
.chip input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.chip button { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; display: grid; place-items: center; }

.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 700; color: #fff;
  background: var(--brand-gradient);
  font-family: var(--font-body);
}
.avatar-sm { width: 26px; height: 26px; font-size: var(--fs-2xs); }
.avatar-lg { width: 52px; height: 52px; font-size: var(--fs-md); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ==========================================================================
   Progress
   ========================================================================== */
.progress {
  height: 7px; background: var(--surface-3); border-radius: var(--r-full);
  overflow: hidden; position: relative;
}
.progress-bar {
  height: 100%; border-radius: var(--r-full);
  background: var(--primary);
  transition: width .8s var(--ease-out);
  position: relative;
}
.progress-bar.success { background: var(--success); }
.progress-bar.info    { background: var(--info); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }
.progress-bar.striped {
  background-image: linear-gradient(45deg, rgba(255,255,255,.2) 25%, transparent 25%,
    transparent 50%, rgba(255,255,255,.2) 50%, rgba(255,255,255,.2) 75%, transparent 75%, transparent);
  background-size: 12px 12px;
  animation: stripe 1s linear infinite;
}
@keyframes stripe { to { background-position: 12px 0; } }
.progress-sm { height: 5px; }
.progress-lg { height: 10px; }
/* Marker showing where the plan says we should be today */
.progress-marker {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--text); opacity: .45; border-radius: 1px;
}

.progress-row { display: flex; align-items: center; gap: var(--sp-3); }
.progress-row .progress { flex: 1; }
.progress-row .pct { font-size: var(--fs-xs); font-weight: 600; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* Radial gauge for headline percentages */
.gauge { position: relative; display: inline-grid; place-items: center; }
.gauge svg { transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-linecap: round; }
.gauge .track { stroke: var(--surface-3); }
.gauge .fill { stroke: var(--primary); transition: stroke-dashoffset 1.1s var(--ease-out); }
.gauge-value {
  position: absolute; text-align: center;
  font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
}
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  padding: var(--sp-3) var(--sp-4);
  text-align: left; font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data thead th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.data thead th a:hover { color: var(--primary); }
table.data tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
table.data tbody tr { transition: background var(--dur-fast); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .actions-col { text-align: right; white-space: nowrap; width: 1%; }
table.data .row-title { font-weight: 600; color: var(--text); }
table.data .row-sub { font-size: var(--fs-xs); color: var(--text-subtle); }
table.data tr.is-overdue { background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
table.data tr.is-critical td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.empty {
  padding: var(--sp-12) var(--sp-5); text-align: center; color: var(--text-muted);
}
.empty.sm { padding: var(--sp-8) var(--sp-4); }
.empty.sm .ic { width: 34px; height: 34px; }
.empty .ic { width: 44px; height: 44px; color: var(--text-subtle); margin: 0 auto var(--sp-3); stroke-width: 1.3; }
.empty h3 { font-size: var(--fs-md); color: var(--text); margin-bottom: var(--sp-1); }
.empty p { font-size: var(--fs-sm); max-width: 40ch; margin: 0 auto var(--sp-4); }

.pagination { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs); font-size: var(--fs-sm); font-weight: 500;
  color: var(--text-muted); border: 1px solid transparent;
}
.pagination a:hover { background: var(--surface-3); color: var(--text); }
.pagination .is-current { background: var(--primary); color: #fff; font-weight: 600; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 720px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .form-grid.three { grid-template-columns: repeat(3, 1fr); } }
.form-grid .span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: var(--fs-sm); font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.field > label .req { color: var(--danger); }
.field .hint { font-size: var(--fs-xs); color: var(--text-subtle); line-height: 1.5; }
.field .err { font-size: var(--fs-xs); color: var(--danger-text); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit; font-size: var(--fs-base); line-height: var(--lh-base);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--shadow-focus);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-3); color: var(--text-subtle); cursor: not-allowed;
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.textarea { min-height: 92px; resize: vertical; line-height: var(--lh-base); }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6763' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 34px; cursor: pointer;
}
:root[data-theme="dark"] .select,
html:not([data-theme="light"]) .select { }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa8a2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa8a2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.input-group { display: flex; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .addon {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-left: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: var(--fs-sm); color: var(--text-muted);
  white-space: nowrap;
}

.search-box { position: relative; flex: 1; min-width: 180px; max-width: 420px; }
.search-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.search-box .input { padding-left: 36px; }

.check {
  display: inline-flex; align-items: flex-start; gap: var(--sp-2);
  cursor: pointer; font-size: var(--fs-base); line-height: var(--lh-base);
}
.check input[type="checkbox"], .check input[type="radio"] {
  width: 17px; height: 17px; margin: 3px 0 0; flex: none; accent-color: var(--primary); cursor: pointer;
}
.check span { color: var(--text); }
.check .hint { display: block; font-size: var(--fs-xs); color: var(--text-subtle); }

.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 40px; height: 22px; border-radius: var(--r-full);
  background: var(--border-strong); position: relative; flex: none;
  transition: background var(--dur-base) var(--ease-out);
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-base) var(--ease-spring);
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--shadow-focus); }

.filter-bar {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: var(--sp-4);
}
.filter-bar .select, .filter-bar .input { width: auto; min-width: 140px; }

/* Bilingual field pairing */
.bi-field { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
@media (min-width: 720px) { .bi-field { grid-template-columns: 1fr 1fr; } }
.bi-field .lang-tag {
  font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-subtle);
  padding: 1px 6px; background: var(--surface-3); border-radius: var(--r-xs);
}

/* File drop zone */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--r-md);
  padding: var(--sp-8) var(--sp-5); text-align: center;
  background: var(--surface-inset); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .ic { width: 34px; height: 34px; color: var(--text-subtle); margin: 0 auto var(--sp-2); }
.dropzone.is-over .ic { color: var(--primary); }
.dropzone input[type="file"] { display: none; }
.file-pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 7px 12px; background: var(--surface-3); border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}

/* ==========================================================================
   Alerts & toasts
   ========================================================================== */
.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm); font-size: var(--fs-base);
  border: 1px solid transparent; margin-bottom: var(--sp-4);
}
.alert .ic { flex: none; margin-top: 2px; }
.alert-success { background: var(--success-soft); color: var(--success-text); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-info    { background: var(--info-soft);    color: var(--info-text);    border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.alert-danger  { background: var(--danger-soft);  color: var(--danger-text);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

#toasts {
  position: fixed; z-index: 200; bottom: var(--sp-5); right: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-2);
  max-width: min(400px, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  font-size: var(--fs-base); pointer-events: auto;
  animation: toast-in .38s var(--ease-spring);
}
.toast.is-out { animation: toast-out .3s var(--ease-in-out) forwards; }
.toast-success { border-left-color: var(--success); }
.toast-danger  { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info    { border-left-color: var(--info); }
.toast .ic { flex: none; margin-top: 2px; }
.toast-success .ic { color: var(--success); }
.toast-danger .ic  { color: var(--danger); }
.toast-warning .ic { color: var(--warning); }
.toast-info .ic    { color: var(--info); }
.toast button { background: none; border: 0; cursor: pointer; color: var(--text-subtle); padding: 0; }
@keyframes toast-in  { from { opacity: 0; transform: translateX(28px) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(28px) scale(.96); } }

/* ==========================================================================
   Modal / drawer
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: var(--scrim); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: var(--sp-4);
  animation: fade-in var(--dur-base) var(--ease-out);
  overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 560px; max-height: calc(100dvh - 3rem);
  display: flex; flex-direction: column;
  animation: modal-in .34s var(--ease-spring);
}
.modal-lg { max-width: 860px; }
.modal-sm { max-width: 420px; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--divider);
}
.modal-head h2 { margin: 0; font-size: var(--fs-lg); }
.modal-head .sub { font-size: var(--fs-sm); color: var(--text-muted); margin: 4px 0 0; }
.modal-body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal-foot {
  padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--divider);
  display: flex; justify-content: flex-end; gap: var(--sp-2); background: var(--surface-2);
  flex-wrap: wrap;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 150;
  width: min(460px, 100vw); background: var(--surface);
  box-shadow: var(--shadow-xl); display: flex; flex-direction: column;
  animation: drawer-in .34s var(--ease-out);
}
@keyframes drawer-in { from { transform: translateX(100%); } }

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs {
  display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: var(--sp-3) var(--sp-4); font-size: var(--fs-base); font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  white-space: nowrap; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit;
  transition: color var(--dur-fast), border-color var(--dur-fast);
  display: inline-flex; align-items: center; gap: var(--sp-2);
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab .count {
  font-size: var(--fs-2xs); background: var(--surface-3); color: var(--text-muted);
  padding: 1px 6px; border-radius: var(--r-full); font-weight: 600;
}
.tab.is-active .count { background: var(--primary-soft); color: var(--primary); }

/* ==========================================================================
   Misc components
   ========================================================================== */
.stat-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.stat-row .label { font-size: var(--fs-sm); color: var(--text-muted); min-width: 0; }
.stat-row .value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.timeline { position: relative; padding-left: var(--sp-6); }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--divider);
}
.timeline-item { position: relative; padding-bottom: var(--sp-5); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: calc(-1 * var(--sp-6) + 2px); top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline-item.is-done::before { background: var(--success); border-color: var(--success); }
.timeline-item.is-current::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-item.is-late::before { background: var(--danger); border-color: var(--danger); }
.timeline-title { font-weight: 600; font-size: var(--fs-base); }
.timeline-meta { font-size: var(--fs-xs); color: var(--text-subtle); }

.tree-toggle {
  width: 20px; height: 20px; display: inline-grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--text-subtle);
  border-radius: var(--r-xs); flex: none;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.tree-toggle:hover { background: var(--surface-3); color: var(--text); }
.tree-toggle.is-open { transform: rotate(90deg); }
.tree-indent { display: inline-block; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 210px; padding: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: menu-in .2s var(--ease-out);
}
.dropdown-menu.left { right: auto; left: 0; }
.dropdown-menu.wide { min-width: 320px; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.menu-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-xs);
  font-size: var(--fs-base); color: var(--text); cursor: pointer;
  background: none; border: 0; width: 100%; text-align: left; font-family: inherit;
  transition: background var(--dur-fast);
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item.is-danger { color: var(--danger-text); }
.menu-item.is-danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; background: var(--divider); margin: var(--sp-2) 0; }
.menu-label { padding: var(--sp-2) var(--sp-3) var(--sp-1); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); font-weight: 600; }

.notif-item {
  display: flex; gap: var(--sp-3); padding: var(--sp-3);
  border-radius: var(--r-sm); transition: background var(--dur-fast);
}
.notif-item:hover { background: var(--surface-3); }
.notif-item.is-unread { background: var(--primary-soft); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 6px; }
.notif-body { min-width: 0; }
.notif-body p { font-size: var(--fs-sm); margin: 0 0 2px; }
.notif-body time { font-size: var(--fs-2xs); color: var(--text-subtle); }

/* ---- Compact list rows — shared by the mobile home and desktop cards ----- */
.sa-list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: var(--sp-2);
  color: var(--text); transition: background var(--dur-fast);
}
.sa-list-item:hover { background: var(--surface-3); color: var(--text); }
.sa-list-item:active { background: var(--surface-3); }
.sa-list-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center;
  background: var(--tile-bg, var(--surface-3)); color: var(--tile-fg, var(--text-muted));
}
.sa-list-icon .ic { width: 18px; height: 18px; }
.sa-list-body { flex: 1; min-width: 0; }
.sa-list-body b { display: block; font-size: var(--fs-sm); font-weight: 600; }
.sa-list-body span { display: block; font-size: var(--fs-xs); color: var(--text-subtle); }
.sa-list-item > .ic:last-child { flex: none; color: var(--text-subtle); }
.sa-list-item > .badge { flex: none; }
/* The same row as a control (theme switch, install app, sign out). */
button.sa-list-item {
  width: 100%; text-align: left; font-family: inherit; font-size: inherit;
  background: none; cursor: pointer;
}

/* Rows sitting flush inside a card body (no gap, hairline separators). */
.sa-list-flush > .sa-list-item {
  margin: 0; border: 0; border-radius: 0; background: transparent;
  border-bottom: 1px solid var(--divider);
}
.sa-list-flush > .sa-list-item:last-child { border-bottom: 0; }

/* ---- Skeleton loading --------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-xs);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-line.short { width: 55%; }

/* ==========================================================================
   Script-aware labels
   Small caps and tracking are Latin devices: Lao has no letter case, and
   letter-spacing prises its stacked vowel and tone marks away from the base
   glyph. In Lao the same eyebrow labels are set with weight and colour only.
   ========================================================================== */
:lang(lo) .upper,
:lang(lo) .nav-group-label,
:lang(lo) .menu-label,
:lang(lo) table.data thead th,
:lang(lo) .gantt-head-left,
:lang(lo) .demo-tier-head,
:lang(lo) .ribbon-group-label,
:lang(lo) .kpi-label {
  text-transform: none;
  letter-spacing: 0;
}
:lang(lo) .upper, :lang(lo) .menu-label, :lang(lo) .demo-tier-head { font-size: var(--fs-xs); }

/* ==========================================================================
   Entrance animations
   ========================================================================== */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in-only { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.anim-in { animation: fade-up .5s var(--ease-out) both; }
.anim-fade { animation: fade-in-only .4s var(--ease-out) both; }
.anim-scale { animation: scale-in .4s var(--ease-spring) both; }
.stagger > * { animation: fade-up .5s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(8) { animation-delay: .3s; }
.stagger > *:nth-child(n+9) { animation-delay: .34s; }

/* Revealed by IntersectionObserver in app.js */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Print — used for PDF output so Lao script renders with real fonts
   ========================================================================== */
@media print {
  .sidebar, .topbar, .tabbar, .page-actions, .filter-bar, #toasts,
  .no-print, .fab, .mobile-header { display: none !important; }
  .app, .main { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, .kpi { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .kpi-icon { display: none; }
  table.data thead th { background: #f0f0f0 !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
  .print-only { display: block !important; }
  @page { margin: 16mm 12mm; }
}
.print-only { display: none; }
