/* ── SENTINEL DESIGN LANGUAGE TOKENS (light, default) ── */
:root {
  /* Page & surface */
  --bg: #ffffff;
  --surface: #f4f6fb;
  --surface2: #eef1f8;
  --surface3: #e9edf6;
  --text: #0f172a;
  --muted: #334155;
  --faint: #64748b;
  --border: rgba(15, 23, 42, 0.10);
  --sidebar-bg: #0b0d12;
  --topbar-bg: transparent;
  --card-bg: #f5f6fb;
  --input-bg: #ffffff;
  /* Sentinel two-layer shadow: lift drop + inverse edge glow */
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08), 0 0 18px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.11), 0 0 22px rgba(15, 23, 42, 0.11);
  /* Brand */
  --accent: #0325bd;
  --accent2: #1530c4;
  --accent-lt: rgba(3, 37, 189, 0.08);
  --accent-md: rgba(3, 37, 189, 0.15);
  --at: #0325bd;
  /* Semantic */
  --r: #ef4444;
  --r-lt: rgba(239, 68, 68, 0.10);
  --g: #22d3a5;
  --g-lt: rgba(34, 211, 165, 0.10);
  --amber: #f5c542;
  --amber-lt: rgba(245, 197, 66, 0.10);
  --sky: #06b6d4;
  --sky-lt: rgba(6, 182, 212, 0.10);
  --purple: #a855f7;
  --purple-lt: rgba(168, 85, 247, 0.10);
  --steel: #475569;
  --steel-lt: rgba(71, 85, 105, 0.10);
  /* Soft-card surface system (light) */
  --card: #f5f6fb;
  --card-hi: #eef1f8;
  --card-fill: #eaeef7;
  --card-fill-hi: #e1e7f3;
  --card-border: rgba(15, 23, 42, 0.14);
  --card-border-hi: rgba(3, 37, 189, 0.30);
  --card-shadow: 0 4px 20px rgba(15, 23, 42, 0.08), 0 0 18px rgba(15, 23, 42, 0.08);
  --card-shadow-hi: 0 10px 28px rgba(15, 23, 42, 0.11), 0 0 22px rgba(15, 23, 42, 0.11);
  /* Radius */
  --radius: 16px;
  --radius-lg: 20px;
}

/* ── SENTINEL DARK THEME ── */
[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #141720;
  --surface2: #191d28;
  --surface3: #1e2230;
  --text: #eef0f8;
  --muted: #9aa0bc;
  --faint: #5a6080;
  --border: rgba(255, 255, 255, 0.07);
  --sidebar-bg: #0b0d12;
  --topbar-bg: transparent;
  --card-bg: #141720;
  --input-bg: #0f1117;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.30), 0 0 18px rgba(255, 255, 255, 0.06);
  --shadow-md: 0 10px 34px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 255, 255, 0.10);
  --accent-lt: rgba(3, 37, 189, 0.15);
  --accent-md: rgba(3, 37, 189, 0.25);
  --at: #c5c9f0;
  --r-lt: rgba(239, 68, 68, 0.12);
  --g-lt: rgba(34, 211, 165, 0.12);
  --amber-lt: rgba(245, 197, 66, 0.12);
  --sky-lt: rgba(6, 182, 212, 0.12);
  --purple-lt: rgba(168, 85, 247, 0.12);
  --steel-lt: rgba(71, 85, 105, 0.12);
  /* Soft-card surface system (dark) */
  --card: #141720;
  --card-hi: #191d28;
  --card-fill: #1b1f2b;
  --card-fill-hi: #232838;
  --card-border: rgba(255, 255, 255, 0.10);
  --card-border-hi: rgba(255, 255, 255, 0.18);
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.30), 0 0 18px rgba(255, 255, 255, 0.06);
  --card-shadow-hi: 0 10px 34px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 255, 255, 0.10);
}

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

html,
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: background .3s, color .3s;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR — always dark, floating chrome ── */
.sidebar {
  width: 62px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, .07);
  z-index: 2;
}

.sl {
  padding: 14px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1);
}


.app-name {
  display: none;
  font-family: 'Nunito', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.side-close {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.2s;
}

.side-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

nav {
  padding: 10px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 100%;
}

.ni {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  /* color: rgba(255, 255, 255, .35); */
  position: relative;
  overflow: visible;
}

.ni:hover {
  background: rgba(255, 255, 255, .07);
  /* color: rgba(255, 255, 255, .8); */
}

.ni.on {
  background: var(--accent);
  color: #fff;
}

.ni svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.tip {
  display: none;
}

.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  /* color: rgba(255, 255, 255, .35); */
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, .07);
  /* color: rgba(255, 255, 255, .8); */
}

[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon {
  display: block !important;
}

[data-theme="light"] .theme-toggle .sun {
  display: block !important;
}

[data-theme="light"] .theme-toggle .moon {
  display: none;
}

.tt-circle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-circle svg {
  width: 20px;
  height: 20px;
}

.nsep {
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, .07);
  margin: 4px 0;
}

.sb-bot {
  padding: 10px 0 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--steel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .15);
}

.ib-s {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, .3);
  transition: all .15s;
  position: relative;
}

.ib-s:hover {
  background: rgba(255, 59, 48, .15);
  color: var(--r);
}

.ib-s svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

/* â”€â”€ MAIN â”€â”€ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Floating chrome — no bg, no border, floats over topology */
.topbar {
  background: transparent;
  border-bottom: none;
  padding: 0 22px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ptitle {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pcrumb {
  font-size: 11px;
  color: var(--faint);
  font-weight: 500;
}

.pcrumb b {
  color: var(--accent);
  font-weight: 700;
}

.tbar-left {
  display: flex;
  flex-direction: column;
}

.tbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 6px 12px;
  width: 230px;
  transition: all .15s;
}

.sbar:focus-within {
  border-color: var(--accent);
  background: var(--input-bg);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

.sbar svg {
  width: 14px;
  height: 14px;
  color: var(--faint);
  flex-shrink: 0;
  stroke-width: 1.8;
}

.sbar input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  width: 100%;
}

.sbar input::placeholder {
  color: var(--faint);
  font-weight: 400;
}

.ib {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--muted);
  position: relative;
}

.ib:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ib svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.tw table thead th { position: relative; transition: background .2s, color .2s, border-bottom .2s; }
.sort-icon { display: inline-flex; align-items: center; justify-content: center; margin-left: 8px; opacity: 0.5; cursor: pointer; transition: transform .12s, opacity .12s; color: var(--muted); }
.sort-icon.asc { transform: rotate(180deg); opacity: 1; }
.sort-icon.desc { transform: rotate(0deg); opacity: 1; }
.sort-active { background: var(--accent-lt); color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); }
.sort-active .sort-icon { color: var(--accent); opacity: 1; }

.nd {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--r);
  border: 1.5px solid var(--topbar-bg);
}

.btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 10px rgba(3, 37, 189, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(3, 37, 189, 0.35);
  filter: brightness(1.1);
}

.btn-green {
  background: var(--g);
  color: #fff;
}

.btn-steel {
  background: var(--steel);
  color: #fff;
}

.btn-red {
  background: var(--r);
  color: #fff;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
  min-height: 32px;
}

.img-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  font-size: 14px;
  line-height: 1;
}

.img-slot { position: relative; overflow: hidden; }

/* ── PAGES ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.page.active {
  display: flex;
}

/* ── STATS ── */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.stat:hover {
  background: var(--card-hi);
  box-shadow: var(--card-shadow-hi);
  border-color: var(--card-border-hi);
  transform: translateY(-1px);
}

.slabel {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
}

.sval {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 6px 0 3px;
  line-height: 1;
}

.snote {
  font-size: 11px;
  font-weight: 700;
}

.sicon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 14px;
  right: 14px;
}

.sicon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

/* ── LAYOUT ── */
.row {
  display: grid;
  gap: 14px;
}

.r2 {
  grid-template-columns: 1fr 1fr;
}

.r3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.r31 {
  grid-template-columns: 1.85fr 1fr;
}

.r21 {
  grid-template-columns: 1.6fr 1fr;
  align-items: start;
}

.row.r21 > .card:first-child .tw {
  max-height: 420px;
  overflow-y: auto;
}

.incomplete-card {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.row.r21 > .card:first-child {
  min-width: 0; 
}

table {
  table-layout: fixed;
}

table td:first-child, table th:first-child { width: 110px; }
table td:nth-child(2), table th:nth-child(2) { width: 110px; }
table td:nth-child(3), table th:nth-child(3) { width: auto; }

tbody td { padding: 8px; }

.incomplete-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.incomplete-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.incomplete-list-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: calc(100% - 28px);
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.incomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--card-fill);
  border: 1px solid var(--card-border);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ii-left { display:flex; gap:8px; align-items:center; }
.ii-icon { width:40px; height:40px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ii-info .ii-title { font-weight:700; font-size:12px; }
.ii-meta { font-size:11px; color:var(--faint); margin-top:4px; }

/* Responsive adjustments */
@media (max-width: 1200px) {
  .r21 {
    grid-template-columns: 1fr 360px;
  }
  .incomplete-card { width: 100%; }
}

@media (max-width: 900px) {
  .r21 {
    grid-template-columns: 1fr;
  }
  .incomplete-card { max-width: none; }
  .incomplete-split { grid-template-columns: 1fr 1fr; }
  .row.r21 > .card:first-child .tw { max-height: 360px; }
}

@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sval { font-size: 22px; }
  thead th { padding: 6px; font-size: 10px; }
  tbody td { padding: 8px; font-size: 12px; }
  .card { padding: 14px 14px; }
  .ch { margin-bottom: 10px; }
  .incomplete-split { grid-template-columns: 1fr; gap: 8px; }
  .incomplete-col { gap: 6px; }
  .incomplete-list-inner { gap: 6px; max-height: none; }
  .incomplete-item { padding: 6px 8px; gap: 6px; }
  .ii-left { gap: 6px; }
  .ii-icon { width: 30px; height: 30px; border-radius: 7px; }
  .ii-icon svg { width: 14px; height: 14px; }
  .ii-info .ii-title { font-size: 10px; line-height: 1.15; }
  .ii-meta { font-size: 9px; margin-top: 2px; line-height: 1.1; }
  .ii-meta:nth-of-type(2) { display: none; }
  .ii-resume-btn { min-height: 28px; padding: 4px 8px; font-size: 10px; }
  .badge { font-size: 9px; padding: 2px 6px; }
  .ii-info .ii-title { font-size: 11px; }
  .ii-meta { font-size: 10px; }
  .incomplete-split { grid-template-columns: 1fr; }
}

.col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── CARD — Sentinel soft-card ── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ch {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ct {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cs {
  font-size: 11px;
  color: var(--faint);
  margin-top: 2px;
  font-weight: 500;
}

.ch180 {
  position: relative;
  height: 180px;
}

.ch140 {
  position: relative;
  height: 140px;
}

/* ── TABLE ── */
.tw {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-size: 10px;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 0 10px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

tbody td {
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

td.td-center {
  width: 34px;
  min-width: 34px;
  text-align: center;
  padding: 4px 2px;
}

#page-reports th:last-child,
#page-reports td:last-child {
  width: 34px;
  min-width: 34px;
  text-align: center;
}

.report-delete-btn {
  background: transparent !important;
  border: none;
  color: var(--muted);
  padding: 2px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none !important;
  transition: color 0.15s ease;
}
.report-delete-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 0;
  flex-shrink: 0;
}
.report-delete-btn:hover {
  background: transparent !important;
  color: var(--r);
}
.report-delete-btn:active {
  transform: scale(0.95);
}

.misc-log-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}


tbody tr:hover td {
  background: var(--surface2);
  cursor: pointer;
}

.tdm {
  color: var(--text) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
}

.mono {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  color: var(--faint) !important;
  font-weight: 400 !important;
}

/* ── BADGES — Sentinel semantic palette ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.b-gold {
  background: rgba(245, 197, 66, 0.14);
  color: #f5c542;
}

.b-green {
  background: rgba(34, 211, 165, 0.14);
  color: #22d3a5;
}

.b-red {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}

.b-sky {
  background: rgba(6, 182, 212, 0.14);
  color: #06b6d4;
}
.b-teal {
  background: rgba(14, 165, 233, 0.14);
  color: #0ea5e9;
}

.b-amber {
  background: rgba(245, 197, 66, 0.14);
  color: #f5c542;
}

.b-faint {
  background: var(--card-fill);
  color: var(--faint);
}

.b-steel {
  background: rgba(71, 85, 105, 0.14);
  color: var(--muted);
}

.b-purple {
  background: rgba(168, 85, 247, 0.14);
  color: #a855f7;
}

/* ── PROGRESS ── */
.pw {
  background: var(--surface3);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
}

.pf {
  height: 100%;
  border-radius: 20px;
  transition: width .4s;
}

/* ── FILTER ── */
.fb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.fb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fb-right {
  display: flex;
  align-items: center;
  margin-left: auto;
}


.chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  transition: all .15s;
  color: var(--muted);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.fsr {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  margin-left: 0 !important;
  min-width: 180px;
  max-width: 240px;
  width: 100%;
}

.fsr:focus-within {
  border-color: var(--accent);
}

.fsr svg {
  width: 13px;
  height: 13px;
  color: var(--faint);
  stroke-width: 1.8;
}

.fsr input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  width: 150px;
}

/* ── FORM BASE ── */
.fsec {
  margin-bottom: 20px;
}

.fst {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.doc-same-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.doc-same-toggle input {
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.sd {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fg {
  display: grid;
  gap: 12px;
}

.fg2 {
  grid-template-columns: 1fr 1fr;
}

.fg3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.freq {
  color: var(--r);
}

.fi,
.fta {
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  transition: all .15s;
  width: 100%;
}

.fi:focus,
.fta:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

.fi::placeholder,
.fta::placeholder {
  color: var(--faint);
  font-weight: 400;
}

.fta {
  resize: vertical;
  min-height: 72px;
}

.fa {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ───────────────────────────────────────────────────────── 
   CUSTOM SELECT — replaces native <select> entirely.
   The dropdown panel is position:absolute inside a
   position:relative wrapper, so it never overflows the card.
   ─────────────────────────────────────────────────────────  */
.fsel-wrap {
  position: relative;
  width: 100%;
}

/* The visible trigger button */
.fsel {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 36px 9px 12px;
  /* right pad for chevron */
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

/* native select fallback (hidden but kept for semantics if needed) */
select.fsel-native {
  display: none;
}

.fsel:focus,
.fsel.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

/* Chevron icon inside trigger */
.fsel-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--faint);
  transition: transform .2s;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.fsel.open .fsel-chevron {
  transform: translateY(-50%) rotate(180deg);
}

/* The dropdown panel */
.fsel-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  /* ← key: stretches to parent width, never wider */
  background: var(--card-bg);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  overflow: hidden;
  display: none;
  max-height: 220px;
  overflow-y: auto;
}

.fsel-dropdown.open {
  display: block;
}

/* Individual option */
.fsel-opt {
  padding: 10px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid var(--border);
}

.fsel-opt:last-child {
  border-bottom: none;
}

.fsel-opt:hover {
  background: var(--accent-lt);
  color: var(--accent);
}

.fsel-opt.selected {
  background: var(--accent);
  color: #fff;
}

.fsel-opt.placeholder-opt {
  color: var(--faint);
  font-weight: 500;
}

/* ── STEP WIZARD ── */
.step-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
}

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
  background: var(--card-bg);
  flex-shrink: 0;
  transition: all .2s;
}

.step-circle.done {
  background: var(--g);
  border-color: var(--g);
  color: #fff;
}

.step-circle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--faint);
  margin-top: 4px;
  white-space: nowrap;
}

.step-label.active {
  color: var(--accent);
}

.step-label.done {
  color: var(--g);
}

.step-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 14px;
}

.step-line.done {
  background: var(--g);
}

/* ── IMAGE UPLOAD ── */
.img-upload-section {
  background: var(--surface2);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
}

.img-upload-header {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.img-upload-sub {
  font-size: 10px;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 12px;
}

.img-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.img-slot {
  width: 72px;
  height: 72px;
  border-radius: 9px;
  border: 1.5px dashed var(--border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}

.img-slot:hover {
  border-color: var(--accent);
  background: var(--accent-lt);
}

.img-slot.filled {
  border-style: solid;
  border-color: var(--g);
  background: var(--g-lt);
}

.img-slot.compulsory {
  border-color: var(--r);
}

.img-slot svg {
  width: 20px;
  height: 20px;
  color: var(--faint);
}

.img-slot.filled svg {
  color: var(--g);
}

.img-slot-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--faint);
  margin-top: 4px;
  text-align: center;
}

.img-count-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 4px;
}

.img-grid .img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.req-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--r-lt);
  color: var(--r);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── MODAL — Sentinel soft-card ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: none;
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.overlay.open {
  display: flex;
}
.modal {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: min(90vw, 600px);
  max-width: 96vw;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--card-shadow-hi);
  padding: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
  margin: auto;
}
.modal-close-top {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6) !important;
  color: white !important;
  border: none !important;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  padding: 0;
  min-height: unset;
}

.modal-close-top:hover {
  background: rgba(0, 0, 0, 0.8) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

.modal-close-top:active {
  transform: scale(0.95);
}

.modal-lg {
  width: min(96vw, 780px);
}

.tx-modal-body {
  overflow-y: auto;
  max-height: calc(92vh - 220px);
}

#preview-modal .modal {
  width: min(96vw, 900px);
  max-height: 96vh;
  padding: 10px;
}
#preview-modal #preview-modal-body {
  width: 100%;
  max-height: calc(96vh - 80px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
#preview-modal #preview-modal-body img,
#preview-modal #preview-modal-body object {
  max-width: 100%;
  max-height: calc(96vh - 96px);
  display: block;
}

@media (max-width: 640px) {
  .modal {
    width: calc(100vw - 12px);
    height: 100vh;
    max-height: 100vh;
    border-radius: 8px;
    margin: 6px;
  }
  .modal.modal-lg {
    width: calc(100vw - 12px);
  }
  .modal-close-top {
    top: 10px;
    right: 10px;
    padding: 8px 10px;
    font-size: 16px;
  }
  .tx-modal-body {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  #preview-modal #preview-modal-body {
    max-height: calc(100vh - 88px);
  }
}

@media (max-width: 480px) {
  .tx-letterhead {
    padding: 10px 10px 8px 10px;
    margin-bottom: 8px;
  }
  .tx-letterhead-top {
    gap: 8px;
    align-items: center;
  }
  .tx-letterhead-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  .tx-letterhead-logo img { padding:2px }
  .tx-company-name { font-size: 13px; }
  .tx-company-address { font-size: 11px; }
  .tx-company-contact { font-size: 10px; }

  .tx-letterhead-title { padding: 6px 0; }
  .tx-report-title { font-size: 14px; }
  .tx-report-ref { font-size: 11px; }

  .tx-modal-body { padding: 10px 10px 6px 10px; gap: 10px; }
  .tx-section { padding: 8px; border-radius:10px }
  .tx-section-title { font-size: 11px }
  .tx-field-label { font-size: 9px }
  .tx-field-value { font-size: 13px }

  .modal-close-top { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 20px; }

  .tx-actions-footer {
    padding: 8px;
    gap: 6px;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,1));
  }
  .tx-actions-footer .btn { padding: 8px 10px; font-size: 13px }

  .tx-letterhead-divider { margin: 10px 0 }

  .img-grid { gap:6px }
  .img-slot { min-height: 80px }

  .tx-company-address, .tx-company-contact, .tx-report-ref { display: block; }
}

.mh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.mtt {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mx {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--surface2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
}

.mx:hover {
  background: var(--r-lt);
  color: var(--r);
}

/* ── EMPLOYEE CARDS ── */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.emp-card-modern {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: var(--card-shadow);
}

.emp-card-modern:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hi);
  background: var(--card-hi);
  border-color: var(--card-border-hi);
}

.ec-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ec-av {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.ec-info {
  flex: 1;
  min-width: 0;
}

.ec-name {
  font-weight: 800;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ec-role {
  font-size: 11px;
  color: var(--faint);
  font-weight: 600;
  margin-top: 1px;
}

.ec-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1; /* Pushes footer to bottom */
}

.ec-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.ec-meta svg {
  width: 13px;
  height: 13px;
  color: var(--faint);
}

.ec-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ec-tags {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.btn-icon:hover {
  background: var(--accent-lt);
  color: var(--accent);
}

.btn-icon-red:hover {
  background: var(--r-lt);
  color: var(--r);
}

/* ── FEED ── */
.fr {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.fr:last-child {
  border-bottom: none;
}

.fp {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.ft {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.fti {
  font-size: 10px;
  color: var(--faint);
  margin-top: 2px;
  font-weight: 500;
}

/* ── TOGGLE ── */
.tog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.tog-row:last-child {
  border-bottom: none;
}

.tl2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ts2 {
  font-size: 11px;
  color: var(--faint);
}

.toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}

.toggle.on {
  background: var(--accent);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.toggle.on::after {
  transform: translateX(18px);
}
.toggle-group {
  display: flex;
  background: var(--surface2);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border);
}

.toggle-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
}

.toggle-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(3,37,189,0.25);
}
/* ── REPORT FILTERS ── */
.rf-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.rf-types {
  flex: 0 1 auto;
}

.rf-dates-group {
  flex: 1 1 auto;
  gap: 10px;
  min-width: 280px;
}

.rf-date-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.rf-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.rf-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.rfl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--faint);
  margin-right: 4px;
}

.rf-to {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

.rfi {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  transition: border-color .15s;
  flex: 1;
  min-width: 90px;
}

.rfi:focus {
  border-color: var(--accent);
}

.rf-reset, .rf-apply {
  width: auto;
  min-height: unset;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.rf-actions-group .btn {
  width: auto;
  min-height: unset;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.rf-actions-group .btn svg {
  width: 14px;
  height: 14px;
}

/* ── WEIGHBRIDGE BANNER ── */
.wb-banner {
  background: linear-gradient(135deg, var(--steel) 0%, #1a3354 100%);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
}

.wb-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wb-icon svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  stroke-width: 1.8;
}

.wb-title {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.wb-sub {
  font-size: 11px;
  opacity: .75;
  margin-top: 2px;
}

.wb-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  margin-left: auto;
}

.wb-unit {
  font-size: 12px;
  opacity: .7;
  font-weight: 600;
}

/* ── DRIVER URL ── */
.driver-url-card {
  background: var(--card-bg);
  border: 1.5px solid var(--amber);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.driver-url-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 4px;
}

.driver-url-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}

.driver-url-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--g);
  margin-top: 3px;
}

.driver-url-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--g);
}

.reports-toolbar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  box-shadow: var(--card-shadow);
  flex-wrap: nowrap;
  overflow: visible;
  position: relative;
  z-index: 10;
}

.rt-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.rt-tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}

.rt-tab:hover {
  background: var(--surface2);
  color: var(--text);
}

.rt-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(3,37,189,.25);
}

.rt-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 10px;
  flex-shrink: 0;
}

.rt-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

.rt-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: nowrap;
  min-width: 0;
}

.rt-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 0 10px;
  height: 30px;
  min-width: 150px;
  max-width: 190px;
  flex-shrink: 0;
}

.rt-search:focus-within {
  border-color: var(--accent);
  background: var(--input-bg);
}

.rt-search svg {
  width: 13px;
  height: 13px;
  color: var(--faint);
  flex-shrink: 0;
}

.rt-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  width: 100%;
}

.rt-search-input::placeholder {
  color: var(--faint);
  font-weight: 400;
}

.rt-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: 8px;
}

.rt-actions .btn {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  width: auto;
  min-height: unset;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 768px) {
  .reports-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }
  .rt-divider { display: none; }
  .rt-tabs { width: 100%; }
  .rt-tab { flex: 1; justify-content: center; }
  .rt-filters { flex-wrap: wrap; }
  .rt-search { max-width: 100%; min-width: unset; flex: 1; }
  .rt-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-left: 0; }
  .rt-sep { display: none; }
  .rt-actions .btn { width: 100% !important; height: 34px; justify-content: center; }
}

#page-reports .fsr {
  display: none;
}

.chip {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.fsel-wrap {
  position: relative;
}

.fsel {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
  white-space: nowrap;
}

.fsel:hover {
  border-color: var(--accent);
}

.fsel-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.fsel-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
  min-width: 140px;
  display: none;
}

.fsel-dropdown.active {
  display: block;
}

.fsel-opt {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}

.fsel-opt:hover {
  background: var(--surface2);
}

.fsel-opt.selected {
  background: var(--accent-lt);
  color: var(--accent);
  font-weight: 600;
}

/* â”€â”€ INFO GRID â”€â”€ */
.ig {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.ii .il {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--faint);
  margin-bottom: 3px;
}

.ii .iv {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.tx-letterhead {
  padding: 22px 22px 16px 22px;
  border-bottom: 2px solid var(--border);
  background: var(--surface2);
  margin: 0 0 0 0;
}

.tx-letterhead-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.tx-letterhead-logo {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tx-letterhead-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.tx-letterhead-company {
  flex: 1;
}

.tx-company-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.tx-company-address {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.tx-company-contact {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.4;
}

.tx-letterhead-status {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.tx-letterhead-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.tx-letterhead-title {
  text-align: center;
  padding: 8px 0;
}

.tx-report-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.tx-report-ref {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.tx-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 22px 0 22px;
  overflow-y: auto;
  flex: 1;
}

.tx-summary-grid,
.tx-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tx-section {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
}

.tx-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tx-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
}

.tx-section-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.tx-field-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.tx-field-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 5px;
}

.tx-field-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
  line-height: 1.45;
}

.tx-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 860px) {
  .tx-summary-grid,
  .tx-field-grid {
    grid-template-columns: 1fr;
  }
}

/* â”€â”€ BULK ACTIONS â”€â”€ */
.bulk-action-bar {
  display: flex;
  align-items: center;
}

tbody tr.selected td {
  background: var(--accent-lt);
}

.row-select {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* â”€â”€ FLATPICKR â”€â”€ */
.flatpickr-calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  width: 336px !important;
  padding: 5px;
}

.flatpickr-weekdays,
.flatpickr-days,
.dayContainer {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

.flatpickr-day {
  color: var(--text);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  height: 35px;
  line-height: 34px;
  flex: 1 0 calc(100% / 7);
  max-width: calc(100% / 7);
}

.flatpickr-weekday {
  flex: 1 0 calc(100% / 7);
  max-width: calc(100% / 7);
  text-align: center;
}

.flatpickr-day:hover {
  background: var(--accent-lt);
  color: var(--accent);
}

.flatpickr-day.selected {
  background: var(--accent) !important;
  color: #fff !important;
  border: none;
}

.flatpickr-months .flatpickr-month {
  color: var(--text);
  fill: var(--text);
  padding-bottom: 8px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
}

.flatpickr-weekday {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}

.flatpickr-day.today {
  border-color: var(--accent);
  color: var(--accent);
}

.flatpickr-innerContainer {
  padding: 4px;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  fill: var(--faint);
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  fill: var(--accent);
  background: var(--accent-lt);
  border-radius: 50%;
}

/* â”€â”€ MISC â”€â”€ */
.c-green {
  background: var(--g-lt) !important;
  color: var(--g) !important;
}

.c-red {
  background: var(--r-lt) !important;
  color: var(--r) !important;
}

.b-sm {
  padding: 5px;
  font-size: 9px;
}

#bulk-bar .bulk-action-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MOBILE MENU TOGGLE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  transition: all .2s;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE  â‰¤ 1024px
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media(max-width:1024px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .r31,
  .r21 {
    grid-template-columns: 1fr;
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE  â‰¤ 768px
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media(max-width:768px) {
  .shell {
    flex-direction: column;
  }

  /* Slide-in sidebar */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 1000;
    width: 280px;
    background: var(--sidebar-bg);
    transition: left .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, .2);
    align-items: flex-start;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar .sl {
    justify-content: flex-start;
    padding: 24px 20px;
  }

  .sidebar .app-name {
    display: block;
    margin-top: 2px;
  }

  .sidebar .side-close {
    display: flex;
  }
  .sidebar .logo-img {
    width: 44px;
    height: 44px;
  }

  .sidebar nav {
    padding: 20px 15px;
    align-items: stretch;
  }

  .sidebar .ni {
    width: 100%;
    height: 48px;
    justify-content: flex-start;
    padding: 0 15px;
    gap: 12px;
  }

  .sidebar .tip {
    display: block;
    position: static;
    transform: none;
    opacity: 1;
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
  }

  .sidebar .tip::before {
    display: none;
  }

  .sidebar .sb {
    width: 100%;
    padding: 20px;
    margin-top: auto;
  }

  .main {
    width: 100%;
    max-width: 100%;
  }

  .topbar {
    padding: 0 16px;
    height: 64px;
  }

  .menu-toggle {
    display: flex;
  }

  .content {
    padding: 16px;
  }

  /* Stacked grids */
  .stats {
    grid-template-columns: 1fr;
  }

  .row,
  .r2,
  .r3,
  .r31,
  .r21 {
    grid-template-columns: 1fr !important;
  }

  /* Charts */
  .ch180,
  .ch140 {
    width: 100%;
    height: 220px;
  }

  canvas {
    width: 100% !important;
    height: 100% !important;
  }

  /* Forms */
  .fg,
  .fg2,
  .fg3 {
    grid-template-columns: 1fr !important;
  }

  .fi,
  .fta {
    width: 100% !important;
    font-size: 14px !important;
    min-height: 48px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .fa {
    flex-direction: column;
    width: 100%;
  }

  /* Report filter bar */
  .report-filter-bar {
    flex-direction: column;
    height: auto;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    background: var(--surface2);
    border-radius: 12px;
    border: none;
    flex-wrap: wrap;
  }

  .rf-filters-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
  }

  .rf-date-range {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: center;
  }

  .rf-search-wrap {
    width: 100%;
    min-width: unset;
    flex: unset;
  }

  .rf-actions-group {
    width: 100%;
    margin-left: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  .fsel.compact {
    width: 100% !important;
    min-width: unset !important;
    height: 34px;
    font-size: 11px;
  }

  .fsel-wrap.compact {
    position: relative;
  }

  .fsel-dropdown.compact {
    width: calc(100% + 20px) !important;
    left: -10px !important;
    margin-top: 6px !important;
  }

  .rf-date-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    width: 100%;
  }

  .rfi.compact {
    width: 100% !important;
    height: 34px !important;
    font-size: 11px !important;
    padding: 6px !important;
  }

  .rf-actions-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
    width: 100%;
    margin-left: 0 !important;
  }

  .rf-actions-group .rf-divider {
    display: none;
  }

  .rf-actions-group .btn {
    width: 100% !important;
    height: 34px !important;
    font-size: 11px !important;
    padding: 0 8px !important;
    justify-content: center !important;
  }

  .fsel {
    width: 100% !important;
    height: 38px !important;
  }

  .fsel-dropdown {
    width: calc(100% + 24px) !important;
    left: -12px !important;
  }

  .report-filter-bar .nsep {
    display: none;
  }

  .report-filter-bar .rfi {
    width: 100% !important;
    margin: 0 !important;
    height: 38px;
  }

  /* â”€â”€ REPORTS: Table Fit Fix â”€â”€ */
  #page-reports .tw {
    margin: 0 -4px;
    width: calc(100% + 8px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #page-reports table {
    min-width: 1200px !important;
    table-layout: auto;
  }

  #page-reports th,
  #page-reports td {
    padding: 10px 4px !important;
    font-size: 9.5px !important;
  }

  #page-reports th,
  #page-reports td {
    white-space: nowrap;
  }

  #page-reports .tdm {
    font-size: 10px !important;
  }

  #page-reports .btn-sm {
    padding: 0 !important;
    font-size: 9px !important;
    min-height: 24px !important;
  }

  /* Row Actions (Icons on mobile) */
  .row-actions {
    display: flex;
    gap: 4px;
  }

  .row-actions .btn {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    flex-shrink: 0;
    border-radius: 6px !important;
  }

  .row-actions .btn-ghost {
    width: auto !important;
    padding: 0 8px !important;
    font-size: 9px;
  }

  .row-actions .btn-ghost span {
    display: none;
  }

  .row-actions svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
  }

  #page-reports th:nth-child(9) {
    width: 90px;
  }

  /* Search bar fit */
  .ch .fsr {
    margin-left: 0;
    width: 100%;
  }

  .ch .fsr input {
    width: 100%;
  }

  /* Bulk bar alignment */
  /* Bulk bar alignment - Slimmer */
  #bulk-bar {
    flex-direction: row !important;
    align-items: center !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    border-radius: 8px !important;
    justify-content: space-between !important;
    border: 1px solid var(--accent);
  }

  #bulk-bar div:first-child {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
  }

  #bulk-bar #bulk-count {
    font-size: 10px !important;
    font-weight: 800;
  }

  #bulk-bar .btn {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 9px !important;
    width: auto !important;
  }

  #bulk-bar button[onclick*="Deselect All"] {
    font-size: 9px !important;
    margin-left: auto;
  }

  /* Table scroll container */
  .tw {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 600px;
  }

  /* Modals slide up from bottom */
  .modal {
    width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
  }

  /* Employee & info grids */
  .emp-grid,
  .ig {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* â”€â”€ DASHBOARD: Recent Transactions Fit Fix â”€â”€ */
  #page-dashboard .tw {
    margin: 0 -4px;
    width: calc(100% + 8px);
    overflow-x: hidden;
  }

  #page-dashboard table {
    min-width: 100% !important;
    table-layout: auto;
  }

  #page-dashboard th,
  #page-dashboard td {
    padding: 12px 8px !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }


  #page-dashboard th:nth-child(1) {
    width: 100px;
  }

  /* Date */
  #page-dashboard th:nth-child(3) {
    width: auto;
  }

  /* Party */
  #page-dashboard th:nth-child(5) {
    width: 140px;
  }

  /* Weight */
  #page-dashboard th:nth-child(6) {
    width: 90px;
  }

  /* Status */
  #page-dashboard th:nth-child(7) {
    width: 80px;
  }

  /* Action (View) */

  #page-dashboard td:nth-child(7) {
    padding: 8px 2px !important;
    text-align: right;
  }


  #page-dashboard .btn-sm {
    padding: 2px 4px !important;
    font-size: 9px !important;
    min-height: 22px !important;
    width: auto !important;
  }

  #page-dashboard .badge {
    padding: 1px 4px !important;
    font-size: 8.5px !important;
  }

  /* Card padding reduction */
  .card {
    padding: 14px !important;
  }

  .ch {
    flex-wrap: wrap;
    gap: 10px;
  }

  .ch .btn {
    width: auto !important;
    min-height: 30px !important;
    padding: 4px 10px !important;
    font-size: 10px !important;
  }

  /* â”€â”€ CUSTOM SELECT stays contained â”€â”€ */
  .fsel-wrap {
    width: 100%;
  }

  .fsel {
    width: 100%;
    font-size: 13px !important;
    height: 38px !important;
    padding: 0 12px !important;
    min-height: unset !important;
  }

  .fsel-dropdown {
    max-height: 200px;
    border-width: 1px;
  }

  .fsel-opt {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Scale down Flatpickr on mobile */
  .flatpickr-calendar {
    width: 250px !important;
    transform: scale(0.88);
    transform-origin: top center;
  }

  .flatpickr-day {
    height: 30px;
    line-height: 30px;
    width: 30px;
    font-size: 11px;
  }

  /* Form action buttons */
  .fa {
    gap: 8px;
  }

  .fa .btn {
    width: 100% !important;
    margin-bottom: 0;
  }

  .btn:not(.btn-primary):not(.btn-green):not(.btn-red) {
    width: 100%;
  }
}

@media(max-width:480px) {
  .sval {
    font-size: 24px;
  }

  .mtt {
    font-size: 13px;
  }

  .ig {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #page-dashboard .tw {
    padding: 0;
  }

  .fst {
    align-items: flex-start;
  }

  .doc-same-toggle {
    margin-left: 0;
    justify-content: flex-start;
    margin-top: 0;
    padding: 8px 12px;
    font-size: 12px;
  }

  #page-dashboard td {
    font-size: 9.5px !important;
  }

  #page-dashboard th:nth-child(4),
  #page-dashboard td:nth-child(4) {
    display: none !important;
  }
}

/* ── DASHBOARD ENHANCEMENTS ── */
.incomplete-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.incomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-fill);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.incomplete-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow);
  background: var(--card-fill-hi);
  border-color: var(--card-border-hi);
}

.ii-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.ii-resume-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.ii-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ii-icon svg {
  width: 20px;
  height: 20px;
}

.ii-title {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ii-meta {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: var(--faint);
  margin-top: 2px;
}

.ii-right {
 display: flex;
 align-items: center;
 gap: 20px;
}

.ii-status {
 text-align: right;
 min-width: 140px;
}

.ii-progress {
 width: 100%;
 height: 6px;
 background: var(--surface3);
 border-radius: 10px;
 overflow: hidden;
 margin-bottom: 4px;
}

.ii-bar {
 height: 100%;
 background: linear-gradient(90deg, var(--accent), var(--sky));
 border-radius: 10px;
 transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ii-step {
 font-size: 10px;
 font-weight: 800;
 color: var(--muted);
 text-transform: uppercase;
 letter-spacing: .05em;
}

.pulse-dot {
 width: 8px;
 height: 8px;
 background: var(--g);
 border-radius: 50%;
 position: relative;
}

.pulse-dot::after {
 content: \\;
 position: absolute;
 width: 100%;
 height: 100%;
 background: var(--g);
 border-radius: 50%;
 animation: pulse 2s infinite;
 opacity: 0.5;
}

@keyframes pulse {
 0% { transform: scale(1); opacity: 0.5; }
 100% { transform: scale(3); opacity: 0; }
}

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

.fr {
 animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
 from { opacity: 0; transform: translateX(20px); }
 to { opacity: 1; transform: translateX(0); }
}

.b-steel-lt { background: var(--steel-lt); }
.b-gold-lt { background: var(--accent-lt); }



@media (max-width: 768px) {
  .incomplete-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .ii-right {
    width: 100%;
    justify-content: space-between;
  }
  .ii-status {
    text-align: left;
    min-width: unset;
    flex: 1;
  }

  .report-actions {
    justify-content: stretch;
    gap: 8px;
  }
  .report-actions .btn {
    flex: 1;
    height: 36px;
    font-size: 12px;
  }
}

.tx-actions-footer {
  display: flex;
  gap: 12px;
  padding: 16px 22px;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--card-border);
  margin-top: auto;
  flex-shrink: 0;
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
}

.tx-actions-footer .btn {
  min-height: 40px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tx-actions-footer .btn.btn-ghost:first-child {
  margin-right: auto;
}

.tx-actions-footer .mx {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--surface2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  transition: background 0.2s ease;
  padding: 0;
}

.tx-actions-footer .mx:hover {
  background: var(--surface3);
}

@media (max-width: 640px) {
  .tx-actions-footer {
    flex-direction: column;
    gap: 8px;
  }
  
  .tx-actions-footer .btn {
    width: 100%;
    justify-content: center;
  }
  
  .tx-actions-footer .btn.btn-ghost:first-child {
    margin-right: unset;
  }
}

@media (max-width: 480px) {
  .tx-actions-footer {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
    align-items: center !important;
    justify-items: stretch !important;
  }

  .tx-actions-footer .mx {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .tx-actions-footer .btn {
    width: 100% !important;
    min-height: 34px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
  }

  .tx-actions-footer .btn.btn-primary {
    font-size: 13px !important;
    padding: 6px 8px !important;
  }
}

.tx-report-footer {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-style: normal;
  border: none;
}

@media print {
  * {
    box-shadow: none !important;
  }

  body {
    background: white;
    margin: 0;
    padding: 0;
  }

  .overlay {
    position: static;
    background: white;
    max-height: 100%;
  }

  .modal {
    box-shadow: none !important;
    border: none;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: white;
  }

  .modal.modal-lg {
    max-height: 100%;
  }

  .no-print,
  #mx-header {
    display: none !important;
  }

  .tx-modal-body {
    page-break-inside: avoid;
  }

  .tx-section {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    background: white;
  }

  .tx-letterhead {
    background: white;
    border: none;
    border-bottom: 2px solid #333;
    padding: 14px;
    margin-bottom: 12px;
  }

  .tx-letterhead-top {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .tx-letterhead-logo img {
    max-width: 48px;
  }

  .tx-company-name {
    font-size: 14px;
    font-weight: 800;
  }

  .tx-company-address {
    font-size: 10pt;
    color: #333;
  }

  .tx-company-contact {
    font-size: 9pt;
    color: #555;
  }

  .tx-report-title {
    font-size: 16px;
    color: #000;
  }

  .tx-report-ref {
    font-size: 11pt;
    color: #555;
  }

  .tx-field-card {
    page-break-inside: avoid;
    background: white;
    border: 1px solid #ddd;
  }

  .tx-field-label {
    font-size: 9pt;
    color: #666;
  }

  .tx-field-value {
    font-size: 13px;
    color: #000;
  }

  .tx-summary-grid,
  .tx-field-grid {
    grid-template-columns: 1fr;
  }

  .tx-modal-body {
    padding: 12px 12px 8px 12px;
    gap: 12px;
  }

  .tx-actions-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #eee;
  }

  .tx-actions-footer .btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
  }

  .badge {
    border: 1px solid #333;
    background: white;
    color: #000;
  }

  .img-slot {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .tx-report-footer {
    border-left: 3px solid #333;
    font-size: 10pt;
    background: #f5f5f5;
  }

  .tx-actions-footer {
    display: none !important;
  }

  @page {
    margin: 20mm;
    size: A4;
  }
}

.misc-log-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card-fill);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.misc-log-card:hover {
  border-color: var(--card-border-hi);
  background: var(--card-fill-hi);
  box-shadow: var(--card-shadow);
}

.misc-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.misc-log-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.misc-log-creator {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 8px;
  background: var(--surface2);
  border-radius: 6px;
  white-space: nowrap;
}

.misc-log-remarks {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}

.misc-log-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.misc-log-image-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: .2s;
}

.misc-log-image-thumb:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}
#page-dashboard .incomplete-card {
  padding: 14px 12px;
}

#page-dashboard .incomplete-item {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

#page-dashboard .ii-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

#page-dashboard .ii-info {
  flex: 1;
  min-width: 0;
}

#page-dashboard .ii-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#page-dashboard .ii-meta {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#page-dashboard .ii-resume-btn {
  flex-shrink: 0;
  padding: 4px 12px !important;
  height: 28px !important;
  font-size: 10px !important;
  white-space: nowrap;
  margin: 0 !important;
}

/* Dashboard table sidebar responsive */
#page-dashboard .r21 {
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  align-items: stretch;
}

#page-dashboard .card {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
}

#page-dashboard .card > .ch {
  flex-shrink: 0;
}

#page-dashboard .r21 > .card {
  max-height: 560px;
  overflow: hidden;
}

#page-dashboard .tw {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#page-dashboard .incomplete-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Optimize badges in sidebar */
#page-dashboard .incomplete-card .badge {
  padding: 3px 8px;
  font-size: 9px;
}

/* Dashboard scrollbar styling */
#page-dashboard .incomplete-list::-webkit-scrollbar {
  width: 6px;
}

#page-dashboard thead th {
  padding: 0 10px 8px;
}

#page-dashboard tbody td {
  padding: 8px 10px;
  font-size: 11px;
}

#page-dashboard .incomplete-list::-webkit-scrollbar-track {
  background: transparent;
}

#page-dashboard .incomplete-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

#page-dashboard .incomplete-list::-webkit-scrollbar-thumb:hover {
  background: var(--faint);
}

.incomplete-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.incomplete-empty svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  opacity: 0.3;
}

#page-dashboard .incomplete-card .ch {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

#page-dashboard .incomplete-card .ct {
  font-size: 12px;
}

#page-dashboard .incomplete-card .cs {
  font-size: 10px;
  margin-top: 1px;
}

/* Mobile responsive breakpoints */
@media (max-width: 1024px) {
  #page-dashboard .r21 {
    grid-template-columns: 1fr;
  }
  
  #page-dashboard .r21 > .card {
    height: auto;
    max-height: 520px;
  }
  
  #page-dashboard .incomplete-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
  }
  
  #page-dashboard .ii-left {
    width: auto;
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  #page-dashboard .r21 {
    grid-template-columns: 1fr !important;
    align-items: stretch;
  }
  
  #page-dashboard .r21 > .card {
    height: auto;
    max-height: none;
  }

  /* Hide Lorry column on tablet/mobile */
  #page-dashboard th:nth-child(4),
  #page-dashboard td:nth-child(4) {
    display: none !important;
  }
  #page-dashboard .r21 > .card:first-child {
    height: 560px !important;
    max-height: 560px !important;
    overflow: hidden !important;
  }

  #page-dashboard .r21 > .card:first-child .tw {
    overflow-y: auto !important;
    max-height: calc(560px - 60px) !important;
  }

  #page-dashboard .incomplete-card {
    height: 620px !important;
    max-height: 620px !important;
  }

  #page-dashboard .incomplete-card {
    order: 2;
  }
  
  #page-dashboard .card:has(.tw) {
    order: 1;
  }
  
  #page-dashboard .incomplete-item {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 10px;
    min-height: 108px;
  }
  
  #page-dashboard .incomplete-item .btn {
    width: auto;
    align-self: center;
    min-width: 76px;
  }

  #page-dashboard .ii-left {
    align-items: flex-start;
    gap: 10px;
  }

  #page-dashboard .ii-icon {
    width: 34px;
    height: 34px;
  }

  #page-dashboard .ii-icon svg {
    width: 16px;
    height: 16px;
  }

  #page-dashboard .ii-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  #page-dashboard .ii-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }

  #page-dashboard .ii-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 480px) {
  #page-dashboard table {
    min-width: 0 !important;
  }

  #page-dashboard th:nth-child(1),
  #page-dashboard td:nth-child(1) {
    width: 84px;
  }

  #page-dashboard th:nth-child(3),
  #page-dashboard td:nth-child(3) {
    width: auto;
  }

  #page-dashboard .incomplete-item {
    min-height: 70px;
    padding: 12px 10px;
  }

  #page-dashboard .ii-left {
    gap: 8px;
  }

  #page-dashboard .ii-title {
    font-size: 12px;
  }

  #page-dashboard .ii-meta {
    font-size: 9px;
  }

  #page-dashboard .incomplete-item .btn {
    width: auto;
    min-width: 72px;
    padding: 4px 8px !important;
    font-size: 9px !important;
  }

  .overlay.open .modal,
  .overlay.open .modal.modal-lg,
  #preview-modal .modal,
  #view-modal .modal {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 24px) !important;
    padding: 8px !important;
    border-radius: 10px !important;
    box-shadow: none !important;
  }

  .tx-letterhead { padding: 8px 8px 6px 8px !important; margin-bottom: 8px !important; }
  .tx-letterhead-top { gap: 8px !important; align-items: center !important; }
  .tx-letterhead-logo { width:36px !important; height:36px !important; }
  .tx-letterhead-logo img { padding:2px !important }
  .tx-company-name { font-size:13px !important; }
  .tx-company-address, .tx-company-contact { font-size:10px !important; }

  .tx-report-title { font-size:15px !important; margin:6px 0 !important; }
  .tx-report-ref { font-size:11px !important; }

  .tx-modal-body { padding: 8px !important; gap:8px !important; }
  .tx-section { padding:8px !important; border-radius:10px !important; }
  .tx-summary-grid, .tx-field-grid { grid-template-columns: 1fr !important; }

  .tx-actions-footer { padding: 6px !important; gap:6px !important; }
  .tx-actions-footer .btn { min-height:36px !important; padding:8px 10px !important; font-size:13px !important; }
  .tx-actions-footer .mx { width:36px !important; height:36px !important; }

  .tx-letterhead-divider { margin:8px 0 !important; }
  #preview-modal-body { max-height: calc(100vh - 120px) !important; }
  #preview-modal .modal-close-top { top: 6px !important; right: 6px !important; width: 32px !important; height: 32px !important; font-size: 18px !important; }
}

.modal #tx-status-badge-top,
.modal #tx-status-badge {
  position: absolute;
  top: 10px;
  right: 56px; /* leave room for close button */
  z-index: 120;
}

@media (max-width: 480px) {
  .modal #tx-status-badge-top,
  .modal #tx-status-badge {
    top: 8px !important;
    right: 48px !important;
    font-size: 12px !important;
    padding: 6px 8px !important;
    border-radius: 8px !important;
  }
}

#preview-modal .modal {
  padding: 0 !important;
  background: rgba(0,0,0,0.9) !important;
  border-radius: 8px;
}

#preview-modal #preview-modal-body {
  padding: 0 !important;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preview-modal #preview-modal-body img,
#preview-modal #preview-modal-body object {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: calc(100vh - 32px) !important;
  margin: 0;
}

#preview-modal .modal-close-top {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: none;
  padding: 6px 8px;
  font-size: 18px;
  line-height: 1;
  top: 8px;
  right: 8px;
}

.modal .modal-close-top { background: transparent; }

@media (max-width: 640px) {
  .tx-actions-footer .btn {
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
  }
  .tx-actions-footer .btn.btn-primary {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
  .tx-actions-footer .btn.btn-ghost {
    padding: 6px 10px !important;
    font-size: 12.5px !important;
  }
}
.incomplete-list-inner::-webkit-scrollbar {
  width: 4px;
}
.incomplete-list-inner::-webkit-scrollbar-track {
  background: transparent;
}
.incomplete-list-inner::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.biz-parent { position: relative; }

.biz-flyout {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  width: 200px;
  background:var(--card-bg);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 20px rgba(255,255,255,.06);
  padding: 8px;
  z-index: 50;
}
.biz-flyout.open { display: block; }

.biz-flyout .ni-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  width: auto;
  height: auto;
  justify-content: flex-start;
}
.biz-flyout .ni-sub svg { width: 17px; height: 17px; flex-shrink: 0; }

.biz-flyout .ni-sub .tip {
  display: block !important;
  position: static;
  opacity: 1;
  visibility: visible;
  font-size: 13px;
  white-space: nowrap;
  background: transparent;
  padding: 0;
}
.ni.ni-sub.on{
  color: white;
}
@media (max-width: 768px) {
  .biz-flyout {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 36px;
  }
  .biz-flyout.open { display: flex; flex-direction: column; gap: 2px; }

  .biz-flyout .ni-sub {
    width: 100%;
    height: 44px;
    padding: 0 12px;
  }
}

/* ══════════════════════════════════════════════════════════════
   SENTINEL DESIGN LANGUAGE — Soft-card utilities + Vanta + Animations
   ══════════════════════════════════════════════════════════════ */

/* ── Vanta TOPOLOGY ambient background ── */
#vanta-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Soft-card utility classes ── */
.soft-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.soft-card-hover {
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.soft-card-hover:hover {
  background: var(--card-hi);
  border-color: var(--card-border-hi);
  box-shadow: var(--card-shadow-hi);
  transform: translateY(-1px);
}

.soft-fill {
  background: var(--card-fill);
  border: 1px solid var(--card-border);
}

.soft-fill-hover {
  transition: background 0.18s ease, border-color 0.18s ease;
}

.soft-fill-hover:hover {
  background: var(--card-fill-hi);
  border-color: var(--card-border-hi);
}

/* ── Sentinel animation utilities ── */
@keyframes anim-fadeup-kf {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes anim-fadein-kf {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes anim-modal-kf {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes anim-blink-kf {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes anim-glow-kf {
  0%, 100% { box-shadow: 0 0 0 0 rgba(3,37,189,.5); }
  50%       { box-shadow: 0 0 0 4px rgba(3,37,189,0); }
}

.anim-fadeup  { animation: anim-fadeup-kf 0.28s ease both; }
.anim-fadein  { animation: anim-fadein-kf 0.22s ease both; }
.anim-modal   { animation: anim-modal-kf  0.22s cubic-bezier(0.34,1.56,0.64,1) both; }
.anim-blink   { animation: anim-blink-kf  1.4s ease-in-out infinite; }
.anim-glow    { animation: anim-glow-kf   2s ease-in-out infinite; }

.stagger > * { animation: anim-fadeup-kf 0.28s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.00s; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.10s; }
.stagger > *:nth-child(4) { animation-delay: 0.15s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }

@media (prefers-reduced-motion: reduce) {
  .anim-fadeup, .anim-fadein, .anim-modal, .anim-blink, .anim-glow,
  .stagger > * { animation: none !important; }
}

/* ── Scrollbar theming ── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--card-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--card-border-hi); }

/* ── Button primary — Sentinel shadow ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(3, 37, 189, 0.30);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(3, 37, 189, 0.40);
  filter: brightness(1.08);
}

/* ── Input focus — Sentinel accent ring ── */
.fi:focus, .fta:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(3, 37, 189, 0.12);
}
