/* ============================================================
   Travel Data Batch System - Lao Airlines
   Main Stylesheet v2.0 â Multi-theme + multilingual fonts
   ============================================================ */

/* ---- GOOGLE FONTS: Noto Sans Lao + Inter ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* ============================================================
   THEME DEFINITIONS via CSS Custom Properties
   ============================================================ */

/* --- DEFAULT: Dark Ocean (Blue) --- */
:root,
[data-theme="dark-blue"] {
  --bg-primary:    #0d1b2a;
  --bg-card:       #112240;
  --bg-card2:      #162a4a;
  --bg-input:      #0a1628;
  --accent:        #00b4d8;
  --accent2:       #0077b6;
  --accent3:       #90e0ef;
  --text-primary:  #ccd6f6;
  --text-muted:    #8892b0;
  --text-bright:   #e6f1ff;
  --success:       #2ec4b6;
  --warning:       #f4a261;
  --danger:        #e76f51;
  --info:          #4cc9f0;
  --border:        #1e3a5f;
  --sidebar-bg:    linear-gradient(180deg, #0a1628 0%, #0d1f3c 100%);
  --topbar-bg:     rgba(13,27,42,.95);
  --card-hover:    rgba(0,180,216,.04);
  --shadow:        0 4px 20px rgba(0,0,0,.4);
  --theme-name:    "Dark Ocean";
  --tbl-head-bg:   #1e3a5f;
  --tbl-head-fg:   #ffffff;
  --tbl-head-line: #152a45;
  --tbl-row-even:  rgba(255, 255, 255, 0.03);
  --tbl-row-hover: rgba(59, 130, 246, 0.08);
  --tbl-line:      color-mix(in srgb, var(--border) 85%, transparent);
  --tbl-grid-line: color-mix(in srgb, var(--border) 38%, transparent);
  --tbl-index-bg:  var(--bg-card);
  --tbl-mono-fg:   #93c5fd;
}

/* --- DARK FOREST (Green) --- */
[data-theme="dark-green"] {
  --bg-primary:    #0a1a0f;
  --bg-card:       #0f2417;
  --bg-card2:      #152e1e;
  --bg-input:      #081409;
  --accent:        #00c87a;
  --accent2:       #009e5e;
  --accent3:       #6ee7b7;
  --text-primary:  #c6f0d8;
  --text-muted:    #7aab8a;
  --text-bright:   #e0ffe8;
  --success:       #22c55e;
  --warning:       #f4a261;
  --danger:        #ef4444;
  --info:          #34d399;
  --border:        #1a3d28;
  --sidebar-bg:    linear-gradient(180deg, #081409 0%, #0f2417 100%);
  --topbar-bg:     rgba(10,26,15,.95);
  --card-hover:    rgba(0,200,122,.04);
  --shadow:        0 4px 20px rgba(0,0,0,.5);
  --theme-name:    "Dark Forest";
}

/* --- DARK CRIMSON (Purple/Red) --- */
[data-theme="dark-purple"] {
  --bg-primary:    #160b22;
  --bg-card:       #200d33;
  --bg-card2:      #2a1142;
  --bg-input:      #0f0618;
  --accent:        #a855f7;
  --accent2:       #7c3aed;
  --accent3:       #d8b4fe;
  --text-primary:  #e9d5ff;
  --text-muted:    #9370bb;
  --text-bright:   #f5f3ff;
  --success:       #a3e635;
  --warning:       #fbbf24;
  --danger:        #f43f5e;
  --info:          #c084fc;
  --border:        #3b1d5e;
  --sidebar-bg:    linear-gradient(180deg, #0f0618 0%, #1a0a2e 100%);
  --topbar-bg:     rgba(22,11,34,.95);
  --card-hover:    rgba(168,85,247,.04);
  --shadow:        0 4px 20px rgba(0,0,0,.5);
  --theme-name:    "Dark Crimson";
}

/* --- LIGHT CLEAN --- */
[data-theme="light"] {
  --bg-primary:    #f0f4f8;
  --bg-card:       #ffffff;
  --bg-card2:      #f8fafc;
  --bg-input:      #eef2f7;
  --accent:        #0077b6;
  --accent2:       #005d8f;
  --accent3:       #90e0ef;
  --text-primary:  #1e293b;
  --text-muted:    #64748b;
  --text-bright:   #0f172a;
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #0284c7;
  --border:        #cbd5e1;
  --sidebar-bg:    linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --topbar-bg:     rgba(255,255,255,.97);
  --card-hover:    rgba(0,119,182,.03);
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --theme-name:    "Light Clean";
  --tbl-row-even:  #f1f5f9;
  --tbl-row-hover: rgba(59, 130, 246, 0.07);
  --tbl-line:      #e2e8f0;
  --tbl-grid-line: #edf1f6;
  --tbl-index-bg:  #ffffff;
  --tbl-mono-fg:   #2563eb;
}

/* --- SOLARIZED DARK --- */
[data-theme="solarized"] {
  --bg-primary:    #002b36;
  --bg-card:       #073642;
  --bg-card2:      #0d4451;
  --bg-input:      #00212b;
  --accent:        #2aa198;
  --accent2:       #268bd2;
  --accent3:       #93a1a1;
  --text-primary:  #839496;
  --text-muted:    #586e75;
  --text-bright:   #eee8d5;
  --success:       #859900;
  --warning:       #b58900;
  --danger:        #dc322f;
  --info:          #268bd2;
  --border:        #124555;
  --sidebar-bg:    linear-gradient(180deg, #00212b 0%, #002b36 100%);
  --topbar-bg:     rgba(0,43,54,.97);
  --card-hover:    rgba(42,161,152,.05);
  --shadow:        0 4px 20px rgba(0,0,0,.5);
  --theme-name:    "Solarized";
}

/* --- CALM MIST (Eye-comfort) --- */
[data-theme="calm"] {
  --bg-primary:    #eef3f7;
  --bg-card:       #f9fbfd;
  --bg-card2:      #f3f7fb;
  --bg-input:      #eaf0f6;
  --accent:        #4b8bb7;
  --accent2:       #3a6f92;
  --accent3:       #7fb3d5;
  --text-primary:  #2f4558;
  --text-muted:    #6d8193;
  --text-bright:   #1f3344;
  --success:       #3f9a7d;
  --warning:       #c98f3d;
  --danger:        #c25b5b;
  --info:          #4b8bb7;
  --border:        #cfdbe6;
  --sidebar-bg:    linear-gradient(180deg, #2f4558 0%, #3b5b73 100%);
  --topbar-bg:     rgba(245, 250, 255, .96);
  --card-hover:    rgba(75,139,183,.05);
  --shadow:        0 2px 10px rgba(34,68,102,.08);
  --theme-name:    "Calm Mist";
}

/* ============================================================
   FONT FAMILY BY LANGUAGE
   ============================================================ */
:root {
  --font-body: 'Inter', 'Noto Sans Lao', 'Noto Sans SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-lo: 'Noto Sans Lao', 'Noto Sans Lao Looped', 'Phetsarath OT', 'Saysettha OT', 'Segoe UI', sans-serif;
  --font-zh: 'Noto Sans SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
  --header-h:      60px;
  --radius:        8px;
}

/* Native pickers, date inputs, checkboxes and scrollbars follow the active theme. */
:root,
html[data-theme="dark-blue"],
html[data-theme="dark-green"],
html[data-theme="dark-purple"],
html[data-theme="solarized"] { color-scheme: dark; }
html[data-theme="light"],
html[data-theme="calm"] { color-scheme: light; }

/* ââ Language fonts (sizes stay identical across en / lo / zh) â */
html[lang="en"],
html[lang="en"] body {
  font-family: var(--font-body);
}
/* English UI: keep Inter everywhere (system standard), leave monospace alone */
html[lang="en"] body *:not(svg):not(path):not(circle):not(rect):not(line):not(polyline):not(polygon):not(ellipse):not(g):not(text):not(defs):not(clipPath):not(mask):not(use):not(code):not(pre):not(.mono):not([class*="mono"]) {
  font-family: var(--font-body) !important;
}
html[lang="en"] code,
html[lang="en"] pre,
html[lang="en"] .mono,
html[lang="en"] [class*="mono"] {
  font-family: var(--font-mono) !important;
}

html[lang="lo"] {
  --font-body: var(--font-lo);
}
html[lang="lo"],
html[lang="lo"] body {
  font-family: var(--font-lo) !important;
}
/* Force Noto Sans Lao on every UI element when Lao is selected */
html[lang="lo"] body *:not(svg):not(path):not(circle):not(rect):not(line):not(polyline):not(polygon):not(ellipse):not(g):not(text):not(defs):not(clipPath):not(mask):not(use) {
  font-family: var(--font-lo) !important;
}

html[lang="zh-CN"],
html[lang="zh-CN"] body {
  font-family: var(--font-zh);
}
html[lang="zh-CN"] body *:not(svg):not(path):not(circle):not(rect):not(line):not(polyline):not(polygon):not(ellipse):not(g):not(text):not(defs):not(clipPath):not(mask):not(use) {
  font-family: var(--font-zh) !important;
}

/* ---- GLOBAL RESET ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

/* Lao / Chinese glyphs fall back to Noto fonts when UI language is English */
input, select, textarea, button, .um-input, .um-select, .um-textarea,
.tbl-sm, table, .card, .epr-app-detail-grid .val {
  font-family: inherit;
}

.sys-about {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(8, 18, 32, .55);
  backdrop-filter: blur(3px);
}
.sys-about.open { display: flex; }
.sys-about-card {
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(2, 12, 27, .35);
  overflow: hidden;
}
.sys-about-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 16px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(201, 162, 39, .28), transparent 55%),
    linear-gradient(135deg, #0b2a4a 0%, #123f6e 60%, #1d4f86 100%);
  border-bottom: 3px solid #c9a227;
}
.sys-about-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .16), 0 0 0 5px rgba(201, 162, 39, .55);
}
.sys-about-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sys-about-head-text { min-width: 0; flex: 1; }
.sys-about-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f3dc8a;
}
.sys-about-title {
  margin: 3px 0 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}
.sys-about-app {
  margin-top: 3px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .72);
}
.sys-about-ver {
  align-self: flex-start;
  margin-top: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  font: 700 11px/1.2 var(--font-mono, Consolas, monospace);
  color: #0b2a4a;
  background: linear-gradient(180deg, #f3dc8a, #c9a227);
}
.sys-about-close {
  align-self: flex-start;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sys-about-close:hover { background: rgba(255, 255, 255, .24); }
.sys-about-body { padding: 16px 18px 6px; overflow-y: auto; }
.sys-about-sec {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sys-about-dev {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, #c9a227 35%, var(--border));
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, #c9a227 8%, var(--bg-card)), color-mix(in srgb, var(--accent) 5%, var(--bg-card)));
}
.sys-about-ava {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 800;
  color: #f3dc8a;
  background: linear-gradient(135deg, #0b2a4a, #1d4f86);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px color-mix(in srgb, #c9a227 60%, transparent);
}
.sys-about-dev-txt { min-width: 0; line-height: 1.35; }
.sys-about-dev-name { font-size: 15px; font-weight: 800; color: var(--text-bright); }
.sys-about-dev-role { margin-top: 2px; font-size: 12px; font-weight: 650; color: var(--accent); }
.sys-about-dev-org { margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }
.sys-about-dl {
  margin: 0 0 14px;
  display: grid;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.sys-about-dl > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  font-size: 12.5px;
  border-top: 1px solid var(--border);
}
.sys-about-dl > div:first-child { border-top: 0; }
.sys-about-dl > div:nth-child(even) { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.sys-about-dl dt { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--text-muted); font-weight: 600; }
.sys-about-dl dt svg { flex-shrink: 0; color: var(--accent); }
.sys-about-dl dd { margin: 0; color: var(--text-bright); font-weight: 600; overflow-wrap: anywhere; }
.sys-about-legal {
  padding: 10px 12px;
  border-left: 3px solid #c9a227;
  border-radius: 0 10px 10px 0;
  background: var(--bg-hover);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}
.sys-about-legal p { margin: 0; }
.sys-about-legal .sys-about-copy { margin-bottom: 3px; font-weight: 700; color: var(--text); }
body.sys-about-open { overflow: hidden; }
.sys-about-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border);
}
.sys-about-foot-note { margin-right: auto; font-size: 11px; line-height: 1.4; color: var(--text-muted); }
@media (max-width: 480px) {
  .sys-about-dl > div { grid-template-columns: 1fr; gap: 2px; }
  .sys-about-ver { display: none; }
}

/* ---- MAIN LAYOUT ---- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--header-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .3s;
}
.topbar-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.topbar-subtitle .meta-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-subtitle .meta-chip.code { color: var(--text-bright); }
.topbar-subtitle .meta-chip.dept {
  color: var(--chip-color, var(--accent));
  border-color: color-mix(in srgb, var(--chip-color, var(--accent)) 35%, var(--border));
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 10%, var(--bg-card2));
}
.topbar-subtitle .meta-chip.env {
  color: #a78bfa;
  border-color: color-mix(in srgb, #a78bfa 35%, var(--border));
  background: color-mix(in srgb, #a78bfa 10%, var(--bg-card2));
}
.topbar-subtitle .meta-chip.file {
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 500;
  max-width: min(100%, 360px);
}
/* ---- CONTENT ---- */
.content { padding: 24px; flex: 1; min-width: 0; overflow-x: auto; }

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: background .3s, border-color .3s;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 svg { display: block; flex-shrink: 0; }
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.card-body { padding: 16px 20px; }

/* Section icon chip (intros / card titles) */
.ui-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.ui-ico svg { display: block; }
.ui-ico--sm { width: 28px; height: 28px; }
.ui-ico--md { width: 36px; height: 36px; border-radius: 10px; }
.ui-ico--cyan {
  background: color-mix(in srgb, #0e7490 14%, transparent);
  color: #0e7490;
}

/* ---- Touch targets ---- */
.btn, button { min-height: 34px; }

/* ---- STAT CARDS ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, background .3s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,.3); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.stat-card.green::before  { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.purple::before { background: var(--accent); }

.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-bright); margin: 6px 0 4px; text-align: center; }
.stat-sub   { font-size: 12px; color: var(--text-muted); text-align: center; }
.stat-icon  {
  position: static;
  width: 32px; height: 32px;
  opacity: .12;
  color: var(--text-bright);
  pointer-events: none;
  margin-bottom: 4px;
}
.stat-icon svg { display: block; width: 100%; height: 100%; }

/* ---- TABLE (system standard â MTR professional layout) ---- */
.tbl-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--tbl-line);
  border-radius: 8px;
  background: var(--bg-card);
  /* Fade-shadow to hint horizontal scroll */
  background-image:
    linear-gradient(to right, var(--bg-card), var(--bg-card)),
    linear-gradient(to right, var(--bg-card), var(--bg-card)),
    linear-gradient(to right, rgba(0,0,0,.08), transparent),
    linear-gradient(to left,  rgba(0,0,0,.08), transparent);
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 24px 100%, 24px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}
.tbl-wrapper > table,
.card .tbl-wrapper > table {
  border: none;
  border-radius: 0;
  min-width: 600px;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: var(--bg-card);
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--tbl-head-bg);
  color: var(--tbl-head-fg);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 6px 8px;
  text-align: center;
  border-top: none;
  border-left: none;
  border-right: 1px solid var(--tbl-grid-line);
  border-bottom: 1px solid var(--tbl-head-line);
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: 0 1px 0 var(--tbl-head-line);
}
thead th:last-child { border-right: none; }
/* Lao / Chinese: keep natural casing â uppercase distorts glyphs */
html[lang="lo"] thead th,
html[lang="zh"] thead th {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
tbody tr { transition: background .12s ease; }
tbody tr:nth-child(even) td { background: var(--tbl-row-even); }
tbody tr:hover td { background: var(--tbl-row-hover); }
tbody td {
  padding: 4px 8px;
  color: var(--text-primary);
  vertical-align: middle;
  text-align: center;
  border-top: none;
  border-left: none;
  border-right: 1px solid var(--tbl-grid-line);
  border-bottom: 1px solid var(--tbl-line);
  line-height: 1.25;
}
tbody td:last-child { border-right: none; }
tbody tr:last-child td { border-bottom: none; }
tbody td.mono,
thead th.mono {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  color: var(--tbl-mono-fg);
}
tbody td.num,
thead th.num,
tfoot td.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
tbody td.left,  thead th.left,
tbody td.center, thead th.center,
tbody td.right, thead th.right { text-align: center !important; }
tbody td.td-truncate,
tbody td.text-muted,
tbody td.pnr-cell { text-align: center; }
.pnr-link { text-align: center; }
table thead th,
table tbody td,
table tfoot td {
  text-align: center !important;
}
/* Sticky # column inside horizontal scroll */
.tbl-wrapper thead th.col-num,
.tbl-wrapper thead th.col-no,
.tbl-wrapper tbody td.col-num,
.tbl-wrapper tbody td.col-no,
.mtr-table-wrap thead th.col-num,
.mtr-table-wrap thead th.col-no,
.mtr-table-wrap tbody td.col-num,
.mtr-table-wrap tbody td.col-no,
.sabre-tbl-scroll thead th.col-num,
.sabre-tbl-scroll tbody td.col-num {
  position: sticky;
  left: 0;
  z-index: 1;
}
.tbl-wrapper thead th.col-num,
.tbl-wrapper thead th.col-no,
.mtr-table-wrap thead th.col-num,
.mtr-table-wrap thead th.col-no,
.sabre-tbl-scroll thead th.col-num {
  top: 0;
  left: 0;
  z-index: 4;
  background: var(--tbl-head-bg);
  box-shadow: 1px 0 0 var(--tbl-grid-line), 0 1px 0 var(--tbl-head-line);
}

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-hk  { background: color-mix(in srgb, var(--success) 20%, transparent);  color: var(--success); }
.badge-nn  { background: color-mix(in srgb, var(--danger) 20%, transparent);   color: var(--danger); }
.badge-ds  { background: color-mix(in srgb, var(--text-muted) 20%, transparent); color: var(--text-muted); }
.badge-ok  { background: color-mix(in srgb, #4ade80 20%, transparent);   color: #4ade80; }
.badge-wl  { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning); }
.badge-success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.badge-warn, .badge-warning { background: color-mix(in srgb, var(--warning) 20%, transparent);  color: var(--warning); }
.badge-danger  { background: color-mix(in srgb, var(--danger) 15%, transparent);  color: var(--danger); }
.badge-info    { background: color-mix(in srgb, var(--accent) 15%, transparent);   color: var(--accent); }

/* Activity / audit log badges */
.act-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.act-badge--success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.act-badge--info    { background: color-mix(in srgb, var(--accent) 15%, transparent);  color: var(--accent); }
.act-badge--warn    { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning); }
.act-badge--danger  { background: color-mix(in srgb, var(--danger) 15%, transparent);  color: var(--danger); }
.act-badge--neutral { background: color-mix(in srgb, var(--text-muted) 18%, transparent); color: var(--text-muted); }

/* Tables placed directly in card body (no .tbl-wrapper) */
.card-body > table.tbl-sm,
.card-body > table.data-table {
  width: 100%;
  border-top: 1px solid var(--tbl-line);
}
.um-table-wrap,
.epr-table-wrap,
.epr-lookup-table-wrap {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--tbl-line);
}
.data-table { font-size: 12px; }
.epr-lookup-table-wrap {
  max-height: 280px;
  overflow: auto;
}
.epr-lookup-table tbody tr.is-inactive { opacity: .72; }
.tbl-pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
}
.tbl-pager-bar--server {
  width: 100%;
}
.tbl-pager-size {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.tbl-pager-size-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
}
.tbl-pager-size-select {
  height: 32px;
  min-width: 72px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.tbl-pager-size-select:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}
.tbl-pager-size-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.tbl-pager-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: auto;
  justify-content: flex-end;
}
.tbl-pager-info {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
  margin-left: 4px;
}
.tbl-pager-bar--server .tbl-pager-nav {
  margin-left: auto;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.page-btn:hover:not(:disabled):not(.disabled) {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.page-btn.active {
  background: var(--accent2);
  color: #fff;
  border-color: var(--accent2);
}
.page-btn.disabled,
.page-btn:disabled {
  opacity: .45;
  pointer-events: none;
  cursor: default;
}

/* ---- SEARCH / FILTER (legacy) ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.filter-bar input,
.filter-bar select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.filter-bar input:focus,
.filter-bar select:focus { border-color: var(--accent); }

/* ---- COMPACT FILTER PANEL (shared across all pages) ---- */
.fp {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: nowrap;   /* single row â fields fill all available space */
  width: 100%;
}
.fp-g {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 0;          /* grow & shrink equally */
  min-width: 0;         /* allow shrinking below content */
}
.fp-g label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-g select,
.fp-g input {
  width: 100%;          /* fill the flex container */
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.fp-g select:hover,
.fp-g input:hover  { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.fp-g select:focus,
.fp-g input:focus  { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent); }
.fp-g input::placeholder { color: var(--text-muted); opacity: 1; }
/* native select arrow still visible at 100% width */
.fp-g select { padding-right: 24px; appearance: auto; }

/* flex-weight hints â bigger fields get proportionally more space */
.fp-g.w-xs { flex: 0.6 1 0; min-width: 64px;  }
.fp-g.w-sm { flex: 0.8 1 0; min-width: 84px;  }
.fp-g.w-md { flex: 1.0 1 0; min-width: 100px; }
.fp-g.w-lg { flex: 1.4 1 0; min-width: 130px; }
.fp-g.w-xl { flex: 2.0 1 0; min-width: 160px; }

/* date input: don't let browser collapse it */
.fp-g input[type="date"] { min-width: 120px; }

.fp-actions {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;       /* never shrink the buttons */
}
.fp-actions .btn {
  height: 30px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.fp-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
  align-self: flex-end;
  flex-shrink: 0;
}

/* on very narrow screens, allow wrapping */
@media (max-width: 900px) {
  .fp { flex-wrap: wrap; }
  .fp-g { flex: 1 1 140px; }
  .fp-g.w-xs { flex: 1 1 90px; }
  .fp-g.w-sm { flex: 1 1 110px; }
  .fp-g.w-xl { flex: 1 1 180px; }
}

/* ---- Responsive breakpoints ---- */
@media (max-width: 1200px) {
  .content { padding: 18px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 992px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .users-layout-grid { grid-template-columns: 1fr; }
  .upload-layout-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  body.tbl-page-body .upload-page-content.tbl-page-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }
  body.tbl-page-body .main-wrapper.upload-page {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body.tbl-page-body:has(.upload-page) {
    overflow: auto;
    height: auto;
  }
  .upload-sync-row {
    grid-template-columns: 1fr;
  }
  .upload-tables-stack .tbl-panel {
    flex: 0 1 auto;
    min-height: 180px;
  }
  .detail-two-col-grid { grid-template-columns: 1fr; }
  .dash-insights-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1023.98px) {
  body { display: block; }
  .main-wrapper { min-width: 0; }
}

@media (max-width: 768px) {
  .content { padding: 12px; }
  .card-header { padding: 10px 12px; flex-wrap: wrap; }
  .card-body { padding: 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .dash-charts-grid,
  .dash-insights-grid { grid-template-columns: 1fr; gap: 12px; }
  .chart-container { height: 230px; min-height: 110px; }
  .tbl-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 640px; }
  thead th { position: sticky; top: 0; z-index: 1; }
}

@media (max-width: 576px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
  .stat-card { padding: 10px 8px; }
  .stat-icon { width: 24px; height: 24px; margin-bottom: 2px; }
  .stat-label { font-size: 10px; letter-spacing: .3px; }
  .stat-value { font-size: 18px !important; margin: 4px 0 2px; }
  .stat-sub { font-size: 11px; }
  .fp, .rev-filter-panel { gap: 8px !important; }
  .fp-g, .rev-filter-group { flex: 1 1 100% !important; min-width: 0 !important; }
  .fp.fp-reservations-grid .fp-g,
  .fp.fp-flights-grid .fp-g,
  .fp.fp-mobile-compact .fp-g {
    flex: 1 1 auto !important;
  }
  .fp-actions, .rev-filter-actions { width: 100%; }
  .fp-actions .btn, .rev-filter-actions .btn { flex: 1; justify-content: center; }
  .login-wrapper { max-width: 100%; }
  .step-label { white-space: normal; line-height: 1.25; font-size: 10px; }
  .steps { gap: 6px; margin-bottom: 14px; }
  .step-dot { width: 28px; height: 28px; font-size: 12px; }
  .step:not(:last-child)::after { top: 14px; left: calc(50% + 14px); right: calc(-50% + 14px); }
  .steps {
    overflow: visible;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 6px;
    padding-bottom: 4px;
  }
  .steps .step { flex: 0 0 calc(20% - 5px); min-width: 56px; }
  .steps .step:not(:last-child)::after { display: none; }
  .upload-zone { padding: 22px 12px; }
  .upload-title { font-size: 19px; line-height: 1.25; }
  .upload-sub { font-size: 12px; }
  #logOutput { max-height: 200px !important; font-size: 11px !important; }
  .card-header h3 { font-size: 15px; }
  .routes-legend { gap: 6px 10px; }
  .route-legend-item { width: 100%; }
}

/* ---- KPI STRIP (shared tinted boards) ---- */
.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 10px;
  overflow: visible;
  padding: 2px 0 6px;
}
.kpi-item {
  --kpi-c: var(--accent);
  flex: 0 1 auto;
  min-width: 108px;
  padding: 10px 14px 9px;
  border: 1px solid color-mix(in srgb, var(--kpi-c) 22%, var(--border));
  border-radius: 10px;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--kpi-c) 9%, var(--bg-card)) 0%,
    var(--bg-card) 72%
  );
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--kpi-c) 8%, transparent);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.kpi-strip .kpi-item:nth-child(8n+1) { --kpi-c: #5a9ec4; }
.kpi-strip .kpi-item:nth-child(8n+2) { --kpi-c: #7a84c8; }
.kpi-strip .kpi-item:nth-child(8n+3) { --kpi-c: #4eaea3; }
.kpi-strip .kpi-item:nth-child(8n+4) { --kpi-c: #c9a24a; }
.kpi-strip .kpi-item:nth-child(8n+5) { --kpi-c: #9585c4; }
.kpi-strip .kpi-item:nth-child(8n+6) { --kpi-c: #5aa888; }
.kpi-strip .kpi-item:nth-child(8n+7) { --kpi-c: #c97a86; }
.kpi-strip .kpi-item:nth-child(8n+8) { --kpi-c: #8a96a8; }
.kpi-item:has(.kpi-val[style*="--success"]) { --kpi-c: var(--success); }
.kpi-item:has(.kpi-val[style*="--danger"])  { --kpi-c: var(--danger); }
.kpi-item:has(.kpi-val[style*="--warning"]) { --kpi-c: var(--warning); }
.kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: color-mix(in srgb, var(--kpi-c, var(--text-muted)) 42%, var(--text-muted));
  text-transform: uppercase;
  letter-spacing: .45px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin-bottom: 3px;
  max-width: 100%;
}
.kpi-val {
  font-size: 22px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--kpi-c, var(--accent));
  line-height: 1.05;
  margin-top: 0;
  white-space: nowrap;
  text-align: center;
}
.kpi-sub {
  font-size: 10px;
  font-weight: 600;
  color: color-mix(in srgb, var(--kpi-c, var(--text-muted)) 32%, var(--text-muted));
  margin-top: 2px;
  white-space: nowrap;
  text-align: center;
}

/* Modern tinted KPI boards (BCC / Ticketing tabs) */
.kpi-board {
  --kpi-c: var(--accent);
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--kpi-c) 9%, var(--bg-card)) 0%,
    var(--bg-card) 72%
  ) !important;
  border-color: color-mix(in srgb, var(--kpi-c) 22%, var(--border)) !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--kpi-c) 8%, transparent);
}
.kpi-board--sky     { --kpi-c: #5a9ec4; }
.kpi-board--indigo  { --kpi-c: #7a84c8; }
.kpi-board--teal    { --kpi-c: #4eaea3; }
.kpi-board--amber   { --kpi-c: #c9a24a; }
.kpi-board--violet  { --kpi-c: #a78cc8; }
.kpi-board--rose    { --kpi-c: #c97a86; }
.kpi-board--emerald { --kpi-c: #5aa888; }
.kpi-board--slate   { --kpi-c: #8a96a8; }
.kpi-board .bcc-chip-k,
.kpi-board .mtr-kstat-lbl,
.kpi-board .mtr-chip-k,
.kpi-board .fin-k-lbl,
.kpi-board .k,
.kpi-board .kpi-label,
.kpi-board .um-chip-k,
.kpi-board .rv-label,
.kpi-board .page-kpi-label,
.kpi-board .epr-kpi-label,
.kpi-board .lbl {
  color: color-mix(in srgb, var(--kpi-c) 42%, var(--text-muted)) !important;
}
.kpi-board .bcc-chip-v,
.kpi-board .mtr-kstat-val,
.kpi-board .mtr-chip-v,
.kpi-board .fin-k-val,
.kpi-board .v,
.kpi-board .kpi-val,
.kpi-board .um-chip-v,
.kpi-board .rv-val,
.kpi-board .page-kpi-val,
.kpi-board .epr-kpi-val,
.kpi-board .num {
  color: var(--kpi-c) !important;
}
.kpi-board .s,
.kpi-board .kpi-sub,
.kpi-board .rv-sub,
.kpi-board .page-kpi-sub,
.kpi-board .epr-kpi-sub,
.kpi-board .sub {
  color: color-mix(in srgb, var(--kpi-c) 32%, var(--text-muted)) !important;
}

/* ---- Page KPI cards (icon + value â shared standard) ---- */
.page-kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.page-kpi--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page-kpi--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1200px) {
  .page-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .page-kpi,
  .page-kpi--4,
  .page-kpi--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .page-kpi,
  .page-kpi--4,
  .page-kpi--3 { grid-template-columns: 1fr; }
}
.page-kpi-card {
  --kpi-c: var(--accent);
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--kpi-c) 9%, var(--bg-card)) 0%,
    var(--bg-card) 72%
  );
  border: 1px solid color-mix(in srgb, var(--kpi-c) 22%, var(--border));
  border-radius: 10px;
  padding: 10px 14px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-width: 0;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--kpi-c) 8%, transparent);
  transition: border-color .15s, box-shadow .15s;
}
.page-kpi-card:has(.page-kpi-icon--accent)  { --kpi-c: var(--accent); }
.page-kpi-card:has(.page-kpi-icon--info)    { --kpi-c: #5a9ec4; }
.page-kpi-card:has(.page-kpi-icon--success) { --kpi-c: #5aa888; }
.page-kpi-card:has(.page-kpi-icon--warning) { --kpi-c: #c9a24a; }
.page-kpi-card:has(.page-kpi-icon--purple)  { --kpi-c: #9585c4; }
.page-kpi-card:has(.page-kpi-icon--danger)  { --kpi-c: #c97a86; }
.page-kpi-card:hover {
  border-color: color-mix(in srgb, var(--kpi-c) 30%, var(--border));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--kpi-c) 8%, transparent),
    0 2px 8px color-mix(in srgb, var(--kpi-c) 10%, transparent);
}
.page-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--kpi-c) 10%, var(--bg-input));
  color: color-mix(in srgb, var(--kpi-c) 55%, var(--text-muted));
}
.page-kpi-icon svg { display: block; opacity: .92; }
.page-kpi-icon--accent,
.page-kpi-icon--info,
.page-kpi-icon--success,
.page-kpi-icon--warning,
.page-kpi-icon--purple,
.page-kpi-icon--danger {
  background: color-mix(in srgb, var(--kpi-c) 10%, transparent);
  color: color-mix(in srgb, var(--kpi-c) 55%, var(--text-muted));
}
.page-kpi-body { min-width: 0; width: 100%; text-align: center; }
.page-kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: color-mix(in srgb, var(--kpi-c) 42%, var(--text-muted));
  text-transform: uppercase;
  letter-spacing: .45px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}
.page-kpi-val {
  font-size: 22px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--kpi-c);
  line-height: 1.05;
  margin-top: 2px;
}
.page-kpi-sub {
  font-size: 10px;
  font-weight: 600;
  color: color-mix(in srgb, var(--kpi-c) 32%, var(--text-muted));
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Monthly ticket report â compact date-range toolbar */
.mtr-filter-card { margin-bottom: 8px; padding: 6px 10px; }
.mtr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.mtr-range-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mtr-range-group .form-input {
  height: 30px;
  padding: 2px 8px;
  font-size: 12px;
  width: 132px;
}
.mtr-range-sep {
  color: var(--text-muted);
  font-weight: 600;
}
.mtr-run-btn { white-space: nowrap; }
.mtr-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mtr-preset {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s ease;
}
.mtr-preset:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mtr-preset.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (max-width: 768px) {
  .mtr-range-group { flex-wrap: wrap; }
  .mtr-range-group .form-input { width: calc(50% - 18px); }
  .mtr-presets { width: 100%; }
}

/* Monthly ticket report â compact KPI strip with payment-method / currency chips */
.mtr-kpi-strip .kpi-item { padding: 8px 14px; }
.mtr-kpi-strip .mtr-kpi-wide {
  flex: 2.4;
  align-items: flex-start;
  text-align: left;
}
.mtr-kpi-strip .mtr-kpi-wide .kpi-label {
  text-align: left;
  margin-bottom: 5px;
}
.mtr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  width: 100%;
  max-height: 52px;
  overflow-y: auto;
}
.mtr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle, #f1f5f9);
  font-size: 11px;
  line-height: 1.7;
  white-space: nowrap;
}
.mtr-chip-k { font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.mtr-chip-v { font-weight: 700; color: var(--text); }
.mtr-chip-cash     { background: rgba(5,150,105,.10);  border-color: rgba(5,150,105,.30); }
.mtr-chip-cash .mtr-chip-k     { color: #059669; }
.mtr-chip-credit   { background: rgba(37,99,235,.10);  border-color: rgba(37,99,235,.30); }
.mtr-chip-credit .mtr-chip-k   { color: #2563eb; }
.mtr-chip-check    { background: rgba(217,119,6,.10);  border-color: rgba(217,119,6,.30); }
.mtr-chip-check .mtr-chip-k    { color: #d97706; }
.mtr-chip-exchange { background: rgba(124,58,237,.10); border-color: rgba(124,58,237,.30); }
.mtr-chip-exchange .mtr-chip-k { color: #7c3aed; }
.mtr-chip-amount   { background: rgba(2,132,199,.08);  border-color: rgba(2,132,199,.25); }
.mtr-chip-amount .mtr-chip-k   { color: #0284c7; }
@media (max-width: 768px) {
  .mtr-kpi-strip { flex-wrap: wrap; }
  .mtr-kpi-strip .mtr-kpi-wide { flex: 1 1 100%; border-right: none; }
  .mtr-chips { max-height: none; }
}

/* SSR top codes: compact tinted boards */
.kpi-strip.kpi-ssr-compact .kpi-item {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  min-width: 72px;
  padding: 8px 10px;
}
.kpi-strip.kpi-ssr-compact .kpi-label {
  margin: 0;
  text-transform: none;
  letter-spacing: .2px;
  font-weight: 700;
}
.kpi-strip.kpi-ssr-compact .kpi-val {
  margin: 0;
  font-size: 16px;
  line-height: 1.1;
}
.kpi-strip.kpi-ssr-compact .kpi-sub {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}
@media (max-width: 768px) {
  .kpi-strip.kpi-ssr-compact .kpi-item {
    flex: 1 1 calc(45% - 8px);
    min-width: min(100%, 108px);
  }
  .kpi-strip.kpi-ssr-compact .kpi-label {
    font-size: 11px;
  }
  .kpi-strip.kpi-ssr-compact .kpi-val {
    font-size: 16px;
  }
  .kpi-strip.kpi-ssr-compact .kpi-sub {
    font-size: 10px;
  }
}

/* ---- COMPACT TABLE (.tbl-sm — dense rows so more data fits) ---- */
.tbl-sm { font-size: 11.5px; }
.tbl-sm thead th { font-size: 10px; padding: 5px 8px; line-height: 1.2; }
.tbl-sm tbody td { padding: 3px 8px; font-size: 11.5px; line-height: 1.25; }
.tbl-sm .badge { padding: 1px 6px; font-size: 10px; line-height: 1.3; }
.tbl-sm .btn.btn-sm { padding: 2px 7px; font-size: 11px; line-height: 1.2; }
.filter-bar input::placeholder { color: var(--text-muted); }

/* ââ Row number column (#) âââââââââââââââââââââââââââââââââ */
.col-num,
.col-no {
  width: 42px;
  min-width: 42px;
  max-width: 48px;
  text-align: center !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  user-select: none;
}
thead th.col-num,
thead th.col-no {
  background: var(--tbl-head-bg) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .4px !important;
  text-transform: uppercase !important;
}
tbody td.col-num,
tbody td.col-no {
  background: var(--tbl-index-bg) !important;
  color: var(--text-muted) !important;
  box-shadow: 1px 0 0 var(--tbl-grid-line), 2px 0 4px rgba(0, 0, 0, 0.06);
}
tbody tr:nth-child(even) td.col-num,
tbody tr:nth-child(even) td.col-no {
  background: color-mix(in srgb, var(--tbl-row-even) 55%, var(--tbl-index-bg)) !important;
}
tbody tr:hover td.col-num,
tbody tr:hover td.col-no {
  background: var(--tbl-row-hover) !important;
}

/* ââ Table card header meta ââââââââââââââââââââââââââââââââ */
.tbl-meta {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
  font-weight: 500;
}

/* ââ Table footer (pagination â full width below scroll area) â */
.tbl-footer {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-top: 1px solid var(--tbl-line);
  background: color-mix(in srgb, var(--bg-input) 88%, var(--bg-card));
}
.tbl-footer.tbl-pager-bar {
  padding: 10px 14px;
}
.tbl-footer:not(.tbl-pager-bar) .tbl-pager-bar,
.tbl-footer:not(.tbl-pager-bar) .pagination {
  padding: 0;
  border-top: none;
  width: 100%;
}

/* Table scroll area + footer as one panel */
.card-body > .tbl-wrapper:not(:last-child),
.card-body > .mtr-table-wrap:not(:last-child),
.card-body > .sabre-tbl-scroll:not(:last-child),
.card-body.tbl-wrapper:not(:last-child) {
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.card-body > .tbl-wrapper + .tbl-footer,
.card-body > .tbl-wrapper + .mtr-pager-host,
.card-body > .mtr-table-wrap + .mtr-pager-host,
.card.tbl-doc > .tbl-wrapper + .mtr-pager-host,
.card.tbl-doc > .mtr-pager-host,
.card-body > .sabre-tbl-scroll + .tbl-footer,
.card-body > .sabre-tbl-scroll + .tbl-pager-bar,
.card-body.tbl-wrapper + .tbl-footer,
.card-body.tbl-wrapper + .card-footer,
.card > .tbl-footer,
.card > .card-footer {
  border: 1px solid var(--tbl-line);
  border-top: 1px solid var(--tbl-line);
  border-radius: 0 0 8px 8px;
  margin-top: 0;
}
.mtr-pager-host {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  background: color-mix(in srgb, var(--bg-input) 88%, var(--bg-card));
  border: 1px solid var(--tbl-line);
  border-top: 1px solid var(--tbl-line);
  border-radius: 0 0 8px 8px;
}
.mtr-pager-host .tbl-footer.tbl-pager-bar {
  border: none;
  border-radius: 0;
  background: transparent;
}
.card-footer {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  border-top: none;
  background: transparent;
}
.card-footer .tbl-footer {
  border: none;
  border-radius: 0;
}
[data-theme="light"] .tbl-footer,
[data-theme="light"] .mtr-pager-host {
  background: #f8fafc;
}

/* ââ Truncated text cell âââââââââââââââââââââââââââââââââââ */
.td-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ââ Highlighted table row (e.g. USD/LAK) âââââââââââââââââ */
.row-highlight {
  background: color-mix(in srgb, var(--accent) 6%, transparent) !important;
}
.row-expired {
  background: color-mix(in srgb, var(--danger) 5%, transparent) !important;
}

/* ââ Airport code cell âââââââââââââââââââââââââââââââââââââ */
.airport-code     { font-size: 14px; font-weight: 700; color: var(--accent); }
.airport-code-dim { font-size: 14px; font-weight: 700; color: var(--text-bright); }

/* ââ Seat code cell ââââââââââââââââââââââââââââââââââââââââ */
.seat-code { font-family: 'Courier New', monospace; font-size: 14px; color: var(--accent); }
.pax-bag {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: middle;
}
.pax-bag--acs { color: var(--accent); }
.pax-bag__sum { display: block; }
.pax-bag__tags {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted, #64748b);
  max-width: 26rem;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pax-bag__dest-lbl {
  font-weight: 600;
  opacity: 0.9;
  margin-right: 2px;
}
.pax-bag--acs .pax-bag__tags { opacity: 0.85; color: inherit; }

/* ââ text-accent utility âââââââââââââââââââââââââââââââââââ */
.text-accent { color: var(--accent); }

/* ââ Filter button SVG alignment ââââââââââââââââââââââââââ */
.fp-actions .btn svg,
.btn svg { display: block; flex-shrink: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.2;
}
.btn-primary  { background: var(--accent2); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-outline  { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary {
  background: color-mix(in srgb, var(--bg-hover) 80%, transparent);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-success  { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); border: 1px solid var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-danger   { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); border: 1px solid var(--danger); }
.btn-warning  { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--warning); border: 1px solid var(--warning); }
.btn-warning:hover { background: var(--warning); color: #fff; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
  gap: 4px;
}
.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 5px;
  gap: 4px;
  min-height: 26px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- PAGE TOOLBAR (tabs left, actions right) ---- */
.page-toolbar,
.dash-page-toolbar,
.rev-page-toolbar,
.bcc-page-toolbar,
.sabre-rpt-toolbar,
.mtr-page-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.page-toolbar .view-tabs,
.dash-page-toolbar .view-tabs,
.rev-page-toolbar .view-tabs,
.sabre-rpt-toolbar .view-tabs,
.mtr-page-toolbar .view-tabs {
  margin-bottom: 0;
  width: fit-content;
  min-width: 0;
}
.page-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.page-toolbar-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.page-toolbar-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- TAB BARS — one standard for every tab strip in the system ---- */
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  min-height: 36px;
  padding: 3px 8px;
  box-sizing: border-box;
  margin: 0 0 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs)::-webkit-scrollbar { display: none; }
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button) {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  min-height: 28px;
  min-width: auto;
  margin: 0;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  box-shadow: none;
  transition: background .15s, color .15s;
}
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button):hover { background: var(--card-hover); color: var(--text-primary); }
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button):is(.active, .is-on) { background: var(--accent2); color: #fff; }
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button) + :is(a, button)::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: var(--border);
  pointer-events: none;
}
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button):is(.active, .is-on)::before,
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button):is(.active, .is-on) + :is(a, button)::before { display: none; }
:is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button) svg { display: block; flex-shrink: 0; }
.page-toolbar > :is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) { width: auto; margin: 0; }
.rpt-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--danger);
  color: #fff;
}
.rpt-tab.active .rpt-tab-count { background: rgba(255, 255, 255, .25); }
.epr-lookup-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: inherit;
}
.epr-lookup-tab.active .epr-lookup-tab-count { background: rgba(255, 255, 255, .22); color: #fff; }
@media (min-width: 769px) {
  .tbl-page-content:has(> .sabre-subnav) { padding: 8px 12px 10px !important; gap: 6px !important; }
  .tbl-page-content > .chart-subnav { margin: 0; }
}
@media (max-width: 768px) {
  :is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) { padding: 4px; }
  :is(.view-tabs, .rpt-tabs, .val-tabs, .epr-lookup-tabs, .upload-mode-tabs) > :is(a, button)::before { display: none; }
}
.chart-subnav { margin: 0; }
}
@media (max-width: 768px) {
  .sabre-subnav { padding: 4px; }
  .sabre-subnav .view-tab::before { display: none; }
}
.chart-subnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin: 6px 0;
}
.chart-subnav-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-muted);
  white-space: nowrap;
}
.chart-subnav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.chart-subnav-item:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.chart-subnav-item.active {
  color: var(--text-bright, var(--text-primary));
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}
@media (max-width: 640px) {
  .chart-subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chart-subnav::-webkit-scrollbar { display: none; }
  .chart-subnav-lbl { display: none; }
  .chart-subnav-item { flex: 1 0 auto; justify-content: center; }
}
/* ── Charts & analysis dashboards (finance_charts, fee override charts) — mobile first ── */
html[lang="lo"] .ab-dash *:not(svg):not(path):not(circle):not(rect):not(line):not(polyline):not(polygon) { font-family: var(--font-lo) !important; }
html[lang="lo"] .ab-chip .k, html[lang="lo"] .ab-table th, html[lang="lo"] .ab-card-h h3,
html[lang="zh"] .ab-chip .k, html[lang="zh"] .ab-table th, html[lang="zh"] .ab-fg label { letter-spacing: 0; text-transform: none; }
.ab-dash { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; flex: 1; }
.tbl-page-content > .ab-dash { flex: 1; min-height: 0; }
.ab-scroll { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.tbl-page-content > .ab-dash { overflow-y: auto; overflow-x: hidden; }
.tbl-page-content > .ab-dash > :not(.ab-scroll) { flex-shrink: 0; }
.tbl-page-content > .ab-dash > .ab-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding-right: 2px; }
.ab-scroll > * { flex-shrink: 0; }

.ab-chrome { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; flex-shrink: 0; }
.ab-chrome-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ab-chrome-note { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 100%; min-width: 0; font-size: 11.5px; color: var(--text-muted); }
.ab-chrome-note strong { color: var(--text-primary); font-weight: 750; }
.ab-chrome-note .ab-range { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--accent); }
.ab-chrome-note .ab-intro { display: none; }
.ab-chrome-right { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; flex-wrap: wrap; }
.ab-chrome-nav .btn { height: 32px; min-height: 32px; padding: 0 12px; font-size: 11.5px; border-radius: 7px; }
.ab-chrome-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px 10px 10px; }
.ab-fg { display: flex; flex-direction: column; gap: 2px; flex: 1 1 calc(50% - 4px); min-width: 0; }
.ab-fg label { font-size: 10px; font-weight: 650; color: var(--text-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .3px; }
.ab-fg input, .ab-fg select { width: 100%; height: 36px; padding: 0 8px; font-size: 13px; box-sizing: border-box; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text-primary); font-family: inherit; }
.ab-fg input:focus, .ab-fg select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ab-chrome-row > .btn { height: 36px; padding: 0 14px; font-size: 12px; border-radius: 7px; display: inline-flex; align-items: center; gap: 5px; flex: 1 1 100%; justify-content: center; }
.ab-presets { display: flex; gap: 5px; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ab-presets::-webkit-scrollbar { display: none; }
.ab-preset { flex: 0 0 auto; font-size: 11px; font-weight: 650; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted);
  text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; }
.ab-preset:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--text-primary); }
.ab-preset.active { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); color: var(--text-bright, var(--text-primary)); }
.ab-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 0 10px 10px; font-size: 11px; color: var(--text-muted); }
.ab-active-filters .ab-af { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text-primary); font-weight: 600; }
.ab-active-filters a { color: var(--accent); font-weight: 650; text-decoration: none; }

.ab-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; flex-shrink: 0; }
.ab-chip { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card); line-height: 1.15; }
.ab-chip .k { font-size: 10.5px; font-weight: 650; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-chip .v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--kpi-c, var(--text-primary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-chip .v a { color: inherit; text-decoration: none; }
.ab-chip .v a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ab-chip .s { font-size: 10.5px; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-chip .s .up { color: #d97706; font-weight: 700; }
.ab-chip .s .down { color: #059669; font-weight: 700; }

.ab-grid, .ab-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; flex-shrink: 0; }
.ab-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.ab-card-h { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ab-card-h h3 { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 750; display: flex; align-items: center; gap: 7px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-card-h .ui-ico { width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.ab-card-h .meta { display: none; font-size: 10.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.ab-card-b { padding: 8px 8px 10px; flex: 1; min-height: 0; }
.ab-chart-wrap { position: relative; height: 210px; width: 100%; }
.ab-chart-wrap.sm { height: 180px; }
.ab-chart-wrap.tall { height: 260px; }
.ab-table-wrap { overflow: auto; max-height: 300px; -webkit-overflow-scrolling: touch; }
.ab-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ab-table th, .ab-table td { padding: 7px 9px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; white-space: nowrap; }
.ab-table th { position: sticky; top: 0; z-index: 2; background: var(--tbl-head-bg); color: var(--tbl-head-fg); font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; border-bottom: 1px solid var(--tbl-head-line); }
.ab-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.ab-table .mono { font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.ab-table .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.ab-table .money { font-variant-numeric: tabular-nums; text-align: right; }
.ab-table td.zero { color: var(--text-muted); font-weight: 500; }
.ab-table tfoot td { position: sticky; bottom: 0; background: var(--bg-card2, var(--bg-card)); font-weight: 800; border-top: 1.5px solid var(--border); }
.ab-share { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ab-share-track { width: 44px; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--border) 80%, transparent); overflow: hidden; flex-shrink: 0; }
.ab-share-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #2ec4b6)); }
.ab-type-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--text-muted); }
.ab-type-dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.ab-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.ab-sources { padding: 8px 12px; font-size: 11.5px; }
.ab-sources summary { cursor: pointer; font-weight: 650; }

@media (min-width: 640px) {
  .ab-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ab-fg { flex: 0 1 160px; }
  .ab-chrome-row > .btn { flex: 0 0 auto; }
  .ab-card-h .meta { display: inline; }
}
@media (min-width: 900px) {
  .ab-chips { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
  .ab-chrome-note { flex: 1 1 auto; }
  .ab-chrome-note .ab-intro { display: inline; }
  .ab-chrome-right { flex: 0 0 auto; margin-left: auto; flex-wrap: nowrap; }
  .ab-chips:has(> :nth-child(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ab-presets { flex: 0 1 auto; margin-left: auto; }
}
@media (min-width: 1100px) {
  .ab-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .ab-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ab-chrome-row { padding: 6px 10px 8px; }
  .ab-fg { flex: 0 0 150px; }
  .ab-fg input, .ab-fg select { height: 30px; font-size: 12px; }
  .ab-chrome-row > .btn { height: 30px; }
  .ab-preset { height: 26px; font-size: 10.5px; }
  .ab-chart-wrap { height: 200px; }
  .ab-chart-wrap.sm { height: 170px; }
  .ab-chip { padding: 7px 12px; align-items: center; text-align: center; }
}
@media (min-width: 1400px) {
  .ab-chips, .ab-chips:has(> :nth-child(7)) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}

.view-tab-sep {
  flex: 0 0 1px;
  width: 1px;
  align-self: stretch;
  margin: 6px 0;
  background: color-mix(in srgb, var(--border) 85%, var(--accent) 15%);
}
@media (max-width: 768px) {
  .sabre-subnav .view-tab,
  .sabre-subnav-unified .view-tab {
    flex: 0 0 auto;
    min-width: auto;
    padding: 10px 14px;
    font-size: 12px;
    white-space: nowrap;
  }
}
.sabre-view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.sabre-day-picker .export-btn {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  gap: 4px;
}
.sabre-day-menu {
  min-width: 220px;
  max-height: min(70vh, 360px);
  overflow-y: auto;
}
.sabre-day-menu-head {
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
}
.sabre-day-menu .export-option {
  justify-content: flex-start;
}

/* ---- SABRE REPORTS ---- */
.sabre-env-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
}
.sabre-env-1s { background: #1e3a5f; color: #fff; }
.sabre-env-cert { background: #7c3aed; color: #fff; }
.sabre-env-tsts { background: #64748b; color: #fff; }
.sabre-dept-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.sabre-dept-block { margin-bottom: 14px; }
.sabre-dept-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 6px;
  margin-bottom: 8px;
}
.sabre-type-list {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
}
.sabre-type-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sabre-rpt-cell { min-width: 160px; max-width: 280px; vertical-align: top !important; }
.sabre-rpt-desc-col { min-width: 200px; max-width: 360px; vertical-align: top !important; }
.sabre-rpt-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  margin-top: 2px;
  line-height: 1.3;
}
.sabre-rpt-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 3px 0 5px;
}
.sabre-rpt-fname {
  font-size: 10px;
  font-family: var(--font-mono);
  word-break: break-all;
}
.sabre-type-list .sabre-rpt-desc {
  margin: 4px 0 0;
  padding-left: 0;
}
.sabre-type-list .code {
  font-family: var(--font-mono);
  font-weight: 700;
  margin-right: 8px;
  color: var(--accent);
}
.col-actions {
  width: 96px;
  min-width: 72px;
  text-align: center !important;
  white-space: nowrap;
}
thead th.col-actions,
tbody td.col-actions {
  text-align: center !important;
}
.col-status {
  width: 96px;
  min-width: 84px;
  text-align: center !important;
  white-space: nowrap;
}
thead th.col-status,
tbody td.col-status {
  text-align: center !important;
}
.tbl-sm.sabre-tbl thead th { text-align: center; }
.tbl-sm.sabre-tbl tbody td { text-align: center; }
.tbl-sm.sabre-tbl tbody td.num,
.tbl-sm.sabre-tbl thead th.num { text-align: center; }
.tbl-sm.sabre-tbl tbody td.mono {
  white-space: pre-wrap;
  word-break: break-all;
}
.sabre-tbl-scroll {
  max-height: min(78vh, 720px);
  overflow: auto;
  border: 1px solid var(--tbl-line);
  border-radius: 8px;
  background: var(--bg-card);
}
.sabre-tbl-scroll thead th.col-num {
  z-index: 4;
}
/* Sabre data table â column width follows cell content */
.tbl-sm.sabre-tbl.sabre-tbl-autocol {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.tbl-sm.sabre-tbl.sabre-tbl-autocol thead th,
.tbl-sm.sabre-tbl.sabre-tbl-autocol tbody td {
  width: auto;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.tbl-sm.sabre-tbl.sabre-tbl-autocol tbody td.mono {
  white-space: nowrap;
  word-break: normal;
}
/* Standard Sabre table â wrap long text columns, keep codes/dates compact */
.tbl-sm.sabre-tbl.sabre-tbl-standard thead th.sabre-col-wrap,
.tbl-sm.sabre-tbl.sabre-tbl-standard tbody td.sabre-col-wrap {
  white-space: normal;
  min-width: 100px;
  max-width: 260px;
  line-height: 1.35;
  word-break: break-word;
}
.tbl-sm.sabre-tbl.sabre-tbl-standard tbody td.mono.sabre-col-wrap {
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 480px;
}
.sabre-ref-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tbl-mono-fg);
}
/* Fee Override â column widths follow content */
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd {
  width: 100%;
  table-layout: auto;
}
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th,
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td {
  white-space: nowrap;
}
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(2),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(5),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(8) { white-space: normal; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(1),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(1) { width: 38px; text-align: center; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(2),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(2) { min-width: 108px; max-width: 130px; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(3),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(3) { width: 72px; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(4),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(4) { min-width: 150px; max-width: 210px; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(5),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(5) { min-width: 118px; max-width: 140px; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(6),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(6),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(7),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(7) { width: 88px; text-align: center; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(8),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(8) { min-width: 160px; max-width: 280px; line-height: 1.35; word-break: break-word; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(9),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(9),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(10),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(10),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(11),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(11) { width: 72px; text-align: center; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(12),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(12) { width: 64px; text-align: center; }
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd thead th:nth-child(13),
.tbl-sm.sabre-tbl.sabre-tbl-fee-ovrd tbody td:nth-child(13) { width: 84px; text-align: center; }
.sabre-ticket-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--tbl-mono-fg);
  font-weight: 600;
}
.sabre-passenger { font-weight: 600; color: var(--text-bright); }
.sabre-cell-empty { color: var(--text-muted); }
.sabre-cell-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  border: 1px solid transparent;
}
.sabre-cell-badge.doc {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.sabre-cell-badge.ccy {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
}
.sabre-cell-badge.office {
  background: color-mix(in srgb, #8b5cf6 15%, transparent);
  border-color: color-mix(in srgb, #8b5cf6 40%, transparent);
  color: #c4b5fd;
}
.sabre-cell-badge.channel-moto {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  border-color: color-mix(in srgb, #f59e0b 40%, transparent);
  color: #fbbf24;
}
.sabre-cell-badge.channel-ecom {
  background: color-mix(in srgb, #10b981 15%, transparent);
  border-color: color-mix(in srgb, #10b981 40%, transparent);
  color: #34d399;
}

/* ---- Report V2 layout (Monthly Ticket + ACCB + list tables) ---- */
body.tbl-page-body,
body.mtr-page-body {
  overflow: hidden;
  height: 100vh;
}
.main-wrapper.tbl-page,
.main-wrapper.mtr-page {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.main-wrapper.tbl-page > .topbar,
.main-wrapper.mtr-page > .topbar {
  flex-shrink: 0;
}
.tbl-page-content,
.mtr-page .mtr-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 20px 16px;
  gap: 10px;
}
.tbl-page-content > .kpi-strip,
.tbl-page-content > .page-kpi,
.tbl-page-content > .lniata-filter,
.tbl-page-content > form,
.tbl-page-content > .fp,
.tbl-page-content > .list-chrome,
.tbl-page-content > .alert,
.tbl-page-content > .view-tabs,
.tbl-page-content > .epr-module-nav,
.tbl-page-content > .page-toolbar,
.tbl-page-content > .sabre-rpt-toolbar,
.tbl-page-content > .mtr-page-toolbar,
.tbl-page-content > .sabre-subnav,
.tbl-page-content > .bcc-kpi-strip,
.tbl-page-content > .bcc-page-toolbar,
.tbl-page-content > .bcc-chrome,
.tbl-page-content > .rpt-tabs,
.tbl-page-content > .stat-grid,
.tbl-page-content > .rev-page-toolbar,
.tbl-page-content > .rev-kpi-strip,
.tbl-page-content > .sfr-filter,
.tbl-page-content > .sfr-chrome,
.tbl-page-content > .um-chrome,
.tbl-page-content > .um-flash,
.tbl-page-content > .card:not(.tbl-doc):not(.tbl-panel),
.mtr-page .mtr-filter-card,
.mtr-page .mtr-kpi-strip,
.mtr-page .view-tabs,
.mtr-page .sabre-subnav,
.mtr-page .alert,
.mtr-page .sabre-rpt-back {
  flex-shrink: 0;
  margin-bottom: 0 !important;
}
.tbl-page-content > .dash-an-scroll,
.tbl-page-content > .rev-an-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.tbl-page-content > .card.tbl-doc,
.tbl-page-content > .card.tbl-panel,
.mtr-page .mtr-doc {
  flex: 1;
  min-height: 0;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}
.tbl-page-content > .card.tbl-panel > .card-body,
.tbl-page-content > .card.tbl-doc  > .card-body,
.mtr-page .mtr-doc > .card-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tbl-page-content > .card.tbl-panel > .card-body > .tbl-wrapper,
.tbl-page-content > .card.tbl-doc  > .card-body > .tbl-wrapper,
.mtr-page .mtr-doc > .card-body > .tbl-wrapper {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 0;
  border: none;
}
.mtr-page .mtr-kpi-strip { margin-bottom: 0; }
@media (max-width: 768px) {
  body.tbl-page-body,
  body.mtr-page-body {
    overflow: auto;
    height: auto;
  }
  .main-wrapper.tbl-page,
  .main-wrapper.mtr-page {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .tbl-page-content,
  .mtr-page .mtr-content {
    overflow: visible;
    padding: 10px 12px 12px;
    gap: 8px;
  }
  .card.tbl-doc > .tbl-wrapper,
  .card.tbl-panel .tbl-wrapper,
  .mtr-table-wrap {
    max-height: min(62vh, 520px);
    flex: 0 1 auto;
  }
  .tbl-page-content > .dash-an-scroll,
  .tbl-page-content > .rev-an-scroll {
    flex: 0 1 auto;
    overflow: visible;
    max-height: none;
  }
}
.mtr-filters .filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.mtr-filters .lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.mtr-filters .filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mtr-doc {
  padding: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}

/* List pages â table scrolls inside card; footer fixed below table */
.card.tbl-doc,
.card.tbl-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.card.tbl-doc > .card-header,
.card.tbl-panel > .card-header {
  flex-shrink: 0;
  padding: 8px 12px;
  min-height: 0;
}
.card.tbl-panel > .card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
}
.card.tbl-doc > .tbl-wrapper,
.card.tbl-panel .tbl-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-top: 1px solid var(--tbl-line);
  border-radius: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
}
.card.tbl-doc > .mtr-pager-host,
.card.tbl-panel .mtr-pager-host,
.card.tbl-panel > .card-body > .tbl-footer,
.card.tbl-panel > .card-body > .mtr-pager-host {
  flex-shrink: 0;
  width: 100%;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
}
.tbl-page-content > .um-page-kpi,
.tbl-page-content > .um-role-strip,
.tbl-page-content > .epr-kpi,
.tbl-page-content > .um-filter-form,
.tbl-page-content > .detail-two-col-grid,
.tbl-page-content > .mb-2 {
  flex-shrink: 0;
}
.tbl-page-content > .bcc-tables-stack {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tbl-page-content > .bcc-tables-stack > .card.tbl-panel {
  flex: 1;
  min-height: 0;
  margin-bottom: 0 !important;
}
.tbl-page-content.tbl-page-multi {
  overflow-y: auto;
  overflow-x: hidden;
}
.tbl-page-content.tbl-page-multi > .card.tbl-panel {
  flex: none;
  min-height: 140px;
  margin-bottom: 10px !important;
  display: flex;
  flex-direction: column;
}
.tbl-page-content.tbl-page-multi > .card.tbl-panel > .card-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tbl-page-content.tbl-page-multi > .card.tbl-panel > .card-body > .tbl-wrapper {
  overflow: auto;
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
}
.tbl-page-content > .card.mb-2,
.tbl-page-content > .card.mb-2:not(.tbl-panel) {
  flex-shrink: 0;
}
.tbl-page-content > .card.tbl-panel:only-of-type,
.tbl-page-content > .card.tbl-doc:only-of-type {
  flex: 1;
  min-height: 0;
}
.tbl-page-content > .card + .card:not(.tbl-panel):not(.tbl-doc) {
  flex: 0 1 auto;
  max-height: min(32vh, 300px);
  overflow: auto;
  min-height: 0;
}
.mtr-report-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}
.mtr-report-header h2 {
  margin: 0 0 4px;
  font-size: 16px;
}
.mtr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
}
.mtr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.mtr-toolbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.mtr-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mtr-toolbar-channel select {
  min-width: 130px;
  font-size: 12px;
  padding: 6px 8px;
}
.mtr-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--tbl-line);
  border-radius: 8px;
  background: var(--bg-card);
}
.mtr-table {
  width: max-content;
  min-width: 100%;
  border: none;
}
.mtr-table td {
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Note holds the full exchange trail â widen to content, no ellipsis. */
.mtr-table th.mtr-c-note,
.mtr-table td.mtr-c-note {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  text-align: left !important;
}
.mtr-table td.num { font-weight: 600; }

/* ---- LIST PAGES — Ticket Transactions Report V2 chrome ---- */
.tbl-page-content:has(> .list-chrome) {
  padding: 8px 12px 10px;
  gap: 6px;
}
.list-chrome {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
}
.list-chrome .kpi-strip {
  margin: 0 !important;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: color-mix(in srgb, var(--bg-input, #f8fafc) 40%, transparent);
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}
.list-chrome .kpi-item {
  min-width: 92px;
  padding: 6px 16px;
  border-radius: 10px;
}
.list-chrome .kpi-val { font-size: 22px; line-height: 1.15; font-weight: 800; }
.list-chrome .kpi-sub { display: none; }
.list-filter-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 34px;
  padding: 3px 8px;
  scrollbar-width: thin;
}
.list-filter-row .form-input,
.list-filter-row input[type="search"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 5px;
  outline: none;
  font-family: inherit;
  height: 28px !important;
  padding: 2px 8px !important;
  font-size: 12px !important;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 100px;
  max-width: 140px;
  box-sizing: border-box;
}
.list-filter-row .form-input:focus,
.list-filter-row input[type="search"]:focus { border-color: var(--accent); }
.list-filter-row input[name="q"] { min-width: 150px; max-width: 200px; }
.list-filter-row input[name="pnr"],
.list-filter-row input[name="flight"],
.list-filter-row input[name="orig"],
.list-filter-row input[name="dest"] { min-width: 88px; max-width: 110px; }
.list-filter-row input[name="ticket"] { min-width: 120px; max-width: 150px; }
.list-filter-row input[name="office"],
.list-filter-row input[name="passport"] { min-width: 100px; max-width: 128px; }
.list-filter-row input[type="date"] { min-width: 128px; max-width: 138px; }

/* From–to date pair in one bordered field (same look as Passenger Status: span.ps-date.app-drange) */
.app-drange {
  display: inline-flex; align-items: center; flex: 0 0 auto; min-width: max-content;
  height: 28px; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-input); overflow: visible;
}
.app-drange:focus-within { border-color: var(--accent); }
span.ps-date.app-drange > input[type="date"] {
  border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
  height: 26px !important; min-height: 0; flex: 0 0 auto !important;
  width: 9.25rem !important; min-width: 9.25rem !important; max-width: none !important;
  padding: 0 4px 0 6px !important; font-size: 12px;
}
.app-drange > input[type="date"]:focus { outline: none; }
.app-drange > input[type="date"]::-webkit-datetime-edit { min-width: 6.5rem; }
.app-drange > input[type="date"]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; margin-left: 2px; }
.app-drange > .ps-dash { color: var(--text-muted); font-size: 11px; padding: 0 4px; flex: 0 0 auto; }
.list-filter-row select.form-input { min-width: 86px; max-width: 118px; }
.list-filter-row .btn-sm {
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.list-filter-row .fp-count,
.list-filter-row .mtr-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  padding-left: 8px;
}
.card.tbl-doc.list-doc { padding: 0 !important; }
.card.tbl-doc.list-doc > .card-header {
  padding: 7px 12px;
  min-height: 0;
}
.card.tbl-doc.list-doc > .card-header h3 { font-size: 13px; }
.card.tbl-doc.list-doc > .mtr-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: none;
  border-radius: 0;
}
.list-doc .mtr-table.tbl-sm {
  width: max-content;
  min-width: 100%;
  border: none;
}
.list-doc .mtr-table.tbl-sm th {
  padding: 5px 6px;
  font-size: 10.5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--tbl-head-bg) !important;
  color: var(--tbl-head-fg) !important;
}
.list-doc .mtr-table.tbl-sm td {
  padding: 3px 6px;
  font-size: 11px;
  white-space: nowrap;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
@media (max-width: 768px) {
  .list-chrome .kpi-strip { gap: 6px; padding: 6px 8px; }
  .list-chrome .kpi-item { min-width: 72px; padding: 5px 8px; }
  .list-chrome .kpi-val { font-size: 16px; }
}

/* ---- LIST ANALYTICS — BCC / chart_reports chrome ---- */
.tbl-page-content > .rpt-tabs { flex-shrink: 0; }
.tbl-page-content > .list-an-dash {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.list-an-dash { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
.list-an-dash > .kpi-cards, .list-an-dash > .chart-grid { flex-shrink: 0; }
.list-an-dash > .cr-col { flex: 1; }
.cr-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  padding: 7px 8px 8px;
  box-shadow: 0 1px 2px color-mix(in srgb, #000 4%, transparent);
}
.cr-col-h {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 1px 2px 2px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cr-col-h .ui-ico { width: 26px; height: 26px; border-radius: 7px; }
.cr-col-h strong { font-size: 12px; font-weight: 750; line-height: 1.2; }
.cr-col-h span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; flex-shrink: 0; }
.cr-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-input, #f8fafc) 55%, var(--bg-card));
  line-height: 1.15;
  text-align: center;
}
.cr-chip .k {
  font-size: 10px;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .2px;
}
html[lang="lo"] .cr-chip .k,
html[lang="zh"] .cr-chip .k { text-transform: none; letter-spacing: 0; }
.cr-chip .v {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--kpi-c, var(--text-primary));
  line-height: 1.15;
}
.cr-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 6px; flex-shrink: 0; }
.cr-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex-shrink: 0; }
.cr-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; flex-shrink: 0; }
.cr-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
  background: color-mix(in srgb, var(--bg-hover) 25%, var(--bg-card));
  display: flex;
  flex-direction: column;
}
.cr-panel h3 {
  margin: 0;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-chart { position: relative; height: 168px; padding: 6px 8px 8px; }
.cr-chart.sm { height: 148px; }
@media (max-width: 1180px) {
  .cr-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .cr-grid, .cr-grid-2, .cr-grid-3 { grid-template-columns: 1fr; }
}
.mtr-sources {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.mtr-doc .mtr-inline-fp {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  flex-shrink: 0;
}
.mtr-doc .mtr-pager-host {
  flex-shrink: 0;
}
@media print {
  body.mtr-page-body { overflow: visible; height: auto; }
  .mtr-page { height: auto; max-height: none; overflow: visible; }
  .mtr-page .topbar,
  .mtr-filter-card,
  .mtr-kpi-strip,
  .sabre-subnav,
  .mtr-inline-fp,
  .sabre-rpt-filter-bar,
  .mtr-pager-host,
  .mtr-sources,
  .export-wrap { display: none !important; }
  .mtr-page .mtr-content { overflow: visible; padding: 0; }
  .mtr-doc { border: none; box-shadow: none; }
  .mtr-table-wrap { overflow: visible !important; max-height: none !important; }
  .mtr-table th { position: static; }
}
.mtr-page .empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.mtr-page .sabre-source-pre {
  flex: 1;
  min-height: 0;
  max-height: none;
}
@media (max-width: 768px) {
  .mtr-page .mtr-content {
    padding: 10px 12px 12px;
    gap: 8px;
  }
}

/* ACCB â no page scroll; table area scrolls inside card */
.mtr-page .sabre-rpt-back {
  flex-shrink: 0;
  margin-bottom: 0 !important;
}
.mtr-page .sabre-rpt-doc-fixed {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 10px;
}
.mtr-page .sabre-rpt-doc-fixed .kpi-strip,
.mtr-page .sabre-rpt-doc-fixed .fp,
.mtr-page .sabre-rpt-doc-fixed .sabre-rpt-filter-bar {
  flex-shrink: 0;
  margin-bottom: 0;
}
.sabre-rpt-filter-bar {
  margin-bottom: 10px;
  gap: 8px 10px;
}
.sabre-rpt-filter-bar .fp-g.w-sm { flex: 1 1 120px; min-width: 110px; }
.sabre-rpt-filter-bar .fp-g.w-md { flex: 1 1 150px; min-width: 140px; }
.sabre-rpt-filter-bar .form-input { width: 100%; font-size: 12px; padding: 6px 8px; }

/* ââ Export dropdown (all reports â fixed via JS to escape overflow:hidden) âââââ */
.export-wrap { position: relative; z-index: 5; }
.export-wrap.open { z-index: 6000; }
.export-btn {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.export-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  z-index: 6000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
  overflow-x: hidden;
  overflow-y: auto;
  display: none;
}
.export-wrap.open .export-dropdown { display: block; }
.export-dropdown .export-sep,
.export-dropdown hr.export-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
  height: 0;
}
.export-dropdown--rich {
  min-width: 260px;
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}
.export-dropdown--rich .export-option {
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 8px;
}
.export-dropdown--rich .export-option .ttl {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  display: block;
}
.export-dropdown--rich .export-option .sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
  display: block;
}
.export-dropdown--rich .export-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.export-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background .12s;
}
.export-option:hover { background: var(--card-hover); }
.export-option .exp-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.export-option .exp-icon svg { display: block; }

.mtr-page .sabre-rpt-data-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
  overflow: hidden;
}
.mtr-page .sabre-rpt-data-card .card-header {
  flex-shrink: 0;
}
.mtr-page .sabre-rpt-data-card .card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mtr-page .sabre-rpt-doc-fixed .sabre-tbl-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.mtr-page .sabre-rpt-doc-fixed .sabre-tbl-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.mtr-page .sabre-rpt-doc-fixed .tbl-pager-bar,
.mtr-page .sabre-rpt-doc-fixed .sabre-rpt-foot {
  flex-shrink: 0;
}

.sabre-source-pre {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--bg-input);
  color: var(--text);
  max-height: min(78vh, 720px);
  overflow: auto;
}
.sabre-rpt-foot {
  font-size: 11px;
  padding: 10px 16px 14px;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.sabre-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
  margin: 12px 0;
}
.sabre-meta-grid .lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- PNR LINK ---- */
.pnr-link {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.pnr-link:hover { color: var(--accent3); text-decoration: underline; }

/* ---- DETAIL PAGE ---- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.detail-field { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }
.detail-value { font-size: 14px; color: var(--text-bright); font-weight: 500; }
.detail-value.mono { font-family: 'Courier New', monospace; }

/* ---- TIMELINE ---- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-item { position: relative; margin-bottom: 14px; }
.tl-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
}
.tl-content { background: var(--bg-card2); border-radius: 6px; padding: 10px 14px; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.tl-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- ROUTE VIZ ---- */
.route-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.route-airport { font-family: 'Courier New', monospace; font-weight: 700; font-size: 16px; color: var(--text-bright); }
.route-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent2), var(--accent)); position: relative; }
.route-line::after { content: 'â'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 14px; color: var(--accent); }
.route-info { color: var(--text-muted); font-size: 12px; }

/* ---- MISC ---- */
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-bright { color: var(--text-bright); }
.text-success{ color: var(--success); }
.text-warn   { color: var(--warning); }
.text-danger { color: var(--danger); }
.mono { font-family: 'Courier New', monospace; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-muted); background: var(--bg-elevated, rgba(0,0,0,.03)); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 10px; opacity: .4; }
.empty-state-box { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; max-width: 420px; margin: 0 auto; }
.empty-state-zero {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--accent);
  background: rgba(59, 130, 246, .12); border: 2px solid rgba(59, 130, 246, .25);
}
.empty-state-title { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.empty-state-hint { font-size: 12px; color: var(--text-muted); }
tr.tbl-empty-row td { vertical-align: middle !important; }

/* ---- FORM ELEMENTS ---- */
input[type="text"], input[type="password"], input[type="file"], input[type="date"],
input[type="number"], textarea, select {
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, background .3s;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .7px; display: block; margin-bottom: 5px; }

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 48px; opacity: .4; margin-bottom: 12px; }
.upload-title { font-size: 16px; font-weight: 600; color: var(--text-bright); margin-bottom: 6px; }
.upload-sub { font-size: 13px; color: var(--text-muted); }
.upload-zone.has-file { border-color: var(--success); background: color-mix(in srgb, var(--success) 5%, transparent); }
.upload-zone.has-file .upload-icon { opacity: .8; }

/* page-level responsive grid helpers */
.upload-layout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}
.upload-sidebar-col { min-width: 0; }

/* ---- Upload page: fit one viewport (no page scroll on desktop) ---- */
body.tbl-page-body .main-wrapper.upload-page {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
body.tbl-page-body .upload-page-content.tbl-page-content {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  padding: 8px 14px 10px;
  overflow: hidden;
}
body.tbl-page-body .upload-page-content > .kpi-strip {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-bottom: 0 !important;
}
body.tbl-page-body .upload-page-content > .upload-sync-row {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}
body.tbl-page-body .upload-page-content > .upload-form-col {
  grid-column: 1;
  grid-row: 3;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.tbl-page-body .upload-page-content > .upload-side-col {
  grid-column: 2;
  grid-row: 3;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.upload-form-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0 !important;
}
.upload-form-card > .card-header {
  flex-shrink: 0;
  padding: 8px 12px;
}
.upload-form-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px !important;
}
.upload-form-sub {
  font-size: 12px;
  margin: 0 0 8px;
  line-height: 1.35;
}
.upload-src-wrap { margin: 0 0 8px; }
.upload-src-tabs { margin-top: 4px; }
.upload-batch-date { margin-top: 8px; }
.upload-form-hint { font-size: 10px; margin-top: 2px; }
.upload-submit-row { margin-top: 10px; }
.upload-progress { margin-top: 10px; }
.upload-progress-lbl { font-size: 12px; font-weight: 600; color: var(--text-bright); }
.upload-progress-pct { font-size: 12px; color: var(--accent); }
.upload-log {
  background: var(--bg-input);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 11px;
  max-height: min(22vh, 160px);
  overflow-y: auto;
  border: 1px solid var(--border);
}
.upload-result { margin-top: 8px; }
.upload-page .steps { margin-bottom: 10px; }
.upload-page .step-dot {
  width: 26px;
  height: 26px;
  font-size: 11px;
}
.upload-page .step:not(:last-child)::after { top: 13px; }
.upload-page .step-label { font-size: 9px; }
.upload-page .upload-zone { padding: 10px 10px; }
.upload-page .upload-icon { font-size: 22px; margin-bottom: 2px; }
.upload-page .upload-title { font-size: 13px; margin-bottom: 2px; }
.upload-page .upload-sub { font-size: 11px; }
.upload-page .sabre-source-list { max-height: min(20vh, 140px); }
.upload-page #batchSourcePanel,
.upload-page #sabreSourcePanel {
  margin-top: 6px !important;
  padding: 8px !important;
}
.kpi-strip.kpi-upload-compact { margin-bottom: 0; }
.kpi-strip.kpi-upload-compact .kpi-item { padding: 6px 10px 5px; }
.kpi-strip.kpi-upload-compact .kpi-val { font-size: 18px; line-height: 1.15; }
.kpi-strip.kpi-upload-compact .kpi-label { font-size: 10px; margin-bottom: 1px; }
.kpi-strip.kpi-upload-compact .kpi-sub { display: none; }
.upload-sync-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}
@media (min-width: 993px) and (max-width: 1500px) {
  .upload-sync-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-sync-row > .sync-status-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.upload-page .sync-status-card {
  flex-shrink: 0;
  min-width: 0;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}
.upload-page .sync-status-card .card-header {
  padding: 5px 8px;
  gap: 6px;
  flex-wrap: nowrap;
}
.upload-page .sync-status-card .card-header h3 {
  font-size: 11.5px;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.25;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.upload-page .sync-status-card .card-header h3 span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-page .sync-status-head-end {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.upload-page .sync-status-head-end .btn {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  gap: 4px;
  white-space: nowrap;
}
.upload-page .sync-status-card .card-body { padding: 6px 8px !important; }
.upload-page .sync-status-sub {
  font-size: 10px;
  margin: 0 0 5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upload-page .sync-status-grid {
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
}
.upload-page .sync-status-grid > div {
  padding: 4px 6px;
}
.upload-page .sync-status-grid strong {
  font-size: 11px;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  line-height: 1.2;
}
.upload-page .sync-last-msg {
  font-size: 10px;
  margin: 0;
  min-height: 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upload-page .sync-status-head-end {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.upload-page .sync-status-head-end .btn {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  gap: 4px;
  white-space: nowrap;
}
.upload-page .sync-status-card .card-body { padding: 6px 8px !important; }
.upload-page .sync-status-sub {
  font-size: 10px;
  margin: 0 0 5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upload-page .sync-status-grid {
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
}
.upload-page .sync-status-grid > div {
  padding: 4px 6px;
}
.upload-page .sync-status-grid strong { font-size: 11.5px; }
.upload-page .sync-last-msg {
  font-size: 10px;
  margin: 0;
  min-height: 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upload-tables-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.upload-tables-stack .tbl-panel {
  flex: 1;
  min-height: 0;
  margin-bottom: 0 !important;
}
.upload-tables-stack .tbl-panel .card-header {
  padding: 6px 10px;
}
.upload-tables-stack .tbl-panel .card-header h3 {
  font-size: 12px;
}
.upload-tbl-hdr-end { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.kpi-val.kpi-loading {
  color: transparent;
  background: linear-gradient(90deg, var(--border) 0%, color-mix(in srgb, var(--border) 40%, var(--bg-card)) 45%, var(--border) 100%);
  background-size: 200% 100%;
  animation: uploadSkel 1.1s ease-in-out infinite;
  border-radius: 4px;
  min-width: 3ch;
  min-height: 1.2em;
  display: inline-block;
}
.upload-dash-card .upload-dash-body { padding: 12px 14px !important; }
.upload-dash-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.upload-dash-card-hdr h3 { margin: 0; flex: 1; min-width: 0; font-size: 14px; }
.upload-dash-refresh {
  min-width: 36px;
  padding: 4px 10px !important;
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
}
.upload-dash-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.upload-kpi-tile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card2);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 10px;
  min-height: 72px;
}
.upload-kpi-ico { color: var(--accent); flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; }
.upload-kpi-meta { min-width: 0; flex: 1; }
.upload-kpi-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .35px; color: var(--text-muted); margin-bottom: 4px; line-height: 1.25; }
.upload-kpi-val { font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.upload-kpi-val.upload-kpi-skel {
  color: transparent;
  background: linear-gradient(90deg, var(--border) 0%, color-mix(in srgb, var(--border) 40%, var(--bg-card)) 45%, var(--border) 100%);
  background-size: 200% 100%;
  animation: uploadSkel 1.1s ease-in-out infinite;
  border-radius: 4px;
  min-width: 3ch;
  min-height: 24px;
  display: inline-block;
}
@keyframes uploadSkel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.upload-history-tbl thead th { font-size: 10px; white-space: nowrap; }
.users-layout-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

/* users.php create/edit form â 2 columns where space allows */
.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  align-items: start;
}
.user-form-grid .form-group {
  margin-bottom: 0;
}
.user-form-grid .form-group--span2 {
  grid-column: 1 / -1;
}
@media (max-width: 480px) {
  .user-form-grid {
    grid-template-columns: 1fr;
  }
}
.user-role-legend-card .user-role-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.user-role-legend-card .user-role-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.user-role-legend-card .user-role-pill {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.user-role-legend-card .user-role-desc {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 1px;
  line-height: 1.35;
}

/* ââ User Management page (users.php) âââââââââââââââââââââââââ */
.users-page { display: flex; flex-direction: column; gap: 14px; }
.um-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.um-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.um-kpi-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.um-kpi-icon svg { opacity: .9; }
.um-kpi-icon--total { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.um-kpi-icon--admin { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.um-kpi-icon--manager { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.um-kpi-icon--active { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.um-kpi-body { min-width: 0; }
.um-kpi-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.um-kpi-val { font-size: 22px; font-weight: 700; color: var(--text-bright); line-height: 1.1; margin-top: 2px; }
.um-kpi-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.um-flash {
  padding: 11px 14px; border-radius: 10px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.um-flash--success {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  color: color-mix(in srgb, var(--success) 90%, var(--text-bright));
}
.um-flash--error {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  color: color-mix(in srgb, var(--danger) 90%, var(--text-bright));
}

.users-layout-grid {
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
}
.um-panel { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
.um-list-card, .um-form-card { padding: 0; overflow: hidden; }
.um-card-head {
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-input) 40%, transparent);
}
.um-card-head h3 {
  margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
}
.um-card-head-meta { font-size: 11px; color: var(--text-muted); }

#um-table { width: 100%; }
#um-table thead th { padding: 6px 8px; font-size: 10.5px; }
#um-table tbody td { padding: 5px 8px; vertical-align: middle; }
#um-table tbody tr { transition: background .15s ease; }
#um-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
#um-table tbody tr.um-row-editing { background: color-mix(in srgb, var(--accent) 8%, transparent); }
#um-table tbody tr.um-row-inactive {
  background: color-mix(in srgb, var(--danger) 6%, transparent);
}
#um-table tbody tr.um-row-inactive td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}
#um-table tbody tr.um-row-inactive .um-user-login,
#um-table tbody tr.um-row-inactive .um-user-meta {
  color: var(--text-muted);
}
.kpi-strip .um-kpi-active { --kpi-c: #5aa888; }
.kpi-strip .um-kpi-inactive { --kpi-c: #c97a86; }
.um-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 72px;
  justify-content: flex-start;
  padding: 2px 8px 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.um-status-ico {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.um-status--on {
  color: var(--success);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--success) 42%, var(--border));
}
.um-status--off {
  color: var(--danger);
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--danger) 55%, var(--border));
}
.um-live {
  display: none;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 1px 7px 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 38%, transparent);
  vertical-align: middle;
  white-space: nowrap;
}
.um-live.is-on { display: inline-flex; }
.um-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent);
  animation: umLivePulse 1.6s ease-out infinite;
}
@keyframes umLivePulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.um-online-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-weight: 700;
}
.um-online-meta[hidden] { display: none !important; }
.um-online-meta .um-live-dot { animation: umLivePulse 1.6s ease-out infinite; }

.um-user-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.um-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: .2px;
  border: 1.5px solid var(--border);
}
.um-avatar--admin { background: color-mix(in srgb, var(--danger) 18%, var(--bg-input)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.um-avatar--sub_admin { background: color-mix(in srgb, #8b5cf6 18%, var(--bg-input)); color: #8b5cf6; border-color: color-mix(in srgb, #8b5cf6 35%, var(--border)); }
.um-avatar--manager { background: color-mix(in srgb, var(--warning) 18%, var(--bg-input)); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.um-avatar--executive { background: color-mix(in srgb, #0d9488 18%, var(--bg-input)); color: #0d9488; border-color: color-mix(in srgb, #0d9488 35%, var(--border)); }
.um-avatar--viewer { background: color-mix(in srgb, var(--info) 18%, var(--bg-input)); color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, var(--border)); }
.um-user-name { font-weight: 600; color: var(--text-bright); font-size: 12px; line-height: 1.2; }
.um-user-login { font-size: 12px; color: var(--accent); font-weight: 600; }
.um-user-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.um-me-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 1px 5px; border-radius: 10px; margin-left: 4px; vertical-align: middle;
}

.um-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 650; white-space: nowrap;
}
.um-badge--admin { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.um-badge--sub_admin { background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #8b5cf6; border: 1px solid color-mix(in srgb, #8b5cf6 30%, transparent); }
.um-badge--manager { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); }
.um-badge--executive { background: color-mix(in srgb, #0d9488 14%, transparent); color: #0d9488; border: 1px solid color-mix(in srgb, #0d9488 30%, transparent); }
.um-badge--viewer { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.um-badge--on { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 28%, transparent); }
.um-badge--off { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }

.um-access { min-width: 72px; }
.um-access-val { font-size: 10.5px; font-weight: 650; color: var(--text-bright); margin-bottom: 2px; }
.um-access-bar { height: 4px; background: var(--bg-input); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.um-access-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--success))); }
.um-access-fill--full { background: linear-gradient(90deg, var(--success), color-mix(in srgb, var(--success) 70%, var(--accent))); }

.um-activity { font-size: 10.5px; color: var(--text-muted); line-height: 1.35; }
.um-activity strong { color: var(--text-bright); font-weight: 600; }

.um-actions { display: flex; gap: 5px; justify-content: flex-end; }
.col-actions .um-actions,
.col-actions .epr-app-row-acts,
.col-actions .sabre-view-actions {
  justify-content: center;
}
.um-act-btn {
  width: 26px; height: 26px; padding: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted);
  cursor: pointer; text-decoration: none; transition: all .15s ease;
}
.um-act-btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--bg-input)); }
.um-act-btn:disabled { opacity: .4; cursor: not-allowed; }
.um-act-btn:disabled:hover { color: var(--text-muted); border-color: var(--border); background: var(--bg-input); }
.um-act-btn--danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 8%, var(--bg-input)); }
.um-act-btn--mail:hover:not(:disabled) { color: #0f766e; border-color: color-mix(in srgb, #0d9488 40%, var(--border)); background: color-mix(in srgb, #0d9488 10%, var(--bg-input)); }

.um-form-body { padding: 16px 18px 18px; }
.um-section { margin-bottom: 16px; }
.um-section:last-child { margin-bottom: 0; }
.um-section-title {
  font-size: 10px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .5px;
  margin: 0 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
}
.um-field { margin-bottom: 10px; }
.um-field:last-child { margin-bottom: 0; }
.um-label {
  display: block; font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 5px;
}
.um-label .req { color: var(--danger); }
.um-input, .um-select {
  width: 100%; height: 36px; padding: 0 12px; box-sizing: border-box;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-bright); font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.um-input:focus, .um-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.um-input:disabled { opacity: .65; color: var(--text-muted); cursor: not-allowed; }
.um-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.um-field-grid .um-field--full { grid-column: 1 / -1; }

.um-role-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.um-role-pick { position: relative; cursor: pointer; }
.um-role-pick input { position: absolute; opacity: 0; pointer-events: none; }
.um-role-pick span {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px; border-radius: 10px; text-align: center;
  border: 1px solid var(--border); background: var(--bg-input);
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  transition: all .15s ease;
}
.um-role-pick small { font-size: 9px; font-weight: 500; opacity: .85; line-height: 1.2; }
.um-role-pick input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-input));
  color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.um-role-pick--admin input:checked + span { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--bg-input)); color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 15%, transparent); }
.um-role-pick--sub_admin input:checked + span { border-color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 10%, var(--bg-input)); color: #8b5cf6; box-shadow: 0 0 0 2px color-mix(in srgb, #8b5cf6 15%, transparent); }
.um-role-pick--manager input:checked + span { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--bg-input)); color: var(--warning); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 15%, transparent); }
.um-role-pick--executive input:checked + span { border-color: #0d9488; background: color-mix(in srgb, #0d9488 10%, var(--bg-input)); color: #0d9488; box-shadow: 0 0 0 2px color-mix(in srgb, #0d9488 15%, transparent); }

.um-pw-wrap { position: relative; }
.um-pw-wrap .um-input { padding-right: 38px; }
.um-pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 4px; display: flex; align-items: center;
}
.um-hint { font-size: 10px; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }

.perm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.perm-panel-tools { display: flex; gap: 6px; }
.perm-tool-btn { height: 28px; padding: 0 10px; font-size: 11px; border-radius: 7px; }
.perm-hint { font-size: 11px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.4; }
.perm-admin-note {
  font-size: 11px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 10px;
}
.perm-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.perm-group {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.perm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.perm-group-title { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .4px; }
.perm-group-all { font-size: 10px; color: var(--text-muted); cursor: pointer; user-select: none; }
.perm-group-all input { margin-right: 4px; accent-color: var(--accent); }
.perm-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; }
.perm-item {
  display: flex; align-items: center; gap: 7px; font-size: 11px;
  color: var(--text-bright); padding: 4px 6px; border-radius: 6px; cursor: pointer;
  transition: background .12s ease;
}
.perm-item:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.perm-item input { accent-color: var(--accent); flex-shrink: 0; }
.perm-grid.is-disabled { opacity: .55; pointer-events: none; }

.um-form-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.um-form-actions .btn { height: 40px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.um-form-actions .btn-primary { flex: 1; }

.um-role-guide { padding: 12px 14px; }
.um-role-guide-title { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.um-role-chips { display: flex; flex-direction: column; gap: 8px; }
.um-role-chip {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--bg-input);
}
.um-role-chip-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; padding-top: 1px; }

@media (max-width: 1200px) {
  .users-layout-grid { grid-template-columns: 1fr; }
  .um-panel { position: static; }
}
@media (max-width: 768px) {
  .um-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .um-field-grid { grid-template-columns: 1fr; }
  .perm-items { grid-template-columns: 1fr; }
  .um-user-meta { max-width: 140px; }
  #um-table .um-col-activity { display: none; }
}
@media (max-width: 480px) {
  .um-kpi { grid-template-columns: 1fr; }
  .um-role-picks { grid-template-columns: 1fr; }
}

.detail-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* dashboard responsive layout */
.dash-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.dash-insights-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.dash-an-scroll > .card {
  flex-shrink: 0;
  margin-bottom: 0 !important;
}
.btn-compact { font-size: 12px; padding: 4px 10px; }
.routes-legend { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.route-legend-item { font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; min-width: 0; }
.route-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; flex: 0 0 auto; }
.route-legend-route { font-family: monospace; color: var(--accent); font-weight: 700; overflow-wrap: anywhere; }
.route-legend-cnt { color: var(--text-muted); margin-left: 3px; }

/* ---- PROGRESS BAR ---- */
.progress-wrap { background: var(--bg-input); border-radius: 20px; height: 8px; overflow: hidden; margin: 8px 0; }
.progress-bar  { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 20px; transition: width .4s ease; }

/* ---- STEP INDICATOR ---- */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  counter-reset: step;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--success); }
.step.active:not(:last-child)::after { background: linear-gradient(90deg, var(--accent), var(--border)); }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
  position: relative;
  transition: all .3s;
}
.step.done .step-dot   { background: var(--success); border-color: var(--success); color: #fff; }
.step.active .step-dot { background: var(--accent2); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.step-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; text-align: center; white-space: nowrap; word-break: break-word; }
.step.active .step-label { color: var(--accent); font-weight: 600; }
.step.done .step-label { color: var(--success); }

/* ---- IMPORT LOG TABLE ---- */
.import-log-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent); gap: 12px; }
.import-log-row:last-child { border-bottom: none; }
.log-table-name { font-size: 13px; color: var(--text-bright); font-weight: 500; min-width: 160px; display: flex; align-items: center; gap: 6px; }
.log-table-name svg { display: block; flex-shrink: 0; opacity: .7; }
.log-count { font-size: 13px; color: var(--success); font-weight: 600; }
.log-skip  { font-size: 12px; color: var(--text-muted); }
.log-time  { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.log-bar   { flex: 1; }

/* ---- SCROLLBAR ---- */
/* Page chrome (sidebar / content) â slim */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/*
 * All table panes system-wide â thick, easy H + V scroll
 * Covers .tbl-wrapper, MTR/Sabre/EPR/Users wraps, and any *-table-wrap
 */
:root {
  --tbl-sb-size: 14px;
  --tbl-sb-thumb: color-mix(in srgb, var(--accent) 55%, var(--border));
  --tbl-sb-thumb-hover: var(--accent);
  --tbl-sb-track: var(--bg-input, var(--bg-primary));
}

.tbl-wrapper,
.mtr-table-wrap,
.sabre-tbl-scroll,
.um-table-wrap,
.epr-table-wrap,
.epr-lookup-table-wrap,
.lniata-an-table-wrap,
.epr-an-table-wrap,
.ab-table-wrap,
.bcc-tables-stack .tbl-wrapper,
.upload-tables-stack .tbl-wrapper,
.card.tbl-panel .tbl-wrapper,
.card.tbl-doc > .tbl-wrapper,
.card-body > .tbl-wrapper,
[class*="table-wrap"],
[class*="tbl-scroll"] {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto !important;
  scrollbar-color: var(--tbl-sb-thumb) var(--tbl-sb-track) !important;
}

.tbl-wrapper::-webkit-scrollbar,
.mtr-table-wrap::-webkit-scrollbar,
.sabre-tbl-scroll::-webkit-scrollbar,
.um-table-wrap::-webkit-scrollbar,
.epr-table-wrap::-webkit-scrollbar,
.epr-lookup-table-wrap::-webkit-scrollbar,
.lniata-an-table-wrap::-webkit-scrollbar,
.epr-an-table-wrap::-webkit-scrollbar,
.ab-table-wrap::-webkit-scrollbar,
.bcc-tables-stack .tbl-wrapper::-webkit-scrollbar,
.upload-tables-stack .tbl-wrapper::-webkit-scrollbar,
.card.tbl-panel .tbl-wrapper::-webkit-scrollbar,
.card.tbl-doc > .tbl-wrapper::-webkit-scrollbar,
.card-body > .tbl-wrapper::-webkit-scrollbar,
[class*="table-wrap"]::-webkit-scrollbar,
[class*="tbl-scroll"]::-webkit-scrollbar {
  width: var(--tbl-sb-size) !important;
  height: var(--tbl-sb-size) !important;
}

.tbl-wrapper::-webkit-scrollbar-track,
.mtr-table-wrap::-webkit-scrollbar-track,
.sabre-tbl-scroll::-webkit-scrollbar-track,
.um-table-wrap::-webkit-scrollbar-track,
.epr-table-wrap::-webkit-scrollbar-track,
.epr-lookup-table-wrap::-webkit-scrollbar-track,
.lniata-an-table-wrap::-webkit-scrollbar-track,
.epr-an-table-wrap::-webkit-scrollbar-track,
.ab-table-wrap::-webkit-scrollbar-track,
.bcc-tables-stack .tbl-wrapper::-webkit-scrollbar-track,
.upload-tables-stack .tbl-wrapper::-webkit-scrollbar-track,
.card.tbl-panel .tbl-wrapper::-webkit-scrollbar-track,
.card.tbl-doc > .tbl-wrapper::-webkit-scrollbar-track,
.card-body > .tbl-wrapper::-webkit-scrollbar-track,
[class*="table-wrap"]::-webkit-scrollbar-track,
[class*="tbl-scroll"]::-webkit-scrollbar-track {
  background: var(--tbl-sb-track) !important;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 40%, transparent);
}

.tbl-wrapper::-webkit-scrollbar-thumb,
.mtr-table-wrap::-webkit-scrollbar-thumb,
.sabre-tbl-scroll::-webkit-scrollbar-thumb,
.um-table-wrap::-webkit-scrollbar-thumb,
.epr-table-wrap::-webkit-scrollbar-thumb,
.epr-lookup-table-wrap::-webkit-scrollbar-thumb,
.lniata-an-table-wrap::-webkit-scrollbar-thumb,
.epr-an-table-wrap::-webkit-scrollbar-thumb,
.ab-table-wrap::-webkit-scrollbar-thumb,
.bcc-tables-stack .tbl-wrapper::-webkit-scrollbar-thumb,
.upload-tables-stack .tbl-wrapper::-webkit-scrollbar-thumb,
.card.tbl-panel .tbl-wrapper::-webkit-scrollbar-thumb,
.card.tbl-doc > .tbl-wrapper::-webkit-scrollbar-thumb,
.card-body > .tbl-wrapper::-webkit-scrollbar-thumb,
[class*="table-wrap"]::-webkit-scrollbar-thumb,
[class*="tbl-scroll"]::-webkit-scrollbar-thumb {
  background: var(--tbl-sb-thumb) !important;
  border-radius: 10px;
  border: 3px solid var(--tbl-sb-track);
  background-clip: padding-box;
  min-height: 48px;
  min-width: 48px;
}

.tbl-wrapper::-webkit-scrollbar-thumb:hover,
.mtr-table-wrap::-webkit-scrollbar-thumb:hover,
.sabre-tbl-scroll::-webkit-scrollbar-thumb:hover,
.um-table-wrap::-webkit-scrollbar-thumb:hover,
.epr-table-wrap::-webkit-scrollbar-thumb:hover,
.epr-lookup-table-wrap::-webkit-scrollbar-thumb:hover,
.lniata-an-table-wrap::-webkit-scrollbar-thumb:hover,
.epr-an-table-wrap::-webkit-scrollbar-thumb:hover,
.ab-table-wrap::-webkit-scrollbar-thumb:hover,
.bcc-tables-stack .tbl-wrapper::-webkit-scrollbar-thumb:hover,
.upload-tables-stack .tbl-wrapper::-webkit-scrollbar-thumb:hover,
.card.tbl-panel .tbl-wrapper::-webkit-scrollbar-thumb:hover,
.card.tbl-doc > .tbl-wrapper::-webkit-scrollbar-thumb:hover,
.card-body > .tbl-wrapper::-webkit-scrollbar-thumb:hover,
[class*="table-wrap"]::-webkit-scrollbar-thumb:hover,
[class*="tbl-scroll"]::-webkit-scrollbar-thumb:hover {
  background: var(--tbl-sb-thumb-hover) !important;
  background-clip: padding-box;
}

.tbl-wrapper::-webkit-scrollbar-thumb:active,
.mtr-table-wrap::-webkit-scrollbar-thumb:active,
.sabre-tbl-scroll::-webkit-scrollbar-thumb:active,
.um-table-wrap::-webkit-scrollbar-thumb:active,
.epr-table-wrap::-webkit-scrollbar-thumb:active,
.epr-lookup-table-wrap::-webkit-scrollbar-thumb:active,
.lniata-an-table-wrap::-webkit-scrollbar-thumb:active,
.epr-an-table-wrap::-webkit-scrollbar-thumb:active,
.ab-table-wrap::-webkit-scrollbar-thumb:active,
[class*="table-wrap"]::-webkit-scrollbar-thumb:active,
[class*="tbl-scroll"]::-webkit-scrollbar-thumb:active {
  background: color-mix(in srgb, var(--accent) 85%, #000) !important;
  background-clip: padding-box;
}

.tbl-wrapper::-webkit-scrollbar-corner,
.mtr-table-wrap::-webkit-scrollbar-corner,
.sabre-tbl-scroll::-webkit-scrollbar-corner,
.um-table-wrap::-webkit-scrollbar-corner,
.epr-table-wrap::-webkit-scrollbar-corner,
.epr-lookup-table-wrap::-webkit-scrollbar-corner,
.lniata-an-table-wrap::-webkit-scrollbar-corner,
.epr-an-table-wrap::-webkit-scrollbar-corner,
.ab-table-wrap::-webkit-scrollbar-corner,
.bcc-tables-stack .tbl-wrapper::-webkit-scrollbar-corner,
.upload-tables-stack .tbl-wrapper::-webkit-scrollbar-corner,
.card.tbl-panel .tbl-wrapper::-webkit-scrollbar-corner,
.card.tbl-doc > .tbl-wrapper::-webkit-scrollbar-corner,
.card-body > .tbl-wrapper::-webkit-scrollbar-corner,
[class*="table-wrap"]::-webkit-scrollbar-corner,
[class*="tbl-scroll"]::-webkit-scrollbar-corner {
  background: var(--tbl-sb-track) !important;
}

/* Firefox / legacy: keep bars visible on table panes */
@supports not selector(::-webkit-scrollbar) {
  .tbl-wrapper,
  .mtr-table-wrap,
  .sabre-tbl-scroll,
  [class*="table-wrap"],
  [class*="tbl-scroll"] {
    scrollbar-width: auto;
    scrollbar-color: var(--tbl-sb-thumb) var(--tbl-sb-track);
  }
}

/* ---- CHART AREA ---- */
.chart-container { position: relative; height: 250px; min-height: 120px; }

/* dashboard mobile final override (keep single-column like revenue report) */
@media (max-width: 768px) {
  .dash-charts-grid,
  .dash-insights-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .dash-insights-grid > .card,
  .dash-charts-grid > .card {
    min-width: 0;
  }
  .dash-insights-grid .card-body,
  .dash-charts-grid .card-body {
    overflow-x: hidden;
  }
  .upload-layout-grid,
  .upload-layout-grid > div,
  .upload-layout-grid .card,
  .upload-layout-grid .card-body {
    min-width: 0;
  }
  .upload-layout-grid .steps {
    display: flex;
    flex-wrap: wrap !important;
    justify-content: flex-start;
    gap: 8px 6px;
    overflow: visible !important;
  }
  .upload-layout-grid .steps .step {
    flex: 0 0 calc(20% - 5px);
    min-width: 54px;
  }
  .upload-layout-grid .steps .step:not(:last-child)::after {
    display: none;
  }
  .upload-layout-grid .upload-zone,
  .upload-layout-grid input,
  .upload-layout-grid select,
  .upload-layout-grid button {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* prevent number overlap on KPI/stat cards (all pages) */
  .kpi-strip {
    grid-auto-rows: minmax(0, auto);
  }
  .kpi-val,
  .stat-value {
    font-size: 22px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .kpi-strip.kpi-ssr-compact .kpi-val {
    font-size: 16px;
  }
  .kpi-label,
  .kpi-sub,
  .stat-label,
  .stat-sub {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 576px) {
  .kpi-val,
  .stat-value {
    font-size: 20px;
    line-height: 1.12;
  }
  .kpi-strip.kpi-ssr-compact .kpi-val {
    font-size: 16px;
  }
  .chart-container {
    height: 220px !important;
    min-height: 110px !important;
  }
  .routes-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .route-legend-item {
    min-width: 0;
    overflow: hidden;
  }
  .route-legend-route {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* users page mobile final override (stack like revenue report) */
@media (max-width: 992px) {
  .users-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .users-layout-grid > * {
    min-width: 0;
  }
  .kpi-strip {
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
  }
  .kpi-item {
    flex: 1 1 calc(45% - 8px);
    min-width: 0;
  }
  /* 5 KPIs in one row â user management */
  .kpi-strip.kpi-users-mobile {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex-wrap: unset;
    overflow: visible;
  }
  .kpi-strip.kpi-users-mobile .kpi-item {
    flex: initial;
    min-width: 0;
    padding: 8px 6px;
  }
  .kpi-strip.kpi-users-mobile .kpi-label {
    font-size: 9px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-users-mobile .kpi-val {
    font-size: 18px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-users-mobile .kpi-sub {
    font-size: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 576px) {
  .kpi-item {
    flex: 1 1 calc(45% - 8px);
  }
}

/* reservations KPI: force 2 rows on phone (5 items => 3 + 2) */
@media (max-width: 768px) {
  .kpi-strip.kpi-mobile-2rows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }
}

/* reservations filter mobile: row1 PNR+status, row2 office, row3 search+clear side by side */
@media (max-width: 768px) {
  .fp.fp-reservations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: end;
    flex-wrap: unset;
  }
  .fp.fp-reservations-grid .fp-g {
    flex: initial;
    min-width: 0;
  }
  .fp.fp-reservations-grid .fp-g.w-xl {
    grid-column: 1;
    grid-row: 1;
  }
  .fp.fp-reservations-grid .fp-g.w-sm {
    grid-column: 2;
    grid-row: 1;
  }
  .fp.fp-reservations-grid .fp-g.w-md {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .fp.fp-reservations-grid .fp-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
  }
  .fp.fp-reservations-grid .fp-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .fp.fp-reservations-grid .fp-count {
    grid-column: 1 / -1;
    grid-row: 4;
    align-self: center;
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* flights / passengers: compact KPI (1 row Ã 4) + dense filter grid */
  .kpi-strip.kpi-flights-mobile,
  .kpi-strip.kpi-passengers-mobile {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex-wrap: unset;
    overflow: visible;
  }
  .kpi-strip.kpi-flights-mobile .kpi-item,
  .kpi-strip.kpi-passengers-mobile .kpi-item {
    padding: 8px 6px;
    min-width: 0;
  }
  .kpi-strip.kpi-flights-mobile .kpi-label,
  .kpi-strip.kpi-passengers-mobile .kpi-label {
    font-size: 9px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-flights-mobile .kpi-val,
  .kpi-strip.kpi-passengers-mobile .kpi-val {
    font-size: 18px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-flights-mobile .kpi-sub,
  .kpi-strip.kpi-passengers-mobile .kpi-sub {
    font-size: 9px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* remarks & seats: 3 KPI tiles in one row on phone */
  .kpi-strip.kpi-remarks-mobile,
  .kpi-strip.kpi-seats-mobile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    flex-wrap: unset;
    overflow: visible;
  }
  .kpi-strip.kpi-remarks-mobile .kpi-item,
  .kpi-strip.kpi-seats-mobile .kpi-item {
    padding: 8px 6px;
    min-width: 0;
  }
  .kpi-strip.kpi-remarks-mobile .kpi-label,
  .kpi-strip.kpi-seats-mobile .kpi-label {
    font-size: 9px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-remarks-mobile .kpi-val,
  .kpi-strip.kpi-seats-mobile .kpi-val {
    font-size: 18px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-remarks-mobile .kpi-sub,
  .kpi-strip.kpi-seats-mobile .kpi-sub {
    font-size: 9px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* arrangers, documents, exchange rates: 4 KPI tiles in one row on phone */
  .kpi-strip.kpi-arrangers-mobile,
  .kpi-strip.kpi-documents-mobile,
  .kpi-strip.kpi-exchange-mobile {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex-wrap: unset;
    overflow: visible;
  }
  .kpi-strip.kpi-users-mobile {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex-wrap: unset;
    overflow: visible;
  }
  .kpi-strip.kpi-arrangers-mobile .kpi-item,
  .kpi-strip.kpi-documents-mobile .kpi-item,
  .kpi-strip.kpi-exchange-mobile .kpi-item,
  .kpi-strip.kpi-users-mobile .kpi-item {
    padding: 8px 6px;
    min-width: 0;
  }
  .kpi-strip.kpi-arrangers-mobile .kpi-label,
  .kpi-strip.kpi-documents-mobile .kpi-label,
  .kpi-strip.kpi-exchange-mobile .kpi-label,
  .kpi-strip.kpi-users-mobile .kpi-label {
    font-size: 9px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-arrangers-mobile .kpi-val,
  .kpi-strip.kpi-documents-mobile .kpi-val,
  .kpi-strip.kpi-exchange-mobile .kpi-val,
  .kpi-strip.kpi-users-mobile .kpi-val {
    font-size: 18px;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-strip.kpi-arrangers-mobile .kpi-sub,
  .kpi-strip.kpi-documents-mobile .kpi-sub,
  .kpi-strip.kpi-exchange-mobile .kpi-sub,
  .kpi-strip.kpi-users-mobile .kpi-sub {
    font-size: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Universal compact filters (remarks, ssr, rates, passengers, â¦): 2 fields â row1 | row2 count | row3 buttons */
  .fp.fp-mobile-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: end;
    flex-wrap: unset;
  }
  .fp.fp-mobile-compact .fp-g {
    flex: initial;
    min-width: 0;
  }
  .fp.fp-mobile-compact > .fp-g:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .fp.fp-mobile-compact > .fp-g:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  .fp.fp-mobile-compact > .fp-count {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
    justify-content: center;
    width: 100%;
    margin: 0;
  }
  .fp.fp-mobile-compact > .fp-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }
  .fp.fp-mobile-compact > .fp-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 36px;
  }
  /* 3 filter fields (seats, arrangers, documents): row1 three cols */
  .fp.fp-mobile-compact.fp-mobile-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-g:nth-child(1) { grid-column: 1; grid-row: 1; }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-g:nth-child(2) { grid-column: 2; grid-row: 1; }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-g:nth-child(3) { grid-column: 3; grid-row: 1; }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-count {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-actions {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  /* remarks: result count on top, then 2 fields, then buttons */
  .fp.fp-mobile-compact.fp-count-top > .fp-count {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .fp.fp-mobile-compact.fp-count-top > .fp-g:nth-child(1) {
    grid-column: 1;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-count-top > .fp-g:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-count-top > .fp-actions {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  /* 3-field filters + count on top (arrangers, documents): count | row of 3 fields | buttons */
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-count {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-g:nth-child(1) {
    grid-column: 1;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-g:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-g:nth-child(3) {
    grid-column: 3;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  /* flights filter: same pattern as reservations â row1 search+status, middle rows fields, last row filter+clear */
  .fp.fp-flights-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px;
    align-items: end;
    flex-wrap: unset;
  }
  .fp.fp-flights-grid .fp-g {
    flex: initial;
    min-width: 0;
  }
  .fp.fp-flights-grid > .fp-g:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .fp.fp-flights-grid > .fp-g:nth-child(6) { grid-column: 3; grid-row: 1; }
  .fp.fp-flights-grid > .fp-g:nth-child(2) { grid-column: 1; grid-row: 2; }
  .fp.fp-flights-grid > .fp-g:nth-child(3) { grid-column: 2; grid-row: 2; }
  .fp.fp-flights-grid > .fp-g:nth-child(4) { grid-column: 3; grid-row: 2; }
  .fp.fp-flights-grid > .fp-g:nth-child(5) { grid-column: 1 / -1; grid-row: 3; }
  .fp.fp-flights-grid > .fp-actions {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
  }
  .fp.fp-flights-grid > .fp-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 36px;
    font-size: 12px;
    padding: 0 8px;
  }
  .fp.fp-flights-grid > .fp-count {
    grid-column: 1 / -1;
    grid-row: 5;
    text-align: center;
    justify-content: center;
    width: 100%;
    align-self: center;
  }
}

@media (max-width: 420px) {
  .kpi-strip.kpi-flights-mobile,
  .kpi-strip.kpi-passengers-mobile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-strip.kpi-remarks-mobile,
  .kpi-strip.kpi-seats-mobile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-strip.kpi-remarks-mobile .kpi-item:nth-child(3),
  .kpi-strip.kpi-seats-mobile .kpi-item:nth-child(3) {
    grid-column: 1 / -1;
  }
  .kpi-strip.kpi-arrangers-mobile,
  .kpi-strip.kpi-documents-mobile,
  .kpi-strip.kpi-exchange-mobile,
  .kpi-strip.kpi-users-mobile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fp.fp-flights-grid {
    grid-template-columns: 1fr 1fr;
  }
  .fp.fp-flights-grid > .fp-g:nth-child(1) { grid-column: 1; grid-row: 1; }
  .fp.fp-flights-grid > .fp-g:nth-child(6) { grid-column: 2; grid-row: 1; }
  .fp.fp-flights-grid > .fp-g:nth-child(2) { grid-column: 1; grid-row: 2; }
  .fp.fp-flights-grid > .fp-g:nth-child(3) { grid-column: 2; grid-row: 2; }
  .fp.fp-flights-grid > .fp-g:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .fp.fp-flights-grid > .fp-g:nth-child(5) { grid-column: 1 / -1; grid-row: 4; }
  .fp.fp-flights-grid > .fp-actions {
    grid-column: 1 / -1;
    grid-row: 5;
    flex-direction: row;
    gap: 8px;
  }
  .fp.fp-flights-grid > .fp-actions .btn {
    flex: 1;
  }
  .fp.fp-flights-grid > .fp-count {
    grid-row: 6;
  }

  .fp.fp-mobile-compact:not(.fp-mobile-3) > .fp-g:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .fp.fp-mobile-compact:not(.fp-mobile-3) > .fp-g:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .fp.fp-mobile-compact:not(.fp-mobile-3) > .fp-count {
    grid-row: 3;
  }
  .fp.fp-mobile-compact:not(.fp-mobile-3) > .fp-actions {
    grid-row: 4;
  }
  .fp.fp-mobile-compact.fp-mobile-3 {
    grid-template-columns: 1fr 1fr;
  }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-g:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-g:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-g:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-count {
    grid-row: 3;
  }
  .fp.fp-mobile-compact.fp-mobile-3 > .fp-actions {
    grid-row: 4;
  }
  .fp.fp-mobile-compact.fp-count-top:not(.fp-mobile-3) > .fp-count {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .fp.fp-mobile-compact.fp-count-top:not(.fp-mobile-3) > .fp-g:nth-child(1) {
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-count-top:not(.fp-mobile-3) > .fp-g:nth-child(2) {
    grid-row: 3;
  }
  .fp.fp-mobile-compact.fp-count-top:not(.fp-mobile-3) > .fp-actions {
    grid-row: 4;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-count {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-g:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-g:nth-child(2) {
    grid-column: 1;
    grid-row: 3;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-g:nth-child(3) {
    grid-column: 2;
    grid-row: 3;
  }
  .fp.fp-mobile-compact.fp-mobile-3.fp-count-top > .fp-actions {
    grid-column: 1 / -1;
    grid-row: 4;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
  }
}
.theme-swatch {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}
.swatch-dark-blue   { background: linear-gradient(135deg, #0d1b2a, #00b4d8); }
.swatch-dark-green  { background: linear-gradient(135deg, #0a1a0f, #00c87a); }
.swatch-dark-purple { background: linear-gradient(135deg, #160b22, #a855f7); }
.swatch-light       { background: linear-gradient(135deg, #f0f4f8, #0077b6); }
.swatch-solarized   { background: linear-gradient(135deg, #002b36, #2aa198); }
.swatch-calm        { background: linear-gradient(135deg, #eef3f7, #4b8bb7); }

/* ---- ANIMATIONS ---- */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.spin { animation: spin 1s linear infinite; display: inline-block; }
.pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ---- ALERT BOXES ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: color-mix(in srgb, var(--success) 12%, transparent); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.alert-danger  { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-warn    { background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning); }
.alert-info    { background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }

/* ---- RESPONSIVE ---- */
/* ---- LIGHT THEME OVERRIDES ---- */
[data-theme="light"] thead th { background: var(--tbl-head-bg); color: var(--tbl-head-fg); border-right-color: #e2e8f0; border-bottom-color: #d5dde8; }
[data-theme="light"] tbody td { border-bottom-color: #e8edf3; border-right-color: #edf1f6; }
[data-theme="light"] .tbl-wrapper,
[data-theme="light"] .sabre-tbl-scroll,
[data-theme="light"] .mtr-table-wrap { border-color: #e2e8f0; }
[data-theme="light"] .topbar { box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ============================================================
   COMPACT RESPONSIVE â report / management pages
   BCC Passenger Charge Report Â· Sabre Reports Â· EPR Participants
   Hardware & LNIATA Â· Activity Log Â· User Management
   Goal: pack KPIs + filters tightly on phones/tablets while
   staying clean, balanced and professional (no wasteful
   full-width stacking).
   ============================================================ */

/* ---- KPI strips (sabre, activity log): clean 2Ã2 grid on phones ---- */
@media (max-width: 768px) {
  .kpi-strip.kpi-mobile-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    flex-wrap: unset;
    overflow: visible;
  }
  .kpi-strip.kpi-mobile-2col .kpi-item {
    flex: initial;
    min-width: 0;
    padding: 9px 10px;
  }
  .kpi-strip.kpi-mobile-2col .kpi-val { font-size: 20px; }
  .kpi-strip.kpi-mobile-2col .kpi-label,
  .kpi-strip.kpi-mobile-2col .kpi-sub {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ---- BCC KPI strip (5 items): compact grid instead of ragged wrap ---- */
@media (max-width: 768px) {
  .bcc-kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex-wrap: unset;
  }
  .bcc-kpi {
    min-width: 0;
    padding: 8px 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .bcc-kpi:nth-child(3n) { border-right: none; }
  .bcc-kpi:nth-last-child(-n+2) { border-bottom: none; }
  .bcc-kpi .k-val { font-size: 17px; }
}
@media (max-width: 480px) {
  .bcc-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bcc-kpi:nth-child(3n) { border-right: 1px solid var(--border); }
  .bcc-kpi:nth-child(2n) { border-right: none; }
  .bcc-kpi:nth-last-child(-n+2) { border-bottom: none; }
  .bcc-kpi .k-val { font-size: 16px; }
}

/* ---- Icon KPI cards (EPR, User Mgmt): keep 2-up + tighten on phones ---- */
@media (max-width: 480px) {
  .epr-kpi, .um-page-kpi { gap: 8px; margin-bottom: 8px; }
  .epr-kpi-card, .um-page-kpi-card { padding: 9px 10px; gap: 8px; }
  .epr-kpi-icon, .um-page-kpi-icon { width: 30px; height: 30px; }
  .epr-kpi-icon svg, .um-page-kpi-icon svg { width: 16px; height: 16px; }
  .epr-kpi-val, .um-page-kpi-val { font-size: 18px; }
  .epr-kpi-label, .um-page-kpi-label { font-size: 10px; }
  .epr-kpi-sub, .um-page-kpi-sub { font-size: 10px; }
}

/* ---- Page KPI cards (Hardware & LNIATA): stay 2-up on phones ---- */
@media (max-width: 480px) {
  .page-kpi,
  .page-kpi--4,
  .page-kpi--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-bottom: 8px;
  }
  .page-kpi-card { padding: 9px 10px; gap: 8px; }
  .page-kpi-icon { width: 30px; height: 30px; }
  .page-kpi-icon svg { width: 16px; height: 16px; }
  .page-kpi-val { font-size: 18px; }
  .page-kpi-label { min-height: 0; }
}

/* ---- Generic 2-column filter for phones (LNIATA, Activity Log, â¦) ---- */
@media (max-width: 768px) {
  .fp.fp-compact2 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
  }
  .fp.fp-compact2 > .fp-g {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: calc(50% - 4px) !important;
  }
  /* search / wide fields take a full row for readability */
  .fp.fp-compact2 > .fp-g.w-xl,
  .fp.fp-compact2 > .fp-g.w-lg {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
  .fp.fp-compact2 > .fp-count {
    flex: 1 1 100%;
    text-align: center;
    justify-content: center;
    margin: 0;
    order: 98;
  }
  .fp.fp-compact2 > .fp-actions {
    flex: 1 1 100%;
    display: flex;
    gap: 8px;
    order: 99;
  }
  .fp.fp-compact2 > .fp-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 34px;
  }
}

/* ---- EPR / User Management filters: 2-up on phones (no full stacking) ---- */
@media (max-width: 576px) {
  .epr-filter, .um-filter { padding: 9px 10px; margin-bottom: 8px; }
  .epr-filter-row, .um-filter-row { gap: 8px; }
  .epr-filter .fp-g,
  .um-filter .fp-g {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: calc(50% - 4px) !important;
  }
  .epr-filter .fp-g.w-wide {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
  .epr-filter-actions, .um-filter-actions {
    margin-top: 8px;
    padding-top: 8px;
    flex-wrap: wrap;
  }
  .epr-filter-actions .btn, .um-filter-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 34px;
  }
  .epr-filter-count, .um-filter-count {
    margin-left: 0;
    width: 100%;
    text-align: center;
    order: 99;
  }
}

/* ============================================================
   Global toast notifications + confirm dialog
   ============================================================ */
.app-toast-stack {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px color-mix(in srgb, #fff 5%, transparent);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  animation: appToastIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-toast.is-leaving {
  animation: appToastOut 0.28s ease forwards;
}
.app-toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-toast--success .app-toast-icon { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.app-toast--error .app-toast-icon { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.app-toast--warning .app-toast-icon { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.app-toast--info .app-toast-icon { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.app-toast--success { border-left: 4px solid var(--success); }
.app-toast--error { border-left: 4px solid var(--danger); }
.app-toast--warning { border-left: 4px solid var(--warning); }
.app-toast--info { border-left: 4px solid var(--accent); }
.app-toast-content { flex: 1; min-width: 0; padding-right: 4px; }
.app-toast-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; color: var(--text-bright, var(--text-primary)); }
.app-toast-msg { color: var(--text-primary); word-break: break-word; }
.app-toast-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.app-toast-actions { margin-top: 6px; }
.app-toast-actions a { font-size: 11px; font-weight: 700; color: var(--accent); text-decoration: none; }
.app-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.app-toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.app-toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: 0.35;
  transform-origin: left center;
  animation: appToastProgress linear forwards;
}
.app-toast--success .app-toast-progress { color: var(--success); }
.app-toast--error .app-toast-progress { color: var(--danger); }
.app-toast--warning .app-toast-progress { color: var(--warning); }
.app-toast--info .app-toast-progress { color: var(--accent); }
@keyframes appToastIn {
  from { opacity: 0; transform: translateX(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes appToastOut {
  to { opacity: 0; transform: translateX(12px) scale(0.96); }
}
@keyframes appToastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
body.app-confirm-open { overflow: hidden; }
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  animation: appConfirmFade 0.2s ease;
}
.app-confirm-overlay[hidden] { display: none !important; }
.app-confirm-dialog {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  animation: appConfirmIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-confirm-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
}
.app-confirm-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-bright, var(--text-primary));
}
.app-confirm-msg {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.app-confirm-actions .btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
@keyframes appConfirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes appConfirmIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 520px) {
  .app-toast-stack { top: auto; bottom: 16px; right: 12px; left: 12px; max-width: none; }
}

/* -- Passengers reference table (grouped header) ----------- */
.tbl-pax-ref { width: 100%; border-collapse: collapse; }
.tbl-pax-ref thead th {
  text-align: center !important;
  vertical-align: middle;
  white-space: normal;
  line-height: 1.25;
}
.tbl-pax-ref tr.pax-h1 th {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .3px;
  padding: 8px 10px !important;
  border-bottom: 1px solid var(--tbl-line);
}
.tbl-pax-ref tr.pax-h2 th {
  font-size: 10px !important;
  font-weight: 600 !important;
  padding: 8px 8px !important;
}
.tbl-pax-ref tbody td {
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--tbl-line);
}
.tbl-pax-ref tbody td.pax-name-cell {
  text-align: left;
  white-space: nowrap;
}
.tbl-pax-ref .pax-name-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .2px;
}
.tbl-pax-ref .pax-name-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}
[data-theme="dark"] .tbl-pax-ref .pax-name-link,
html.theme-dark .tbl-pax-ref .pax-name-link {
  color: #60a5fa;
}
.tbl-pax-ref a.pax-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tbl-pax-ref a.pax-sort:hover { opacity: .9; }
.tbl-pax-ref .pax-sort-ico {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .45;
  flex-shrink: 0;
}
.tbl-pax-ref a.pax-sort.is-asc .pax-sort-ico {
  border-top: none;
  border-bottom: 5px solid currentColor;
  opacity: .95;
}
.tbl-pax-ref a.pax-sort.is-desc .pax-sort-ico {
  opacity: .95;
}

/* Full passenger dossier table  left-align long text columns */
.tbl-pax-full tbody td {
  text-align: left;
}
.tbl-pax-full tbody td.col-num,
.tbl-pax-full tbody td.center,
.tbl-pax-full thead th.center {
  text-align: center !important;
}
.tbl-pax-full tbody td.td-truncate {
  max-width: 180px;
}

/* ── Report KPI cards + chart grid (Charts tabs; see assets/js/app-charts.js) ── */
.kpi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 6px; }
.kpi-card {
  --kc: var(--accent);
  display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 10px;
  border: 1px solid var(--border); border-left: 3px solid var(--kc); border-radius: 8px;
  background: var(--bg-card); color: inherit; text-decoration: none; text-align: left;
}
.kpi-card .l { font-size: 10.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card .v { font-size: 17px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text-primary, inherit); white-space: nowrap; }
.kpi-card .v small { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.kpi-card .s { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.kpi-card { cursor: pointer; transition: background .15s, border-color .15s; }
a.kpi-card:hover { border-color: var(--kc); background: color-mix(in srgb, var(--kc) 6%, var(--bg-card)); }
a.kpi-card.active { border-color: var(--kc); background: color-mix(in srgb, var(--kc) 13%, var(--bg-card)); box-shadow: 0 0 0 1px var(--kc) inset; }
.kpi-card.t-blue { --kc: #3b82f6; } .kpi-card.t-indigo { --kc: #6366f1; } .kpi-card.t-teal { --kc: #0d9488; } .kpi-card.t-green { --kc: #16a34a; }
.kpi-card.t-amber { --kc: #d97706; } .kpi-card.t-red { --kc: #dc2626; } .kpi-card.t-violet { --kc: #7c3aed; } .kpi-card.t-slate { --kc: #64748b; }
.kpi-card.t-pink { --kc: #db2777; } .kpi-card.t-cyan { --kc: #0891b2; }

.chart-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.chart-card {
  grid-column: span 4; display: flex; flex-direction: column; min-width: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.chart-card.w3 { grid-column: span 3; } .chart-card.w5 { grid-column: span 5; } .chart-card.w6 { grid-column: span 6; }
.chart-card.w7 { grid-column: span 7; } .chart-card.w8 { grid-column: span 8; } .chart-card.w12 { grid-column: span 12; }
.chart-card-h { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; }
.chart-card-h svg { color: var(--accent); flex-shrink: 0; }
.chart-card-h .sub { margin-left: auto; font-size: 10.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.chart-card-b { position: relative; padding: 8px 10px; height: 220px; }
.chart-card-b.tall { height: 270px; } .chart-card-b.sm { height: 190px; }
.chart-card-b canvas { position: absolute; inset: 8px 10px; width: calc(100% - 20px) !important; height: calc(100% - 16px) !important; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 12px; color: var(--text-muted); }
.chart-funnel { display: flex; flex-direction: column; justify-content: center; gap: 9px; height: 100%; }
.chart-funnel .row { display: grid; grid-template-columns: 78px 1fr 64px; align-items: center; gap: 8px; font-size: 11.5px; }
.chart-funnel .lbl { color: var(--text-muted); font-weight: 600; }
.chart-funnel .bar { height: 16px; border-radius: 5px; background: color-mix(in srgb, var(--text-muted) 12%, transparent); overflow: hidden; }
.chart-funnel .bar i { display: block; height: 100%; border-radius: 5px; background: var(--fc); }
.chart-funnel .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-funnel .val small { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); }
.chart-card { transition: border-color .15s, box-shadow .15s; }
.chart-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 2px 10px rgba(15, 23, 42, .06); }
.chart-card.is-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.app-chart-zoom { cursor: zoom-in; }

/* Every chart panel in the app shares the Statistics Flight "chart-card" look
   (body-prefixed to win over page-level <style> blocks that load after this file). */
body .rev-chart-card, body .cr-panel, body .ab-card, body .lniata-an-card, body .epr-an-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
body .app-chart-panel:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 2px 10px rgba(15, 23, 42, .06); }
body .app-chart-panel.is-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
body .rev-chart-hdr, body .cr-panel > h3, body .ab-card-h, body .lniata-an-card-h, body .epr-an-card-h {
  display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 6px; min-height: 34px;
  padding: 7px 12px; margin: 0; border-bottom: 1px solid var(--border); background: none;
  font-size: 12px; font-weight: 700; color: var(--text-primary);
}
body .cr-panel > h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body .rev-chart-title, body .ab-card-h h3, body .lniata-an-card-h h3, body .epr-an-card-h h3 {
  display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0;
  font-size: 12px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body .rev-chart-title svg, body .ab-card-h h3 svg, body .lniata-an-card-h h3 svg, body .epr-an-card-h h3 svg {
  width: 13px; height: 13px; color: var(--accent); opacity: 1; flex-shrink: 0;
}
body .ab-card-h .ui-ico, body .lniata-an-card-h .ui-ico, body .epr-an-card-h .ui-ico {
  width: auto; height: auto; padding: 0; border-radius: 0; background: none; color: var(--accent);
}
body .rev-chart-hdr > .rev-chart-title + :not(.chart-tools),
body .ab-card-h .meta, body .epr-an-card-h .meta, body .lniata-an-card-h .meta { margin-left: auto; }
body .rev-chart-badge { font-size: 10.5px; font-weight: 600; padding: 1px 8px; }
body .ab-card-h .meta, body .epr-an-card-h .meta, body .lniata-an-card-h .meta { font-size: 10.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
body .rev-chart-hdr .chart-tools, body .ab-card-h .chart-tools, body .lniata-an-card-h .chart-tools, body .epr-an-card-h .chart-tools { margin-left: 6px; }
body .rev-chart-hdr > .rev-chart-title + .chart-tools, body .ab-card-h h3 + .chart-tools,
body .lniata-an-card-h h3 + .chart-tools, body .epr-an-card-h h3 + .chart-tools { margin-left: auto; }
body .cr-panel > h3 .chart-tools { margin-left: auto; }
body .chart-tools svg { width: 13px; height: 13px; color: currentColor; }
body .rev-chart-body, body .ab-card-b, body .lniata-an-card-b, body .epr-an-card-b { padding: 8px 10px; }
body .cr-chart { padding: 8px 10px; }
.chart-tools { display: inline-flex; gap: 2px; margin-left: auto; opacity: .55; transition: opacity .15s; }
.chart-card-h .sub + .chart-tools,
.chart-card-h > .chart-card-tt:has(> .sub) + .chart-tools { margin-left: 6px; }
.chart-card:hover .chart-tools, .chart-tools:focus-within { opacity: 1; }
.chart-tools button {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 1px solid transparent; border-radius: 5px; background: none; color: var(--text-muted); cursor: pointer;
}
.chart-tools button:hover { border-color: var(--border); background: var(--bg-hover, rgba(148, 163, 184, .12)); color: var(--accent); }
.chart-card-h .chart-tools svg { color: currentColor; }

html.chart-modal-open { overflow: hidden; }
.chart-modal {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 3vh 2vw;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); animation: chartModalIn .15s ease-out;
}
.chart-modal[hidden] { display: none; }
@keyframes chartModalIn { from { opacity: 0; } to { opacity: 1; } }
/* ── Expanded chart view (assets/js/app-charts.js) ─────────────────────────────────────
   Large modal on tablets/desktops; true fullscreen on phones in either orientation.
   Header: 44px | title (2 lines max) | 44px, then date range + "N / M" on their own row,
   so the title is never squeezed. Chart navigation lives in the bottom bar. */
html.chart-modal-open body .rt-bnav,
html.chart-modal-open body .rt-top { display: none !important; }
.chart-modal.cm-x { padding: 5vh 24px; background: none; backdrop-filter: none; animation: none; line-height: 1.4; }
.cm-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); opacity: 0; transition: opacity .14s ease-out; }
.cm-x .chart-modal-panel {
  position: relative; display: flex; flex-direction: column; width: min(1100px, 100%); max-height: 90vh; min-height: 0;
  background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .45); overflow: hidden; outline: none;
  opacity: 0; transform: translateY(6px); transition: opacity .14s ease-out, transform .14s ease-out;
}
.cm-x.is-on .cm-scrim { opacity: 1; }
.cm-x.is-on .chart-modal-panel { opacity: 1; transform: none; }
.cm-x .chart-modal-panel.is-drag { transition: none; }

.cm-h {
  flex-shrink: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center;
  column-gap: 8px; row-gap: 2px; padding: 12px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.cm-ib {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text-primary); cursor: pointer;
}
.cm-ib:hover { background: color-mix(in srgb, var(--text-muted) 12%, transparent); }
.cm-ib[aria-expanded="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.cm-x :is(.cm-ib, .cm-nav, .cm-dot, .cm-seg button, .cm-menu button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Header in the selected theme's colour (same variables as the sidebar and table headers). */
.cm-x .cm-h {
  background-color: var(--tbl-head-bg, #0d3a66); background-image: var(--tbl-head-grad, none);
  border-bottom-color: var(--tbl-head-line, transparent); color: var(--tbl-head-fg, #fff);
}
.cm-x .cm-h .cm-title { color: var(--tbl-head-fg, #fff); }
.cm-x .cm-h .cm-sub { color: color-mix(in srgb, var(--tbl-head-fg, #fff) 74%, transparent); }
.cm-x .cm-h .cm-pos { color: var(--tbl-head-fg, #fff); background: rgba(255, 255, 255, .16); }
.cm-x .cm-h .cm-ib { color: var(--tbl-head-fg, #fff); }
.cm-x .cm-h .cm-ib:hover, .cm-x .cm-h .cm-ib[aria-expanded="true"] { color: var(--tbl-head-fg, #fff); background: rgba(255, 255, 255, .16); }
.cm-x .cm-h .cm-ib:focus-visible { outline-color: var(--tbl-head-fg, #fff); }
.cm-title {
  min-width: 0; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--text-bright);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: break-word;
}
.cm-meta { grid-column: 2 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 24px; }
.cm-sub { min-width: 0; font-size: 13px; line-height: 1.4; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cm-sub .cm-d { white-space: nowrap; }
.cm-pos {
  flex-shrink: 0; margin-left: auto; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.5;
  color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 13%, transparent); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cm-dl { position: relative; }
.cm-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 6; min-width: 210px; padding: 6px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 32px -10px rgba(15, 23, 42, .4);
}
.cm-menu[hidden], .cm-menu-scrim[hidden] { display: none; }
.cm-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--text-primary); font: inherit; font-size: 14px; line-height: 1.4; text-align: left; cursor: pointer;
}
.cm-menu button svg { flex-shrink: 0; color: var(--accent); }
.cm-menu button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cm-menu-scrim { display: none; }

.cm-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 18px 18px; }
.cm-hint {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 4px 0 4px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.4; color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}
.cm-hint[hidden] { display: none; }
.cm-hint > svg { flex-shrink: 0; color: var(--accent); }
.cm-hint > span { flex: 1; min-width: 0; }
.cm-chart { position: relative; height: 60vh; min-height: 240px; }
.cm-chart canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.cm-chart.is-html { height: auto; min-height: 0; }
.cm-chart .chart-funnel { max-width: 720px; margin: 0 auto; gap: 16px; }
.cm-chart .chart-funnel .row { grid-template-columns: 120px 1fr 90px; font-size: 13px; }
.cm-chart .chart-funnel .bar { height: 24px; }
.cm-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; padding: 24px; text-align: center; font-size: 13px; color: var(--text-muted); }
.cm-state strong { font-size: 15px; color: var(--text-primary); }
.cm-state.is-err strong { color: var(--danger); }
.cm-state .btn { min-height: 44px; padding: 0 18px; }

.cm-seg { display: inline-flex; gap: 2px; margin: 14px 0 8px; padding: 3px; border-radius: 10px; background: var(--bg-input); border: 1px solid var(--border); }
.cm-seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--text-muted);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.4; cursor: pointer;
}
.cm-seg button[aria-pressed="true"] { background: var(--bg-card); color: var(--text-bright); box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 2px 6px -2px rgba(15, 23, 42, .16); }
.cm-x.is-table .cm-chart, .cm-x.is-table .cm-hint { display: none; }
.cm-x.is-table .cm-seg { margin-top: 0; }
.cm-x.no-data .cm-seg, .cm-x.no-data .cm-data { display: none; }

.cm-tbl-wrap {
  max-height: max(260px, calc(var(--cm-avail, 70vh) - 72px)); overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card);
}
.chart-modal-tbl { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.chart-modal-tbl th, .chart-modal-tbl td {
  height: 44px; padding: 0 12px; text-align: right !important; white-space: nowrap; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.chart-modal-tbl thead th {
  position: sticky; top: 0; z-index: 2; height: 40px; font-size: 11.5px; font-weight: 700;
  color: var(--tbl-head-fg, var(--text-muted)); background-color: var(--tbl-head-bg, var(--bg-card)); border-bottom-color: var(--tbl-head-line, var(--border));
}
.chart-modal-tbl :is(th, td):first-child { text-align: left !important; }
.chart-modal-tbl .cm-lbl { font-weight: 600; color: var(--text-primary); }
.chart-modal-tbl .cm-sum td { height: 36px; font-weight: 700; color: var(--text-bright); background: color-mix(in srgb, var(--accent) 8%, var(--bg-card)); }
.chart-modal-tbl .cm-sum td.cm-lbl { color: var(--text-muted); font-size: 12px; }
.chart-modal-tbl .cm-sum tr:last-child td { border-bottom: 2px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.chart-modal-tbl .cm-rows tr { cursor: pointer; }
.chart-modal-tbl .cm-rows tr:nth-child(even) td { background: color-mix(in srgb, var(--text-muted) 4%, var(--bg-card)); }
.chart-modal-tbl .cm-rows tr:hover td { background: color-mix(in srgb, var(--accent) 7%, var(--bg-card)); }
.chart-modal-tbl .cm-rows tr.is-on td { background: color-mix(in srgb, var(--accent) 17%, var(--bg-card)); }
.chart-modal-tbl .cm-rows tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.chart-modal-tbl .cm-rows tr:last-child td { border-bottom: 0; }
.chart-modal-tbl.cm-wide :is(th, td):first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--border); }
.chart-modal-tbl.cm-wide thead th:first-child { z-index: 3; }

.cm-sk { border-radius: 8px; background: color-mix(in srgb, var(--text-muted) 13%, transparent); animation: cmSk 1.1s ease-in-out infinite alternate; }
.cm-sk-chart { height: 100%; }
.cm-sk-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cm-sk-row { height: 36px; }
@keyframes cmSk { from { opacity: .55; } to { opacity: 1; } }

.cm-foot {
  flex-shrink: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg-card); border-top: 1px solid var(--border);
}
.cm-foot[hidden] { display: none; }
.cm-nav {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-input); color: var(--text-primary);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.4; cursor: pointer;
}
.cm-nav > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-nav > svg { flex-shrink: 0; }
.cm-prev { justify-self: start; }
.cm-next { justify-self: end; }
.cm-nav:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.cm-nav:disabled { cursor: default; color: var(--text-muted); background: transparent; border-style: dashed; }
.cm-dots { display: flex; align-items: center; justify-content: center; }
.cm-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.cm-dot::before { content: ""; width: 7px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--text-muted) 45%, transparent); transition: width .2s ease-out, background-color .2s; }
.cm-dot[aria-current="true"]::before { width: 18px; background: var(--accent); }
.cm-dots-n { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Phones (and short landscape screens): fullscreen, safe areas, download menu as a bottom sheet */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  .chart-modal.cm-x { padding: 0; align-items: stretch; }
  .cm-x .cm-scrim { display: none; }
  .cm-x .chart-modal-panel {
    width: 100%; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none; transform: scale(.98);
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  }
  .cm-h { padding: calc(8px + env(safe-area-inset-top)) 12px 10px; column-gap: 6px; }
  .cm-scroll { padding: 12px 12px 16px; }
  .cm-chart { height: min(60dvh, 420px); min-height: 220px; }
  .cm-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .cm-menu-scrim { display: block; position: fixed; inset: 0; z-index: 5; background: rgba(15, 23, 42, .4); }
  .cm-menu {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; min-width: 0;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; border-bottom: 0;
  }
  .cm-menu button { min-height: 52px; font-size: 16px; }
  .cm-tbl-wrap { border-radius: 8px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .cm-h { row-gap: 0; padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  .cm-title { -webkit-line-clamp: 1; line-clamp: 1; font-size: 16px; }
  .cm-scroll { padding-top: 8px; }
  .cm-chart { height: calc(var(--cm-avail, 100dvh) - 20px); min-height: 160px; }
  .cm-foot { padding-top: 2px; padding-bottom: calc(2px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .cm-x .chart-modal-panel, .cm-scrim, .cm-dot::before { transition: none; }
  .cm-sk { animation: none; }
}
@media (max-width: 1200px) {
  .chart-card, .chart-card.w3, .chart-card.w5, .chart-card.pair { grid-column: span 6; }
  .chart-card.w7, .chart-card.w8:not(.pair) { grid-column: span 12; }
}
@media (max-width: 768px) {
  .kpi-cards { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  .chart-card, .chart-card.w3, .chart-card.w5, .chart-card.w6, .chart-card.pair { grid-column: span 12; }
}

/* ══ Brand shell — Lao Airlines navy / sky / gold, shared with the login page ══════════
   Applies to the airline-blue themes (Light Clean, Calm Mist, Dark Ocean); the green,
   purple and solarized themes keep their own identity. */
html:not([data-theme]),
html[data-theme="light"],
html[data-theme="calm"],
html[data-theme="dark-blue"] {
  --brand-navy-900: #0a2747;
  --brand-navy-800: #0d3a66;
  --brand-navy-700: #0b5c92;
  --brand-sky:      #5bc0eb;
  --brand-gold:     #d4a64a;
  --brand-gold-lt:  #f1c873;
  --brand-ink-lt:   #9fc3e4;
  --brand-ink:      #b9d2ea;
}
/* table headers take each theme's sidebar colour */
html:not([data-theme]),
html[data-theme="light"],
html[data-theme="calm"],
html[data-theme="dark-blue"] {
  --tbl-head-bg:   #0d3a66;
  --tbl-head-fg:   #ffffff;
  --tbl-head-line: #0a2747;
  --tbl-head-grad: linear-gradient(172deg, #0a2747 0%, #0d3a66 58%, #0b4f80 100%);
}
html[data-theme="dark-green"] {
  --tbl-head-bg:   #14432a;
  --tbl-head-fg:   #e0ffe8;
  --tbl-head-line: #0b2617;
  --tbl-head-grad: linear-gradient(172deg, #0b2617 0%, #14432a 58%, #1a5535 100%);
}
html[data-theme="dark-purple"] {
  --tbl-head-bg:   #34175a;
  --tbl-head-fg:   #f5f3ff;
  --tbl-head-line: #1f0b38;
  --tbl-head-grad: linear-gradient(172deg, #1f0b38 0%, #34175a 58%, #45207a 100%);
}
html[data-theme="solarized"] {
  --tbl-head-bg:   #0d4f5f;
  --tbl-head-fg:   #eee8d5;
  --tbl-head-line: #00303b;
  --tbl-head-grad: linear-gradient(172deg, #00303b 0%, #0d4f5f 58%, #12606f 100%);
}

/* Header cells paint the gradient themselves: sticky cells must stay opaque,
   so it cannot sit on the row behind transparent cells. :not(#\0) lifts specificity
   above the many `... th { background: ... !important }` shorthands that reset images. */
thead th:not(#\0),
.ab-table th:not(#\0),
.fo-st th:not(#\0),
.epr-an-table th:not(#\0),
.lniata-an-table th:not(#\0),
.chart-modal-tbl thead th:not(#\0),
.um-evt th:not(#\0),
#emd-sales-table thead tr.emd-h1 th:not(#\0) {
  background-image: var(--tbl-head-grad, none) !important;
}
#emd-sales-table thead tr.emd-h2 th,
#emd-sales-table thead tr.emd-h3 th {
  background-image: none !important;
}
html[data-theme="light"] {
  --bg-primary: #eef3f9;
  --border:     #d5dfeb;
  --shadow:     0 1px 2px rgba(10, 39, 71, .05), 0 10px 26px -16px rgba(10, 39, 71, .28);
  --topbar-bg:  rgba(255, 255, 255, .86);
}
html[data-theme="calm"] {
  --topbar-bg: rgba(249, 251, 253, .86);
}

/* page canvas: same soft sky/gold glow as body.auth-page */
html[data-theme="light"] body,
html[data-theme="calm"] body {
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 70% 55% at 15% 0%, rgba(11, 92, 146, .10), transparent 70%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(212, 166, 74, .09), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 320px);
  background-attachment: fixed;
}
html:not([data-theme]) body,
html[data-theme="dark-blue"] body {
  background-image:
    radial-gradient(ellipse 70% 55% at 15% 0%, rgba(91, 192, 235, .08), transparent 70%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(212, 166, 74, .06), transparent 70%);
  background-attachment: fixed;
}

/* topbar: frosted glass with the brand hairline underneath */
html[data-theme="light"] .topbar,
html[data-theme="calm"] .topbar {
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(10, 39, 71, .08);
  box-shadow: 0 8px 22px -18px rgba(10, 39, 71, .45);
}
html:not([data-theme]) .topbar::after,
html[data-theme="light"] .topbar::after,
html[data-theme="calm"] .topbar::after,
html[data-theme="dark-blue"] .topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--brand-navy-700) 0%, var(--brand-sky) 45%, var(--brand-gold) 100%);
  opacity: .55;
}


/* ── System lock notice ─────────────────────────────────────── */
.syslock-card{margin:0 0 16px;padding:14px 14px 12px;border-radius:14px;background:linear-gradient(180deg,#fff8ef,#fff3e3);border:1px solid #f6cf9c;box-shadow:0 6px 18px rgba(217,119,6,.10);color:#5b3a12;text-align:left}
.syslock-head{display:flex;align-items:center;gap:12px}
.syslock-ico{flex:0 0 40px;width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:#fde5c4;color:#c2600a;border:1px solid #f8d2a0}
.syslock-head-txt{min-width:0}
.syslock-title{font-size:15px;font-weight:800;color:#7a3d06;line-height:1.3}
.syslock-sub{display:flex;align-items:center;gap:5px;margin-top:2px;font-size:12px;font-weight:600;color:#c2600a;line-height:1.35}
.syslock-sub svg{flex:0 0 auto}
.syslock-msg{margin:12px 0 0;font-size:13px;line-height:1.5;color:#5b3a12;white-space:normal;word-break:break-word}
.syslock-link{margin-top:10px;display:flex;align-items:center;gap:10px;padding:10px 10px 10px 12px;border-radius:11px;background:#fff;border:1px solid #f1d7b4}
.syslock-link-ico{flex:0 0 auto;color:#c2600a;display:flex}
.syslock-url{flex:1 1 auto;min-width:0;font-size:12.5px;line-height:1.4;color:#334155;text-decoration:none;word-break:break-all}
.syslock-url:hover{text-decoration:underline}
.syslock-copy{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border:0;border-radius:9px;background:#d97706;color:#fff;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;box-shadow:0 3px 10px rgba(217,119,6,.28);transition:background .15s,transform .1s}
.syslock-copy:hover{background:#c2600a}
.syslock-copy:active{transform:translateY(1px)}
.syslock-copy.is-done{background:#16a34a;box-shadow:0 3px 10px rgba(22,163,74,.28)}
[data-theme^="dark"] .syslock-card{background:linear-gradient(180deg,#2a1f12,#241a0f);border-color:#6b4615;color:#f3dcc0}
[data-theme^="dark"] .syslock-title{color:#fcd9a8}
[data-theme^="dark"] .syslock-sub,[data-theme^="dark"] .syslock-link-ico{color:#f5a54a}
[data-theme^="dark"] .syslock-ico{background:#3d2a12;border-color:#6b4615;color:#f5a54a}
[data-theme^="dark"] .syslock-msg{color:#f3dcc0}
[data-theme^="dark"] .syslock-link{background:#1b1510;border-color:#5a3c14}
[data-theme^="dark"] .syslock-url{color:#e2e8f0}

/* System status panel (user management) */
.syslock-panel{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 12px;padding:12px 14px;border-radius:12px;background:var(--bg-card,#fff);border:1px solid var(--border,#e5e7eb)}
.syslock-panel.is-closed{border-color:#f6cf9c;background:linear-gradient(90deg,#fff8ef,var(--bg-card,#fff))}
.syslock-panel-txt{flex:1 1 260px;min-width:0}
.syslock-panel-title{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:750;color:var(--text-primary,#0f172a)}
.syslock-panel-meta{margin-top:3px;font-size:12px;color:var(--text-muted,#64748b)}
.syslock-pill{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:999px;font-size:11.5px;font-weight:700}
.syslock-pill::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.syslock-pill--open{background:#dcfce7;color:#15803d}
.syslock-pill--closed{background:#ffedd5;color:#c2410c}
.btn-syslock-close{background:#dc2626;border-color:#dc2626;color:#fff}
.btn-syslock-close:hover{background:#b91c1c;border-color:#b91c1c;color:#fff}
.btn-syslock-open{background:#16a34a;border-color:#16a34a;color:#fff}
.btn-syslock-open:hover{background:#15803d;border-color:#15803d;color:#fff}
#sysLockModal .syslock-card{margin:4px 0 0}
#sysLockModal .sl-label{display:block;font-size:12px;font-weight:700;margin:0 0 5px;color:var(--text-secondary,#334155)}
#sysLockModal textarea,#sysLockModal #slLink{width:100%;box-sizing:border-box}
#sysLockModal .sl-field{margin-bottom:12px}
#sysLockModal .sl-hint{font-size:11.5px;color:var(--text-muted,#64748b);margin-top:4px}

/* ── Standard back button (backButton() in includes/config.php) ── */
html a.btn-back {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 5px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-bright);
  font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06); transition: border-color .15s, box-shadow .15s, color .15s, background .15s;
}
html a.btn-back .btn-back-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); transition: background .15s, color .15s, transform .15s;
}
html a.btn-back .btn-back-ico svg { display: block; }
html a.btn-back .btn-back-txt { overflow: hidden; text-overflow: ellipsis; }
html a.btn-back:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--accent); text-decoration: none;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 18%, transparent); }
html a.btn-back:hover .btn-back-ico { background: var(--accent); color: #fff; transform: translateX(-2px); }
html a.btn-back:active .btn-back-ico { transform: translateX(-3px) scale(.94); }
html a.btn-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html a.btn-back--dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #e6eef8; box-shadow: none; }
html a.btn-back--dark .btn-back-ico { background: rgba(255, 255, 255, .14); color: #fff; }
html a.btn-back--dark:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .42); color: #fff; box-shadow: none; }
html a.btn-back--dark:hover .btn-back-ico { background: #f3dc8a; color: #0b2a4a; }
html a.btn-back--block { display: flex; width: 100%; justify-content: center; height: 42px; border-radius: 10px; }
@media print { html a.btn-back { display: none !important; } }

/* Report KPI strips: same tiles in every module (Ancillary Report style) — centred, label on top,
   large value, tone bar on the top edge. Phones keep their own stacked layout (responsive.css). */
@media (min-width: 761px) {
  html body :is(.bcc-chrome-kpis, .mtr-chrome-kpis, .cr-chips) { justify-content: center !important; gap: 8px; }
  html body :is(.bcc-chrome-kpis > .bcc-chip, .mtr-chrome-kpis .mtr-kstat, .mtr-chrome-kpis .mtr-chip, .cr-chips > .cr-chip, .ab-chips > .ab-chip).kpi-board {
    position: relative; overflow: hidden; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    min-width: 120px; padding: 5px 14px 4px; border-radius: 10px; text-align: center; line-height: 1.15;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), inset 0 1px 0 color-mix(in srgb, var(--kpi-c) 8%, transparent);
  }
  html body .ab-chips > .ab-chip.kpi-board { min-width: 0; }
  html body .mtr-chrome-kpis .mtr-kstat:not(.kpi-board), html body .mtr-chrome-kpis .mtr-chips { display: contents; }
  html body :is(.bcc-chrome-kpis > .bcc-chip, .mtr-chrome-kpis .mtr-kstat, .mtr-chrome-kpis .mtr-chip, .cr-chips > .cr-chip, .ab-chips > .ab-chip).kpi-board::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--kpi-c, var(--accent)); opacity: .85;
  }
  html body .kpi-board:is(.bcc-chip, .mtr-kstat, .mtr-chip, .cr-chip, .ab-chip) :is(.bcc-chip-k, .mtr-kstat-lbl, .mtr-chip-k, .k) {
    font-size: 11px; font-weight: 650; letter-spacing: .1px; text-transform: none; white-space: nowrap; line-height: 1.25;
  }
  html body .kpi-board:is(.bcc-chip, .mtr-kstat, .mtr-chip, .cr-chip, .ab-chip) :is(.bcc-chip-v, .mtr-kstat-val, .mtr-chip-v, .v) {
    font-size: 17px; font-weight: 800; line-height: 1.15; letter-spacing: -.2px; white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  html body .kpi-board:is(.bcc-chip, .ab-chip) :is(.bcc-chip-v, .v) small { font-size: 12px; }
  html body .kpi-board.ab-chip .s { font-size: 10.5px; }
  html body .kpi-strip:not(.kpi-ssr-compact) > .kpi-item {
    position: relative; overflow: hidden; gap: 1px; min-width: 120px; padding: 5px 14px 4px; border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), inset 0 1px 0 color-mix(in srgb, var(--kpi-c) 8%, transparent);
  }
  html body .kpi-strip:not(.kpi-ssr-compact) > .kpi-item::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--kpi-c, var(--accent)); opacity: .85;
  }
  html body .kpi-strip:not(.kpi-ssr-compact) > .kpi-item .kpi-label {
    font-size: 11px; font-weight: 650; letter-spacing: .1px; text-transform: none; white-space: nowrap; line-height: 1.25;
  }
  html body .kpi-strip:not(.kpi-ssr-compact) > .kpi-item .kpi-val { font-size: 17px; font-weight: 800; line-height: 1.15; letter-spacing: -.2px; }
  html body .kpi-strip:not(.kpi-ssr-compact) > .kpi-item .kpi-sub { font-size: 10.5px; line-height: 1.25; white-space: nowrap; margin-top: 0; }
}

/* Table headers: one readable size in every module (same as the Ancillary Report).
   EMD Sales keeps its own two-row header — its second row is pinned at a fixed offset. */
html body table:not(#emd-sales-table) thead th:not(#\0) {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
}

/* Searchable select (assets/js/select-search.js) */
.ss-wrap { position: relative; width: 100%; min-width: 0; }
.ss-wrap > select.ss-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; }
.ss-btn { display: flex; align-items: center; gap: 4px; width: 100%; height: 26px; min-height: 0; padding: 0 20px 0 6px; font: inherit; font-size: 11px; text-align: left;
  color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border); border-radius: 5px; cursor: pointer; position: relative; box-sizing: border-box; }
.ss-btn::after { content: ""; position: absolute; right: 7px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid var(--text-muted); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.ss-btn:focus-visible, .ss-open .ss-btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent); }
.ss-btn.ss-has-value { font-weight: 650; color: var(--text-bright); }
.ss-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-pop { position: absolute; z-index: 60; top: calc(100% + 3px); left: 0; min-width: 100%; width: max-content; max-width: min(320px, 92vw);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(15, 23, 42, .18); padding: 5px; box-sizing: border-box; }
.ss-pop.ss-up { top: auto; bottom: calc(100% + 3px); }
.ss-input { width: 100%; height: 28px; padding: 0 8px; font: inherit; font-size: 12px; box-sizing: border-box; color: var(--text-primary);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; outline: none; }
.ss-input:focus { border-color: var(--accent); }
.ss-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 240px; overflow: auto; overscroll-behavior: contain; }
.ss-opt { padding: 5px 8px; font-size: 12px; border-radius: 5px; cursor: pointer; white-space: nowrap; color: var(--text-primary); }
.ss-opt.ss-act { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text-bright); }
.ss-opt.ss-sel { font-weight: 700; color: var(--accent); }
.ss-empty { padding: 8px; font-size: 11.5px; color: var(--text-muted); text-align: center; }
/* Multiple: tick list + clear */
.ss-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; padding: 0 2px 0 4px; font-size: 11px; color: var(--text-muted); }
.ss-count { font-weight: 650; }
.ss-multi .ss-has-value ~ .ss-pop .ss-count { color: var(--accent); }
.ss-clear { min-height: 0; height: 22px; padding: 0 8px; font: inherit; font-size: 11px; font-weight: 600; color: var(--text-muted); background: transparent; border: 1px solid var(--border); border-radius: 5px; cursor: pointer; }
.ss-clear:hover { color: var(--accent); border-color: var(--accent); }
.ss-opt.ss-check { position: relative; padding-left: 28px; }
.ss-opt.ss-check::before { content: ""; position: absolute; left: 8px; top: 50%; width: 13px; height: 13px; margin-top: -7.5px; box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, var(--text-muted) 70%, transparent); border-radius: 3px; background: var(--bg-input); }
.ss-opt.ss-check.ss-sel { font-weight: 600; color: var(--text-bright); }
.ss-opt.ss-check.ss-sel::before { border-color: var(--accent); background: var(--accent); }
.ss-opt.ss-check.ss-sel::after { content: ""; position: absolute; left: 12.5px; top: 50%; width: 3.5px; height: 7px; margin-top: -5.5px; border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
@media (max-width: 640px) {
  .ss-btn { height: 36px; font-size: 14px; } .ss-input { height: 36px; font-size: 16px; } .ss-opt { padding: 9px 10px; font-size: 14px; }
  .ss-opt.ss-check { padding-left: 32px; } .ss-clear { height: 30px; font-size: 13px; }
}

/* Dense desktop layout: more table rows on screen in every module. Same components and
   colours, less padding around the table (title bar, pager, filter panels, KPI strips).
   Phones keep their own layout (responsive.css). */
@media (min-width: 761px) {
  html body .card:is(.tbl-panel, .tbl-doc) > .card-header { padding: 4px 12px; min-height: 0; }
  html body .card:is(.tbl-panel, .tbl-doc) > .card-header h3 { line-height: 1.3; margin: 0; }
  html body .card:is(.tbl-panel, .tbl-doc) > .card-header :is(.btn, .form-input, select, input:not([type="checkbox"]):not([type="radio"])) { height: 28px; min-height: 0; }
  html body .card:is(.tbl-panel, .tbl-doc) > .card-header .tbl-meta { padding-top: 3px; padding-bottom: 3px; line-height: 1.3; }
  html body .tbl-footer.tbl-pager-bar { padding: 4px 12px; min-height: 0; }
  html body .tbl-pager-bar :is(.tbl-pager-size-select, .page-btn) { height: 28px; min-height: 0; }
  html body .tbl-pager-bar .page-btn { min-width: 28px; }
  html body .fp { padding: 6px 12px; margin-bottom: 6px; }
  html body .fp-g { gap: 2px; }
  html body .list-chrome .kpi-strip { padding: 5px 10px; }
  html body .list-chrome .kpi-strip > .kpi-item { padding: 4px 14px 3px; }
  html body .content > .kpi-strip { padding-top: 0; padding-bottom: 4px; }
  /* Buttons keep the height their own class gives (the 34px touch minimum is for phones). */
  html body .btn { min-height: 0; }
  html body .bcc-fg label { margin-bottom: 0; line-height: 1.3; }
  html body .list-filter-row { min-height: 0; }
  html body :is(.bcc-chrome-right, .page-toolbar-actions, .card-header-actions, .mtr-chrome-right, .list-filter-row) > .export-wrap { display: flex; align-items: center; }
  html body .bcc-chrome-nav { min-height: 0; }
  html body :is(.pr-stack, .anc-stack, .bcc-tables-stack) > .card { margin-bottom: 0; }
  /* Icon KPI cards (EPR, LNIATA, …): icon beside the figures instead of above them. */
  html body :is(.page-kpi-card, .epr-kpi-card, .epr-app-kpi-card) {
    flex-direction: row; justify-content: center; align-items: center; gap: 10px; padding: 6px 12px; text-align: left;
  }
  html body :is(.page-kpi-card, .epr-kpi-card, .epr-app-kpi-card) > :last-child { width: auto; min-width: 0; text-align: left; }
  html body :is(.page-kpi, .epr-kpi) { gap: 8px; margin-bottom: 6px; }
  html body .epr-app-kpi { gap: 8px; }
  html body :is(.page-kpi-val, .epr-kpi-val, .epr-app-kpi-card .num) { font-size: 19px; }
  /* EPR module panels */
  html body .epr-filter { padding: 8px 12px; margin-bottom: 6px; }
  html body .epr-filter-row + .epr-filter-row { margin-top: 6px; padding-top: 6px; }
  html body .epr-filter-actions { margin-top: 6px; padding-top: 6px; }
  html body :is(.epr-filter-actions, .epr-app-filter-actions, .lniata-filter-bar-actions, .epr-app-share) .btn { height: 30px; min-height: 0; }
  html body .epr-app-dashboard { gap: 6px; }
  html body .epr-app-share { padding: 6px 12px; }
  html body .epr-app-share input { height: 30px; }
  html body .epr-app-status-nav-head { padding: 5px 12px; }
  html body .epr-app-status-scroll { padding: 6px 10px; }
  html body .epr-app-toolbar-card { padding: 8px 12px; }
}

/* Dashboard / analytics entrance (assets/js/dash-motion.js) — same as the Executive Overview:
   tiles and panels rise in one after another, fill bars grow. Reduced motion: fade only. */
.dm-in { animation: dmUp .5s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes dmUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dmFade { from { opacity: 0; } to { opacity: 1; } }
.dm-bar { transition: width .9s cubic-bezier(.22, 1, .36, 1); }
@media (prefers-reduced-motion: reduce) { .dm-in { animation-name: dmFade; } }
@media print { .dm-in { animation: none !important; } }

/* Tab icons: the same 14px size and alignment in every module. */
:is(.view-tab, .rpt-tab, .val-tabs > a, .apx-tab, .ak-tab, .upload-mode-btn, .batch-source-btn, .sabre-source-btn) > svg {
  width: 14px; height: 14px; flex-shrink: 0; vertical-align: -2px;
}
.val-tabs > a { display: inline-flex; align-items: center; gap: 6px; }

/* Detail pop-up (assets/js/detail-sheet.js): click a chart point, KPI tile or dashboard row.
   Header in the theme colour like the expanded chart view; bottom sheet on phones. */
:is(.kpi-cards > .kpi-card, .kpi-strip > .kpi-item, .ex-head .ex-m, .bcc-chrome-kpis .bcc-chip, .mtr-chrome-kpis .mtr-chip,
  .mtr-chrome-kpis .mtr-kstat.kpi-board, .cr-chips > .cr-chip, .ab-chips > .ab-chip, .page-kpi > .page-kpi-card, .epr-kpi > .epr-kpi-card,
  .chart-funnel .row, .ex-fwd-row, .ex-flag):not(a):not([onclick]) { cursor: pointer; }
:is(.kpi-cards > .kpi-card, .kpi-strip > .kpi-item, .ex-head .ex-m, .bcc-chrome-kpis .bcc-chip, .mtr-chrome-kpis .mtr-chip,
  .page-kpi > .page-kpi-card, .epr-kpi > .epr-kpi-card):not(a):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
:is(.chart-card, .rev-chart-card, .cr-panel, .ab-card, .lniata-an-card, .epr-an-card, .ex-board, .dash-tbl) table tbody tr { cursor: pointer; }
:is(.chart-funnel .row, .ex-fwd-row, .ex-flag):hover { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 6px; }
html.ds-open, html.ds-open body { overflow: hidden; }
.ds-x { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 6vh 20px; line-height: 1.4; }
.ds-x[hidden] { display: none; }
.ds-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); opacity: 0; transition: opacity .14s ease-out; }
.ds-panel {
  position: relative; display: flex; flex-direction: column; width: min(560px, 100%); max-height: 88vh; min-height: 0;
  background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; outline: none;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .45); opacity: 0; transform: translateY(8px) scale(.99); transition: opacity .14s ease-out, transform .14s ease-out;
}
.ds-x.is-on .ds-scrim { opacity: 1; }
.ds-x.is-on .ds-panel { opacity: 1; transform: none; }
.ds-h {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 18px;
  background-color: var(--tbl-head-bg, #0d3a66); background-image: var(--tbl-head-grad, none); color: var(--tbl-head-fg, #fff);
  border-bottom: 1px solid var(--tbl-head-line, transparent);
}
.ds-ht { flex: 1; min-width: 0; }
.ds-title { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.35; color: inherit; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ds-sub { margin: 2px 0 0; font-size: 12px; color: color-mix(in srgb, var(--tbl-head-fg, #fff) 76%, transparent); overflow-wrap: anywhere; }
.ds-pos { flex-shrink: 0; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .16); }
.ds-ib { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 0; padding: 0;
  border: 0; border-radius: 9px; background: none; color: inherit; cursor: pointer; }
.ds-ib:hover { background: rgba(255, 255, 255, .16); }
.ds-ib:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.ds-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 18px 6px; }
.ds-hero { --ds-c: var(--accent); display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--ds-c) 12%, var(--bg-card)), var(--bg-card) 80%);
  border: 1px solid color-mix(in srgb, var(--ds-c) 26%, var(--border)); }
.ds-hero-l { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--text-muted); }
.ds-hero-l i { width: 9px; height: 9px; border-radius: 3px; background: var(--ds-c); flex: none; }
.ds-hero-v { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.3px; color: var(--ds-c); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ds-hero-n { font-size: 12px; color: var(--text-muted); }
.ds-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ds-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-input); min-width: 0; }
.ds-stat .l { font-size: 10.5px; font-weight: 650; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-stat .v { font-size: 15px; font-weight: 800; color: var(--text-bright); font-variant-numeric: tabular-nums; }
.ds-stat .v.is-up { color: #16a34a; }
.ds-stat .v.is-down { color: #dc2626; }
.ds-about { margin: 0 0 12px; padding: 8px 10px; font-size: 12px; color: var(--text-muted); border-left: 3px solid var(--accent); background: var(--bg-input); border-radius: 0 8px 8px 0; }
.ds-sec { margin-bottom: 12px; }
.ds-sec h3 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--text-muted); }
html[lang="lo"] .ds-sec h3 { text-transform: none; letter-spacing: 0; font-size: 12px; }
.ds-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.ds-lines li { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; background: var(--bg-input); font-variant-numeric: tabular-nums; }
.ds-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ds-tbl th, .ds-tbl td { padding: 7px 10px !important; border-bottom: 1px solid var(--border); text-align: left; font-weight: 500; vertical-align: top; }
.ds-tbl tr:last-child > * { border-bottom: 0; }
.ds-tbl th { color: var(--text-muted); width: 46%; overflow-wrap: anywhere; }
.ds-tbl th i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 3px; vertical-align: 0; }
.ds-tbl td { color: var(--text-bright); font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ds-tbl td.ds-x2 { width: 64px; color: var(--text-muted); font-weight: 600; }
.ds-tbl tr.is-cur > * { background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--text-bright); }
.ds-tbl tr.is-cur th { font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.ds-foot { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg-card); }
.ds-acts { flex: 1; display: flex; justify-content: center; gap: 8px; min-width: 0; }
.ds-nav { display: inline-flex; align-items: center; gap: 4px; height: 32px; min-height: 0; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--text-muted); background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.ds-nav:hover { color: var(--accent); border-color: var(--accent); }
.ds-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .ds-x { align-items: flex-end; padding: 0; }
  .ds-panel { width: 100%; max-height: 86vh; border-radius: 16px 16px 0 0; border-bottom: 0; transform: translateY(24px);
    padding-bottom: env(safe-area-inset-bottom, 0); }
  .ds-nav span { display: none; }
  .ds-nav { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .ds-hero-v { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .ds-panel, .ds-scrim { transition: none; } }
@media print { .ds-x { display: none !important; } }
