/*
 * AutoSpread / CN-GPT — Clean Design System (design-clean)
 * Palette: CIMB Niaga Corporate Burgundy (#7C0A1A), Vivid Red (#C8102E), Pure Light Surfaces
 * Philosophy: Simplicity, ample whitespace (8pt grid), legible typography, zero visual noise.
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Roboto:wght@300;400;500;700&family=Inconsolata:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Clean Typography Scale (12 / 14 / 16 / 20 / 24 / 32) */
  --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Poppins', sans-serif;
  --font-mono: 'JetBrains Mono', 'Inconsolata', monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;

  /* 8pt Spacing Grid (8 / 16 / 24 / 32 / 40 / 48) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Color Palette — CIMB Niaga Clean Corporate */
  --cimb-burgundy: #7C0A1A;
  --cimb-burgundy-hover: #630815;
  --cimb-burgundy-light: #FDF2F4;
  --cimb-red: #C8102E;
  --cimb-red-accent: #E02B47;
  --cimb-dark: #1E0407;

  /* Neutral Surfaces & Borders */
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --border-color: #E2E8F0;
  --border-focus: #CBD5E1;
  --border-strong: #94A3B8;

  /* High-Contrast Accessible Typography (WCAG 2.2 AA) */
  --text-main: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;

  /* Semantic Status Tokens (Clean & Legible) */
  --badge-green-bg: #ECFDF5;
  --badge-green-text: #065F46;
  --badge-green-border: #A7F3D0;

  --badge-amber-bg: #FFFBEB;
  --badge-amber-text: #92400E;
  --badge-amber-border: #FDE68A;

  --badge-red-bg: #FEF2F2;
  --badge-red-text: #991B1B;
  --badge-red-border: #FECACA;

  /* Radii & Subtle Elevations */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Accessibility: Visible Focus States */
:focus-visible {
  outline: 2px solid var(--cimb-red);
  outline-offset: 2px;
}

/* Top Navigation Bar */
.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cimb-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--cimb-burgundy-light);
  border: 1px solid rgba(124, 10, 26, 0.15);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
}

.brand-text-cimb {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--cimb-burgundy);
  letter-spacing: -0.02em;
}

.brand-text-niaga {
  color: var(--cimb-red);
}

.app-title-group h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.badge-autospread {
  font-size: var(--text-xs);
  background: rgba(124, 10, 26, 0.08);
  color: var(--cimb-burgundy);
  border: 1px solid rgba(124, 10, 26, 0.2);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-subtitle {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.status-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.status-chip .label {
  color: var(--text-muted);
  font-weight: 500;
}

.status-chip .val {
  color: var(--text-main);
  font-weight: 600;
}

/* Badge Pills */
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-pill-high {
  background-color: var(--badge-green-bg);
  color: var(--badge-green-text);
  border: 1px solid var(--badge-green-border);
}

.badge-pill-medium {
  background-color: var(--badge-amber-bg);
  color: var(--badge-amber-text);
  border: 1px solid var(--badge-amber-border);
}

.badge-pill-low {
  background-color: var(--badge-red-bg);
  color: var(--badge-red-text);
  border: 1px solid var(--badge-red-border);
}

/* Buttons (44px min target on default, 34px on sm) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  min-height: 42px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  text-decoration: none;
}

.btn-sm {
  min-height: 34px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-primary {
  background-color: var(--cimb-burgundy);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--cimb-burgundy-hover);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.btn-accent {
  background-color: var(--cimb-red);
  color: #FFFFFF;
}

.btn-accent:hover {
  background-color: #B30E28;
  box-shadow: var(--shadow-sm);
}

/* Highlighted Action Buttons (Q3: A) */
.btn-action {
  background: linear-gradient(135deg, #7C0A1A 0%, #A81228 100%);
  color: #FFFFFF !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(124, 10, 26, 0.28);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.btn-action.btn-sm {
  min-height: 34px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  box-shadow: 0 2px 8px rgba(124, 10, 26, 0.2);
}

.btn-action:hover {
  background: linear-gradient(135deg, #630815 0%, #8C0D20 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 10, 26, 0.38);
}

.btn-action:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 10, 26, 0.25);
}

.btn-action .action-arrow {
  transition: transform 0.2s ease;
  font-size: 1.1em;
  display: inline-block;
}

.btn-action:hover .action-arrow {
  transform: translateX(4px);
}

/* Stage Navigation Tabs */
.stage-tabs {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 var(--space-6);
  display: flex;
  gap: var(--space-4);
}

.stage-tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: var(--space-3) var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: all 0.15s ease;
  min-height: 48px;
}

.stage-tab-btn:hover {
  color: var(--cimb-burgundy);
}

.stage-tab-btn.active {
  color: var(--cimb-burgundy);
  border-bottom-color: var(--cimb-burgundy);
}

.step-num-bubble {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  border: 1px solid var(--border-color);
}

.stage-tab-btn.active .step-num-bubble {
  background: var(--cimb-burgundy);
  border-color: var(--cimb-burgundy);
  color: #FFFFFF;
}

/* Main Content Layout */
.main-content {
  padding: var(--space-6);
  max-width: 1680px;
  margin: 0 auto;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Cards (Clean & Minimalist) */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-2);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Active Statement Collapsed Strip & Smooth Collapsible (Q1-Q3: A) */
.active-statement-strip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--cimb-red);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  transition: all var(--transition-normal);
}

.ingestion-collapsible-wrapper {
  max-height: 1200px;
  opacity: 1;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.3s ease;
  overflow: hidden;
}

.ingestion-collapsible-wrapper.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-bottom: 0 !important;
  pointer-events: none;
}

/* Ingestion Row: Dual Sources Side-by-Side (Q1: A) */
.ingestion-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--space-5);
  align-items: stretch;
}

@media (max-width: 1100px) {
  .ingestion-grid {
    grid-template-columns: 1fr;
  }
}

/* Sample Statements Grid (2x2 in Side-by-side mode) */
.sample-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (max-width: 680px) {
  .sample-cards-grid {
    grid-template-columns: 1fr;
  }
}

.sample-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sample-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sample-card.active {
  border-color: var(--cimb-burgundy);
  background: var(--cimb-burgundy-light);
  box-shadow: 0 0 0 1px var(--cimb-burgundy);
}

.sample-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.sample-ticker-pill {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: #0F172A;
  color: #FFFFFF;
  letter-spacing: 0.05em;
}

.sample-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: var(--space-1);
}

.sample-meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Upload Dropzone & Metadata Grid */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: var(--space-5);
}

.dropzone {
  border: 2px dashed var(--border-focus);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--cimb-burgundy);
  background: var(--cimb-burgundy-light);
}

.metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.meta-field .title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.meta-field .content {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-main);
  margin-top: var(--space-1);
}

/* Annualization Banner */
.annualization-banner {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: #92400E;
}

/* Data Tables (Clean, Legible, High Usability) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover {
  background-color: #F8FAFC;
}

.data-table tr.formula-row {
  background-color: #F8FAFC;
  font-weight: 600;
}

.data-table tr.total-row {
  background-color: #F1F5F9;
  font-weight: 700;
  border-top: 2px solid var(--border-focus);
  border-bottom: 2px solid var(--border-focus);
}

.table-cell-input {
  width: 115px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: right;
  transition: all 0.15s ease;
  background-color: #FFFFFF;
}

.table-cell-input:focus {
  border-color: var(--cimb-burgundy);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 10, 26, 0.12);
}

/* Stage 2 Dual Pane Layout */
.dual-pane-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: var(--space-5);
  height: calc(100vh - 160px);
}

.pdf-pane, .spreading-pane {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pane-toolbar {
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.pdf-viewer-scroll {
  flex: 1;
  overflow: auto;
  padding: var(--space-5);
  background-color: #334155;
  display: flex;
  justify-content: center;
}

.pdf-page-wrapper {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.pdf-page-img {
  max-width: 100%;
  display: block;
}

.table-scroll-container {
  flex: 1;
  overflow-y: auto;
}

/* Executive KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.kpi-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: var(--space-2) 0;
  font-family: var(--font-mono);
}

.kpi-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  display: inline-block;
  align-self: flex-start;
}

.badge-success {
  background-color: var(--badge-green-bg);
  color: var(--badge-green-text);
  border: 1px solid var(--badge-green-border);
}

.badge-warning {
  background-color: var(--badge-amber-bg);
  color: var(--badge-amber-text);
  border: 1px solid var(--badge-amber-border);
}

.badge-danger {
  background-color: var(--badge-red-bg);
  color: var(--badge-red-text);
  border: 1px solid var(--badge-red-border);
}

/* DuPont 3-Stage Mathematical Visual Strip */
.dupont-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  margin-top: var(--space-2);
}

.dupont-block {
  text-align: center;
}

.dupont-block .d-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

.dupont-block .d-val {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin-top: var(--space-1);
}

.dupont-op {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Ratio Category Filters */
.ratio-category-filters {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

/* Multi-Step Banking Pipeline Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-modal {
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  width: 90%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.loading-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--cimb-burgundy-light);
  color: var(--cimb-burgundy);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.cimb-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--cimb-red);
}

.loading-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.loading-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  margin-bottom: var(--space-6);
}

.stepper-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stepper-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  opacity: 0.45;
  transition: all 0.2s ease;
}

.stepper-step.active {
  opacity: 1;
}

.stepper-step.completed {
  opacity: 1;
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-focus);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.stepper-step.active .step-icon {
  background: var(--cimb-burgundy);
  border-color: var(--cimb-burgundy);
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(124, 10, 26, 0.15);
}

.stepper-step.completed .step-icon {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
}

.step-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-main);
}

.step-detail {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.loading-bar-wrapper {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cimb-burgundy) 0%, var(--cimb-red) 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.loading-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* Toast Notifications */
.toast-clean {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modalFadeIn 0.2s ease;
}

@media (max-width: 950px) {
  .metadata-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 580px) {
  .metadata-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Initial Boot Loading Screen (Cold Start) */
.boot-pulse-ring-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--space-4) 0;
}

.boot-logo-box {
  width: 72px;
  height: 72px;
  background: var(--cimb-burgundy-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(124, 10, 26, 0.2);
  box-shadow: 0 0 0 6px rgba(124, 10, 26, 0.08);
  animation: bootPulse 2s infinite ease-in-out;
}

@keyframes bootPulse {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(124, 10, 26, 0.2); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 12px rgba(124, 10, 26, 0); }
  100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(124, 10, 26, 0); }
}

/* Corporate Footer (Design-Clean) */
.app-footer {
  margin-top: var(--space-8);
  padding: var(--space-6) var(--space-6);
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.footer-inner {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* --- EXECUTIVE POLISH & TIDY HEADER OVERRIDES (v2.6) --- */
.navbar {
  padding: 0.55rem 1.75rem !important;
  gap: 1rem !important;
}

.brand-container {
  gap: 0.85rem !important;
}

.cimb-logo-pill {
  padding: 3px 8px !important;
}

.brand-text-cimb {
  font-size: 1.05rem !important;
}

.status-badges {
  gap: 0.45rem !important;
  flex-wrap: nowrap !important;
}

.status-chip {
  padding: 3px 9px !important;
  font-size: 11.5px !important;
  gap: 4px !important;
}

.header-divider {
  width: 1px;
  height: 22px;
  background: #E2E8F0;
  margin: 0 4px;
}

.header-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 32px !important;
  padding: 0 12px !important;
  border-radius: 6px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.15s ease !important;
}

.header-action-btn:hover {
  transform: translateY(-1px);
}

.stage-tabs {
  padding: 0 1.75rem !important;
  gap: 1.5rem !important;
}

.stage-tab-btn {
  padding: 0.65rem 0.25rem !important;
  font-size: 13px !important;
  min-height: 44px !important;
}

.active-statement-strip {
  padding: 0.55rem 1rem !important;
  margin-bottom: 1.25rem !important;
}

.data-table th {
  padding: 0.55rem 0.85rem !important;
  font-size: 11.5px !important;
  letter-spacing: 0.02em !important;
}

.data-table td {
  padding: 0.5rem 0.85rem !important;
  font-size: 12.5px !important;
}
