/* ==========================================================================
   HỆ THỐNG THEO DÕI TIẾN ĐỘ BẢN ÁN ĐÃ, CHƯA & SẮP THI HÀNH TỈNH LÂM ĐỒNG
   Executive IOC & Multi-Dimensional Lookup UI — Modeled on NQ57 Architecture
   ========================================================================== */

:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-header: #f1f5f9;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --navy: #0c2340;
  --navy-deep: #08192e;
  --brand: #0f3d68;
  --brand-soft: #eff6ff;
  --gold: #c89d28;
  --gold-light: #fef3c7;
  --blue: #1d4ed8;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --purple: #5b21b6;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --font-sans: 'Be Vietnam Pro', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 var(--font-sans);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

@keyframes kpiSlideUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes kpiPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes barGrow {
  0% { width: 0; }
  100% { width: var(--bar-w, 0%); }
}
@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   1. INSTITUTIONAL TOPBAR & SUBBAR (NQ57 HEADER ARCHITECTURE)
   ========================================================================== */
.gov-header {
  background: linear-gradient(90deg, var(--navy-deep) 0%, var(--navy) 60%, #12345b 100%);
  color: #ffffff;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 4px 14px rgba(8, 25, 46, 0.2);
}

.gov-header-inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.seal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #dc2626, #991b1b);
  border: 1.5px solid #facc15;
  color: #fde047;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.gov-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fcd34d;
  line-height: 1.15;
}

.gov-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffffff;
  margin-top: 1px;
  line-height: 1.25;
}

.gov-tagline {
  font-size: 10.5px;
  color: #bfdbfe;
  margin-top: 1px;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

.topbar-filter-capsule {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 5px 0 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.topbar-filter-capsule:focus-within {
  border-color: #60a5fa;
  background: rgba(15, 23, 42, 0.78);
}

.capsule-divider {
  width: 1px;
  height: 16px;
  background: rgba(148, 163, 184, 0.3);
  flex-shrink: 0;
}

.quick-unit-picker {
  position: relative;
  width: 245px;
  display: flex;
  align-items: center;
}

.topbar-unit-quick-input {
  width: 100%;
  height: 24px;
  padding: 0 6px;
  font-size: 11.5px;
  background: transparent;
  border: none;
  color: #f8fafc;
  outline: none;
}

.topbar-unit-quick-input::placeholder {
  color: #cbd5e1;
}

.topbar-unit-select {
  width: auto;
  max-width: 230px;
  height: 24px;
  padding: 0 20px 0 6px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.topbar-unit-select option {
  color: #0f172a;
  background: #ffffff;
}

.quick-select-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 350px;
  max-height: 360px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
  z-index: 150;
  padding: 4px;
}

.quick-select-head {
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  color: #475569;
  background: #f1f5f9;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quick-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12px;
  color: #0f172a;
  border-radius: 4px;
  cursor: pointer;
}

.quick-select-item:hover {
  background: #eff6ff;
  color: #0f3d68;
}

.quick-select-item-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.quick-select-item-title {
  font-weight: 700;
  color: #0f172a;
}

.quick-select-item-sub {
  font-size: 10.5px;
  color: #64748b;
}

.chatbot-top-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.65);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
  transition: transform 0.12s;
}

.chatbot-top-pill:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.live-clock {
  font: 700 11px/1 var(--font-mono);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(200, 157, 40, 0.55);
  color: #fde68a;
  padding: 0 9px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Subbar Navigation */
.subbar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 49px;
  z-index: 45;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.subbar-inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  flex-wrap: wrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-btn {
  border: none;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  height: 40px;
  padding: 0 10px;
  border-radius: 0;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}

.nav-btn .nav-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.78;
}

.nav-btn:hover {
  color: var(--brand);
  background: #f8fafc;
}

.nav-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0) 0%, rgba(239, 246, 255, 0.75) 100%);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: #e2e8f0;
  color: #334155;
}

.nav-btn.active .nav-badge {
  background: var(--brand);
  color: #ffffff;
}

.nav-badge-warn {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.top-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  transition: all 0.14s ease;
}

.top-action-btn.primary-word {
  background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
  border-color: #1e3a8a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(30, 58, 138, 0.25);
}

.top-action-btn.primary-word:hover {
  background: #1d4ed8;
}

.top-action-btn.outline-slate {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}

.top-action-btn.outline-slate:hover {
  background: #f1f5f9;
  border-color: #475569;
}

.top-action-btn.outline-brand {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.top-action-btn.outline-brand:hover {
  background: #dbeafe;
}

/* ==========================================================================
   2. NQ57 6-CARD LEDGER STRIP & SNAPSHOT RECONCILIATION STRIP
   ========================================================================== */
.summary-bar {
  max-width: 1920px;
  margin: 10px auto 0;
  padding: 0 14px;
}

.ledger-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.kpi-card {
  padding: 9px 12px;
  border-right: 1px solid var(--line-soft);
  border-top: 3px solid var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.12s;
  min-width: 0;
}

.kpi-card:hover {
  background: #f1f5f9;
}

.kpi-card:last-child {
  border-right: none;
}

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

.kpi-card span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-card small {
  display: block;
  color: var(--ink-secondary);
  font-size: 10.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-card strong {
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.kpi-card.blue { border-top-color: var(--blue); }
.kpi-card.blue strong { color: var(--blue); }
.kpi-card.teal { border-top-color: var(--green); }
.kpi-card.teal strong { color: var(--green); }
.kpi-card.amber { border-top-color: var(--amber); }
.kpi-card.amber strong { color: var(--amber); }
.kpi-card.red { border-top-color: var(--red); }
.kpi-card.red strong { color: var(--red); }
.kpi-card.purple { border-top-color: var(--purple); }
.kpi-card.purple strong { color: var(--purple); }

.snapshot-strip {
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-secondary);
}

.snapshot-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.snap-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
}

.snap-pill:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.snap-pill b {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3. WORKSPACE & IOC COMMAND DECK (NQ57 ANALYTICS ARCHITECTURE)
   ========================================================================== */
.workspace {
  max-width: 1920px;
  margin: 0 auto;
  padding: 10px 14px 32px;
  display: grid;
  gap: 12px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 12px;
}

.ioc-workspace-bar {
  background: linear-gradient(135deg, #08192e 0%, #0f2c52 55%, #133968 100%);
  border: 1px solid #1e3a8a;
  border-top: 2px solid #3b82f6;
  border-radius: 8px;
  padding: 11px 14px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(8, 25, 46, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ioc-ws-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.ioc-ws-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.ioc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%);
  border: 1px solid #60a5fa;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ioc-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.32);
  display: inline-block;
  animation: kpiPulse 1.8s ease-in-out infinite;
}

.ioc-ws-heading {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.ioc-ws-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ioc-ws-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.ioc-ws-btn {
  background: rgba(15, 23, 42, 0.44);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.ioc-ws-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(147, 197, 253, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}

.ioc-ws-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #93c5fd;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
}

.ioc-ws-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-dot.all { background: #fde047; box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.25); }
.ws-dot.green { background: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25); }
.ws-dot.amber { background: #fb923c; box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.25); }
.ws-dot.red { background: #f87171; box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25); }
.ws-dot.purple { background: #c084fc; box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.25); }

.ioc-ws-btn small {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(8, 20, 38, 0.55);
  color: #93c5fd;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.ioc-ws-btn.active small {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Single Unit Active Banner */
.ioc-unit-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 15px;
  background: linear-gradient(90deg, #eff6ff, #f0fdf4);
  border: 1.5px solid #2563eb;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   4. NQ57 3-PANEL ANALYTICS CHARTS (DONUT + HORIZONTAL UNIT BARS + ALERTS)
   ========================================================================== */
.analytics-row-3 {
  display: grid;
  grid-template-columns: 1.08fr 1.36fr 1.1fr;
  gap: 12px;
  align-items: stretch;
}

.ioc-analytics-grid-bottom {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(0, 1.55fr);
  gap: 12px;
  align-items: stretch;
}

.ioc-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow);
}

.ioc-card-head {
  padding: 8px 12px;
  background: var(--surface-header);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ioc-kicker {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  line-height: 1.25;
}

.ioc-card-head h3 {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 1px;
  line-height: 1.3;
}

.ioc-card-body {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* Panel 1: Donut Chart & Status Progress Bars */
.status-panel-v3 {
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
}

.status-hero-v3 {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.donut-v3-ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12), inset 0 0 0 2px rgba(255, 255, 255, 0.65);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.donut-v3-ring:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.2);
}

.donut-v3-hole {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.08);
  padding: 4px;
}

.donut-v3-hole strong {
  font-size: 20px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.donut-v3-hole strong small {
  font-size: 12px;
  font-weight: 800;
  color: #16a34a;
}

.donut-v3-hole span {
  font-size: 9.5px;
  font-weight: 700;
  color: #475569;
  margin-top: 3px;
  line-height: 1.15;
}

.status-hero-kpis {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sh-kpi-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 3.5px solid var(--navy);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sh-kpi-box:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}

.sh-kpi-label {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.sh-kpi-val {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.sh-kpi-val small {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.sh-kpi-sub {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

.sh-kpi-split {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
}

.sh-kpi-mini {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: transform 0.12s, border-color 0.12s;
}

.sh-kpi-mini:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
}

.sh-kpi-mini span {
  font-size: 9.5px;
  font-weight: 700;
  color: #475569;
}

.sh-kpi-mini b {
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.sh-kpi-mini.green { border-top: 2.5px solid #16a34a; }
.sh-kpi-mini.green b { color: #15803d; }
.sh-kpi-mini.amber { border-top: 2.5px solid #d97706; }
.sh-kpi-mini.amber b { color: #b45309; }
.sh-kpi-mini.red { border-top: 2.5px solid #dc2626; }
.sh-kpi-mini.red b { color: #b91c1c; }

.status-bars-v3 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-bar-item-v3 {
  padding: 5px 9px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.status-bar-item-v3:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateX(2px);
}

.sb-v3-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 3px;
}

.sb-v3-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #1e293b;
}

.sb-v3-name i {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  flex-shrink: 0;
}

.sb-v3-nums {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: #0f172a;
  white-space: nowrap;
}

.sb-v3-nums small {
  color: #64748b;
  font-weight: 600;
}

.sb-v3-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.sb-v3-track > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.status-source-strip-v3 {
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}

.sss-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: #475569;
  margin-bottom: 5px;
}

.sss-bar {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  display: flex;
  overflow: hidden;
  gap: 2px;
}

.sss-bar > span {
  display: block;
  height: 100%;
  transition: width 0.4s ease;
}

/* Panel 2: Horizontal Stacked Unit Bar Chart */
.bar-legend-v3 {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 4px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.bar-legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 23px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s;
}

.bar-legend-btn:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

.bar-legend-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}
.bar-legend-btn.green.active { background: #15803d; border-color: #15803d; }
.bar-legend-btn.amber.active { background: #b45309; border-color: #b45309; }
.bar-legend-btn.red.active { background: #dc2626; border-color: #dc2626; }
.bar-legend-btn.purple.active { background: #6d28d9; border-color: #6d28d9; }

.bar-legend-btn i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.bar-legend-btn b {
  padding: 0 4px;
  border-radius: 3px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bar-legend-btn.active b {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.agency-bar-chart-v3 {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.agency-bar-row-v3 {
  padding: 5px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.12s;
}

.agency-bar-row-v3:hover {
  background: #f0f7ff;
  border-color: #60a5fa;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  transform: translateX(2px);
}

.agency-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.agency-bar-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.agency-rank-badge {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.agency-rank-badge.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #ffffff; }
.agency-rank-badge.rank-2 { background: linear-gradient(135deg, #64748b, #475569); color: #ffffff; }
.agency-rank-badge.rank-3 { background: linear-gradient(135deg, #b45309, #92400e); color: #ffffff; }

.agency-bar-name-v3 {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agency-bar-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.agency-mini-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.agency-mini-tag.over { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.agency-mini-tag.soon { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.agency-mini-tag.late { background: #f5f3ff; color: #6d28d9; border: 1px solid #c4b5fd; }
.agency-mini-tag.done { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

.agency-bar-count {
  font-size: 10.5px;
  color: #475569;
  font-weight: 600;
}
.agency-bar-count b {
  color: #0f172a;
  font-weight: 800;
}

.agency-bar-pct {
  font-size: 11px;
  font-weight: 900;
  min-width: 34px;
  text-align: right;
}

.agency-bar-stack-v3 {
  height: 7px;
  background: #f1f5f9;
  border-radius: 999px;
  display: flex;
  overflow: hidden;
  gap: 1px;
}

.agency-bar-stack-v3 > span {
  display: block;
  height: 100%;
  transition: width 0.5s ease;
}
.agency-bar-stack-v3 .seg-done { background: linear-gradient(90deg, #16a34a, #22c55e); }
.agency-bar-stack-v3 .seg-soon { background: linear-gradient(90deg, #d97706, #eab308); }
.agency-bar-stack-v3 .seg-overdue { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* Panel 3: Alert Cards & Unit Summary Blocks */
.alert-card-v2 {
  border-radius: 5px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.alert-card-v2:hover {
  transform: translateX(2px);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}
.alert-card-v2.danger { background: #fff5f5; border: 1px solid #fca5a5; border-left: 3.5px solid #dc2626; }
.alert-card-v2.warning { background: #fffbeb; border: 1px solid #fcd34d; border-left: 3.5px solid #d97706; }
.alert-card-v2.info { background: #eff6ff; border: 1px solid #93c5fd; border-left: 3.5px solid #2563eb; }
.alert-card-v2.success { background: #f0fdf4; border: 1px solid #86efac; border-left: 3.5px solid #16a34a; }

.alert-icon-v2 {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.alert-card-v2.danger .alert-icon-v2 { background: #fee2e2; color: #b91c1c; }
.alert-card-v2.warning .alert-icon-v2 { background: #fef3c7; color: #92400e; }
.alert-card-v2.info .alert-icon-v2 { background: #dbeafe; color: #1e40af; }
.alert-card-v2.success .alert-icon-v2 { background: #dcfce7; color: #166534; }

.alert-body-v2 {
  flex: 1;
  min-width: 0;
}
.alert-body-v2 b {
  display: block;
  font-size: 11.5px;
  color: #0f172a;
  line-height: 1.25;
}
.alert-body-v2 small {
  display: block;
  font-size: 10.5px;
  color: #475569;
  margin-top: 2px;
}

.unit-block-summary {
  padding: 9px 11px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s;
}
.unit-block-summary:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

/* SVG Trend & Breakdown Chart + Unit Ranking Table */
.ioc-chart-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #475569;
}
.ioc-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.ioc-line-chart {
  width: 100%;
  min-height: 185px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 8px;
}
.ioc-line-chart svg {
  width: 100%;
  height: 175px;
  display: block;
}
.ioc-line-chart .grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.ioc-line-chart .axis-label {
  fill: #475569;
  font-size: 10px;
  font-weight: 700;
}

.unit-rank-table-wrap {
  display: block !important;
  padding: 0 !important;
  width: 100%;
  max-height: 365px;
  overflow-x: auto;
  overflow-y: auto;
}

.unit-status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.unit-status-table th {
  background: var(--navy);
  color: #ffffff;
  padding: 7px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.unit-status-table td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.unit-status-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.unit-status-table tbody tr:hover { background: #eff6ff; }
.unit-status-table tbody tr.row-overdue { background: #fff5f5; }
.unit-status-table tbody tr.row-overdue:hover { background: #fee2e2; }
.unit-status-table tbody tr.row-done { background: #f0fdf4; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.status-dot.dot-done { background: #16a34a; }
.status-dot.dot-soon { background: #eab308; }
.status-dot.dot-overdue { background: #dc2626; animation: kpiPulse 1.5s ease infinite; }

/* ==========================================================================
   5. NQ57 MULTI-DIMENSIONAL LOOKUP STRUCTURE (PANELS, TABS, MASTER-DETAIL)
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-heading {
  padding: 10px 14px;
  background: var(--surface-header);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-heading h2, .panel-heading h3 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.panel-heading small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.toolbar {
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.toolbar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.view-tabs {
  display: inline-flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 5px;
  gap: 2px;
  flex-wrap: wrap;
}

.view-tabs button {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  height: 27px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
}

.view-tabs button:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.5);
}

.view-tabs button.active {
  background: #ffffff;
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.dash-filter-bar {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.1fr 0.9fr auto;
  gap: 8px;
  width: 100%;
  align-items: center;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  padding: 5px 9px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  min-height: 31px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 61, 104, 0.14);
}

.filter-checkbox-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}

.check-pill:hover {
  border-color: var(--brand);
  background: #eff6ff;
}

.check-pill input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--brand);
}

.filter-bar-spacer {
  flex: 1;
}

/* Institutional Data Table & Master-Detail Expansion */
.table-wrap, .table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

table.data-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 800;
  color: #334155;
  background: #f1f5f9;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

table.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 12.5px;
  line-height: 1.42;
}

tr.master-row {
  cursor: pointer;
  transition: background 0.12s;
}
tr.master-row:hover {
  background: #f8fafc;
}
tr.master-row.expanded {
  background: #eff6ff;
}

.expand-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 4px;
  cursor: pointer;
}

tr.master-row.expanded .expand-toggle-pill {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

tr.detail-expansion-row > td {
  padding: 0 !important;
  background: #f8fafc;
  border-bottom: 2px solid var(--brand);
}

.detail-expansion-box {
  padding: 12px 16px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid var(--brand);
}

.tier-flow-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tier-step {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: 5px;
  padding: 8px 11px;
  display: grid;
  gap: 4px;
}
.tier-step.t1 { border-left-color: var(--purple); }
.tier-step.t2 { border-left-color: var(--brand); }
.tier-step.t3 { border-left-color: var(--green); }

.tier-step-head {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
}
.tier-step.t1 .tier-step-head { color: var(--purple); }
.tier-step.t2 .tier-step-head { color: var(--brand); }
.tier-step.t3 .tier-step-head { color: var(--green); }

/* Grouped Accordion Cards for Multi-Mode Lookup */
.group-stack {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.group-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.group-header {
  padding: 9px 14px;
  background: var(--surface-header);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
}

.group-header:hover {
  background: #e2e8f0;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 800;
  color: var(--navy);
  font-size: 13px;
}

.progress-stack {
  width: 140px;
  height: 7px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}
.progress-stack > span { display: block; height: 100%; }
.progress-stack .done { background: #16a34a; }
.progress-stack .soon { background: #d97706; }
.progress-stack .overdue { background: #dc2626; }

/* Pagination Bar (.pager) */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-secondary);
}

.pager-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 28px;
  height: 27px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: #eff6ff;
}
.page-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}
.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Badges, Pills & Buttons */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-done, .badge.green { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge-upcoming, .badge.amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-pending, .badge.red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge.blue { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge.purple { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.badge.teal { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  margin: 2px 3px 2px 0;
}
.tag-unit {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  cursor: pointer;
}
.tag-unit:hover {
  background: #1d4ed8;
  color: #ffffff;
}
.tag-over3y {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.tag-compulsory {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.tag-vks {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}

.doc-code {
  display: inline-flex;
  align-items: center;
  font: 700 11px/1.2 var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.countdown-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.countdown-overdue { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.countdown-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.countdown-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.14s;
  white-space: nowrap;
}
.btn-sm {
  padding: 3px 8px;
  font-size: 11px;
}
.btn-primary {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}
.btn-secondary:hover {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}
.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

/* Directives & Proposals Cards */
.directives-list, .proposals-list {
  display: grid;
  gap: 10px;
}

.directive-card, .proposal-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  padding: 12px 15px;
  box-shadow: var(--shadow);
}

.proposal-card {
  border-left-color: #d97706;
}

.directive-top, .proposal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.proposal-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prop-box {
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 12px;
}
.prop-box h5 {
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.prop-box-report { background: #f8fafc; border: 1px solid #cbd5e1; }
.prop-box-ask { background: #fffbeb; border: 1px solid #fcd34d; }
.prop-box-response { background: #ecfdf5; border: 1px solid #6ee7b7; }

/* Subtabs */
.subtabs-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.subtab-btn {
  padding: 7px 13px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-secondary);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.subtab-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

/* Modals & Timeline */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
}
.modal-dialog.modal-xl {
  max-width: 1060px;
}

.modal-header {
  background: linear-gradient(90deg, var(--navy-deep), var(--navy));
  color: #ffffff;
  padding: 12px 16px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 14.5px;
  font-weight: 800;
}

.modal-close {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-group {
  margin-bottom: 10px;
}
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.timeline-container {
  position: relative;
  padding-left: 22px;
  border-left: 2.5px solid #2563eb;
  margin-left: 8px;
  display: grid;
  gap: 10px;
}
.timeline-item {
  position: relative;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 12px;
}
.timeline-dot {
  position: absolute;
  left: -29px;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px #2563eb;
}
.timeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.timeline-stage {
  font-weight: 800;
  font-size: 12px;
  color: #1e3a8a;
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}
.timeline-actor {
  font-size: 11.5px;
  color: #0f766e;
  font-weight: 600;
  margin-bottom: 3px;
}

/* ==========================================================================
   6. FLOATING CHATBOT FAB & ASSISTANT PANEL (LIKE NQ57)
   ========================================================================== */
.chatbot-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 190;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid #93c5fd;
  background: linear-gradient(135deg, #0c2340 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(12, 35, 64, 0.3);
  cursor: pointer;
  transition: transform 0.15s;
}
.chatbot-fab:hover {
  transform: translateY(-2px);
}

.assistant-drawer {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(450px, calc(100vw - 24px));
  height: min(580px, calc(100vh - 80px));
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 3px solid #1d4ed8;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.28);
  z-index: 210;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.assistant-drawer.open {
  display: flex;
}
.assistant-header {
  background: linear-gradient(135deg, #0c2340 0%, #163a66 100%);
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.assistant-header h4 { font-size: 13px; font-weight: 800; }
.assistant-header span { font-size: 10.5px; color: #bfdbfe; }
.assistant-suggestions {
  padding: 7px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.assistant-suggestions button {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}
.assistant-suggestions button:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}
.assistant-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.45;
  max-width: 94%;
}
.chat-user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
}
.chat-bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}
.assistant-input-bar {
  padding: 8px 10px;
  background: #ffffff;
  border-top: 1px solid #cbd5e1;
  display: flex;
  gap: 6px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Responsive Design */
@media (max-width: 1280px) {
  .ledger-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-row-3 { grid-template-columns: 1fr; }
  .ioc-analytics-grid-bottom { grid-template-columns: 1fr; }
  .ioc-ws-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proposal-columns, .tier-flow-banner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .gov-header-inner, .topbar-right { flex-wrap: wrap; width: 100%; }
  .topbar-filter-capsule { width: 100%; flex-wrap: wrap; height: auto; padding: 6px; }
  .ledger-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ioc-ws-tabs, .dash-filter-bar, .form-grid { grid-template-columns: 1fr; }
}


/* ========================================================================
   APP.JS v3 ADDITIONAL STYLES (Supplement for new HTML structure)
   ======================================================================== */

/* Legend Rows (Donut chart) */
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.76rem;
  color: #334155;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Horizontal Bar Chart */
.h-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  padding: 3px 0;
  transition: background 0.15s;
}
.h-bar-row:hover {
  background: #f8fafc;
}
.h-bar-label {
  width: 180px;
  min-width: 120px;
  font-size: 0.72rem;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-bar-track {
  display: flex;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  min-width: 20px;
  flex: 1;
}
.h-bar-seg {
  height: 100%;
  transition: width 0.4s;
}
.h-bar-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e293b;
  min-width: 28px;
  text-align: right;
}

/* Alert Items (Urgent Alerts Panel) */
.alert-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid #e2e8f0;
  transition: background 0.15s;
}
.alert-item:hover {
  background: #f8fafc;
}
.alert-item.alert-danger {
  border-color: #fecaca;
  background: #fef2f2;
}
.alert-item.alert-warning {
  border-color: #fde68a;
  background: #fffbeb;
}
.alert-item.alert-info {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.alert-body {
  flex: 1;
  font-size: 0.74rem;
  color: #1e293b;
  line-height: 1.4;
}
.alert-body strong {
  display: block;
  margin-bottom: 2px;
}
.alert-desc {
  font-size: 0.68rem;
  color: #64748b;
}

/* Snapshot Pill */
.snapshot-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.snapshot-pill:hover {
  border-color: #93c5fd;
  background: #f0f9ff;
}

/* Grouped Views */
.grouped-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
}
.grouped-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.8rem;
  border-bottom: 1px solid #e2e8f0;
}
.grouped-header:hover {
  background: #eff6ff;
}
.grouped-body {
  display: none;
  padding: 8px 14px;
}
.grouped-card.expanded .grouped-body {
  display: block;
}
.grouped-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.76rem;
}
.grouped-item:last-child {
  border-bottom: none;
}

/* Detail Row (Expandable judgment detail) */
.detail-row td {
  background: #f8fafc !important;
  border-left: 3px solid #3b82f6;
}

/* Pager Buttons */
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s;
}
.pager-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}
.pager-btn.active {
  background: #1e3a8a;
  color: #fff;
  border-color: #1e3a8a;
}

/* Pager Container */
.pager {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

/* Badge variants */
.badge.badge-overdue, .badge-overdue {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Countdown boxes */
.countdown-box {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
}
.countdown-ok {
  background: #f0fdf4;
  color: #15803d;
}
.countdown-warn {
  background: #fffbeb;
  color: #b45309;
}
.countdown-overdue {
  background: #fef2f2;
  color: #b91c1c;
}

/* Catalog card hover */
.catalog-card:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* Proposal card */
.proposal-card:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Table container scroll */
.table-container {
  overflow-x: auto;
  background: #fff;
  border-radius: 0 0 10px 10px;
}

/* Grouped container */
.grouped-container {
  padding: 8px;
}
