/* ═══════════════════════════════════════════════════════════════════════
   style.css — INAPROC Intelligence v2
   Design system: C-Level enterprise analytics (Power BI / Tableau grade)
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── RESET & TOKENS ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

:root {
  /* Typography */
  --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Brand */
  --red-primary: #C8102E;
  --red-light: #FEF0F2;
  --red-dark: #8B0000;

  --navy: #0D1B2A;
  --navy-mid: #1B2A3B;
  --navy-light: #2E4057;

  --slate: #5D6D7E;
  --slate-light: #85929E;
  --surface: #F7F9FC;
  --surface-alt: #EFF3F8;
  --border: #E8ECF0;
  --border-soft: #F0F4F8;
  --white: #FFFFFF;

  /* Semantic */
  --ict-blue: #1B4F72;
  --ict-green: #0E6655;
  --gold: #B7770D;
  --purple: #4A235A;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(13, 27, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(13, 27, 42, 0.08);
  --shadow-lg: 0 12px 36px rgba(13, 27, 42, 0.12);
  --shadow-red: 0 8px 24px rgba(200, 16, 46, 0.18);

  /* Layout */
  --sidebar-w: 260px;
  --hero-h: 160px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--navy-light);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.2px;
}

/* ─── LOADING OVERLAY (initial + chunk) ─── */
#loading-overlay,
#chunk-loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(13, 27, 42, 0.98), rgba(27, 42, 59, 0.96));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  backdrop-filter: blur(12px);
  transition: opacity 0.35s ease;
}

#loading-overlay.hidden,
#chunk-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.5px;
}

.loading-logo .accent {
  color: var(--red-primary);
}

.loading-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-container {
  width: min(420px, 80vw);
  text-align: center;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-primary), #FF3351);
  border-radius: 999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 16px rgba(200, 16, 46, 0.5);
}

.progress-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ─── AUTH SCREEN ─── */
#auth-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0D1B2A 0%, #1B2A3B 50%, #0D1B2A 100%);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#auth-screen.hidden {
  display: none;
}

.login-box {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-xl);
  padding: 44px 36px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-top: 5px solid var(--red-primary);
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-box .lock {
  font-size: 42px;
  margin-bottom: 12px;
}

.login-box h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--navy);
}

.login-box p {
  color: var(--slate);
  font-size: 13px;
  margin: 0 0 28px;
  line-height: 1.6;
}

.login-box input[type="password"] {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
  background: var(--surface);
}

.login-box input[type="password"]:focus {
  outline: none;
  border-color: var(--red-primary);
  background: #FFF;
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--red-primary);
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-login:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-red);
}

.btn-login:active {
  transform: translateY(0);
}

.login-error {
  display: none;
  margin-top: 14px;
  font-size: 13px;
  color: var(--red-primary);
  font-weight: 600;
  animation: shake 0.4s ease;
}

.login-error.show {
  display: block;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0)
  }

  25% {
    transform: translateX(-6px)
  }

  75% {
    transform: translateX(6px)
  }
}

.login-box .footer-text {
  margin-top: 26px;
  font-size: 11px;
  color: var(--slate-light);
  line-height: 1.7;
}

/* ─── APP SHELL ─── */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.app-layout.hidden {
  display: none;
}

/* ─── SIDEBAR ─── */
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy) 100%);
  color: #FFF;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.sidebar-header {
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.sidebar-header .logo {
  font-size: 24px;
  margin-bottom: 6px;
}

.sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #FFF;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.sidebar-header .subtitle {
  font-size: 9.5px;
  color: var(--slate-light);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}

.badge-status {
  display: inline-block;
  background: rgba(14, 102, 85, 0.2);
  color: #52D9B9;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  margin: 10px 0 0;
  letter-spacing: 0.3px;
}

.sidebar-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--slate-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 20px 0 10px 4px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: #ECF0F1;
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: rgba(200, 16, 46, 0.15);
  border-left-color: var(--red-primary);
  color: #FFF;
}

.nav-item .nav-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* Sidebar radio filter */
.sidebar-filter {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.sidebar-filter label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sidebar-filter .radio-group {
  display: flex;
  gap: 6px;
}

.sidebar-filter .radio-btn {
  flex: 1;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ECF0F1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}

.sidebar-filter .radio-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-filter .radio-btn.active {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #FFF;
}

.sidebar-footer {
  position: absolute;
  bottom: 16px;
  left: 18px;
  right: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-btn {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: 8px;
}

.sidebar-btn:hover {
  background: rgba(200, 16, 46, 0.2);
  border-color: var(--red-primary);
}

.sidebar-footer .caption {
  font-size: 10px;
  color: var(--slate-light);
  text-align: center;
  line-height: 1.6;
  margin-top: 8px;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  padding: 28px 36px 48px;
  max-width: 1560px;
  min-width: 0;
}

/* ─── HERO ─── */
.hero {
  background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 45%, var(--navy) 100%);
  padding: 36px 44px;
  border-radius: var(--radius-xl);
  margin-bottom: 28px;
  box-shadow: var(--shadow-red);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 30%;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 50%;
}

.hero h1 {
  color: #FFF !important;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

.hero p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  margin: 8px 0 0;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

/* ─── KPI CARDS ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi {
  background: #FFF;
  border: 1.5px solid var(--border);
  border-top: 4px solid var(--red-primary);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi .lab {
  font-size: 10px;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 8px;
}

.kpi .num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
}

.kpi .sub {
  font-size: 10.5px;
  color: var(--slate-light);
  margin-top: 5px;
  font-weight: 500;
}

/* ─── SECTIONS ─── */
.dash-section {
  background: #FFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 32px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.dash-section-red {
  background: #FFF;
  border: 1.5px solid #F5C6CB;
  border-left: 5px solid var(--red-primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 26px 32px;
  margin: 20px 0;
}

.dash-section-blue {
  background: #FFF;
  border: 1.5px solid #C5D8EA;
  border-left: 5px solid var(--ict-blue);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 26px 32px;
  margin: 20px 0;
}

.sec-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sec-subtitle {
  font-size: 12.5px;
  color: var(--slate);
}

/* ─── TABS ─── */
.tabs {
  margin: 18px 0;
}

.tab-list {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  padding: 5px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.tab-list::-webkit-scrollbar {
  height: 6px;
}

.tab-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--slate);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.tab-btn:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
  background: #FFF;
  color: var(--red-primary);
  box-shadow: 0 2px 6px rgba(13, 27, 42, 0.08);
}

.tab-panel {
  background: #FFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-top: 10px;
}

/* ─── REGION / CATEGORY CARD ─── */
.rcard {
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 18px;
  border: 1.5px solid;
  border-left-width: 5px;
  box-shadow: var(--shadow-sm);
}

.rcard h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.rcard p {
  font-size: 12.5px;
  color: var(--navy-light) !important;
  margin: 2px 0;
  line-height: 1.6;
}

/* ─── CHART CARD ─── */
.chart-card {
  background: #FFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 22px 16px;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 14px;
}

/* Wrapper to lock chart canvas height — prevents infinite growth loop */
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-canvas-wrap canvas {
  max-width: 100% !important;
  display: block;
}

/* ─── TABLES ─── */
.table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #FFF;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table thead th {
  background: linear-gradient(180deg, #F7F9FC, #EFF3F8);
  color: var(--navy);
  font-family: var(--font-body);
  font-weight: 700;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 11.5px;
  letter-spacing: 0.2px;
  position: sticky;
  top: 0;
  z-index: 2;
  cursor: pointer;
  user-select: none;
}

.data-table thead th:hover {
  background: var(--surface-alt);
}

.data-table thead th.sort-asc::after {
  content: " ▲";
  color: var(--red-primary);
  font-size: 10px;
}

.data-table thead th.sort-desc::after {
  content: " ▼";
  color: var(--red-primary);
  font-size: 10px;
}

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--navy-light);
  vertical-align: top;
}

.data-table tbody tr:nth-child(even) td {
  background: #FAFBFD;
}

.data-table tbody tr:hover td {
  background: var(--red-light);
}

.data-table .num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.data-table .id-cell,
.data-table .id-col {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ict-blue);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.data-table thead th.id-col {
  min-width: 100px;
}

/* ─── SEARCH / FILTER BAR ─── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 160px;
}

.filter-item label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.filter-item input,
.filter-item select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  background: #FFF;
  color: var(--navy);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.filter-item input:focus,
.filter-item select:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

/* ─── BUTTONS ─── */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--red-primary);
  color: #FFF;
  box-shadow: 0 2px 6px rgba(200, 16, 46, 0.2);
}

.btn-primary:hover {
  background: var(--red-dark);
  box-shadow: var(--shadow-red);
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--navy);
  color: #FFF;
}

.btn-dark:hover {
  background: var(--navy-mid);
}

.btn-outline {
  background: #FFF;
  color: var(--navy);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: #F7F9FC;
  border-radius: var(--radius-md);
  margin-top: 14px;
  border: 1.5px solid var(--border);
}

/* ─── EXPANDERS / DRILL ─── */
.expander {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.expander-header {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.18s ease;
}

.expander-header:hover {
  background: var(--surface-alt);
}

.expander-header .chev {
  transition: transform 0.2s ease;
  color: var(--slate);
}

.expander.open .expander-header .chev {
  transform: rotate(90deg);
  color: var(--red-primary);
}

.expander-body {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--border);
  background: #FFF;
  display: none;
}

.expander.open .expander-body {
  display: block;
}

/* ─── RESULT SUMMARY BADGE ─── */
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: #FFF;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}

.result-badge strong {
  color: #FFD1D8;
}

/* ─── VIRTUAL SCROLL TABLE ─── */
.vtable-container {
  position: relative;
  height: 620px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #FFF;
}

.vtable-container::-webkit-scrollbar {
  width: 10px;
}

.vtable-container::-webkit-scrollbar-track {
  background: var(--surface);
}

.vtable-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

.vtable-container::-webkit-scrollbar-thumb:hover {
  background: var(--slate-light);
}

.vtable-sentinel {
  height: 1px;
  width: 100%;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--slate);
}

.empty-state .icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
}

/* ─── FOOTER ─── */
.footer-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  text-align: center;
  margin-top: 40px;
  border-top: 4px solid var(--red-primary);
  color: #FFF;
}

.footer-box .ft-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.footer-box .ft-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.footer-box .ft-dim {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── TOAST ─── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  background: #FFF;
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--slate);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--navy);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(.2, .9, .3, 1.2);
  pointer-events: auto;
  font-weight: 500;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-info {
  border-left-color: var(--ict-blue);
}

.toast-success {
  border-left-color: var(--ict-green);
}

.toast-warn {
  border-left-color: var(--gold);
}

.toast-error {
  border-left-color: var(--red-primary);
}

.toast-icon {
  font-size: 16px;
}

.toast-msg {
  line-height: 1.4;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 220px;
  }

  .main-content {
    padding: 20px 20px 36px;
  }

  .hero {
    padding: 26px 22px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .kpi .num {
    font-size: 20px;
  }

  .dash-section,
  .dash-section-red,
  .dash-section-blue {
    padding: 20px 20px;
  }
}

@media (max-width: 700px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 900;
    padding-top: 60px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: flex !important;
  }
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 950;
  width: 44px;
  height: 44px;
  background: var(--navy);
  color: #FFF;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-md);
}

/* ─── UTILITIES ─── */
.hidden {
  display: none !important;
}

.text-muted {
  color: var(--slate);
}

.text-small {
  font-size: 11px;
}

.mb-2 {
  margin-bottom: 10px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mb-4 {
  margin-bottom: 24px;
}

/* ─── DRILL-DOWN KPI MINI GRID ─── */
.kpi-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-primary);
  border-radius: 8px;
  padding: 12px 14px;
}

.kpi-mini .lab {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.kpi-mini .num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
}

/* ─── DRILL-DOWN 2-COL GRID ─── */
.drill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .drill-grid {
    grid-template-columns: 1fr;
  }
}

.drill-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}

/* ─── ID_RUP CELL — monospace so digits align ─── */
.data-table td.id-cell,
.data-table th.id-col {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--navy-light);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#MainMenu,
footer[data-testid] {
  display: none;
}