/**
 * SOURX Margin Report - Modern Fintech Design System
 * Styled after Wise, Stripe, and Modern High-Fidelity Financial Dashboards
 * Typography: Plus Jakarta Sans & JetBrains Mono
 */

:root {
  /* Brand & Core Accents - SOURX Brand Identity */
  --brand-primary: #012e5c;
  --brand-primary-hover: #0a3d75;
  --brand-primary-light: #EBF3FA;
  --brand-primary-border: #BAE6FD;
  --brand-secondary: #2674a9;
  --brand-secondary-hover: #1c5d8a;
  --brand-secondary-light: #F0F7FC;
  --brand-lime: #b6e82c;
  --brand-lime-hover: #a3d41f;
  --brand-lime-light: rgba(182, 232, 44, 0.16);
  --brand-lime-border: rgba(182, 232, 44, 0.45);

  /* Surfaces & Neutrals */
  --bg-app: #F5F7FB;
  --surface-card: #FFFFFF;
  --surface-subtle: #F8FAFC;
  --surface-input: #FFFFFF;
  --border-subtle: #E8ECEF;
  --border-strong: #CBD5E1;

  /* Typography */
  --text-main: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  --text-inverted: #FFFFFF;

  /* Financial Semantics */
  --semantic-positive: #059669;
  --semantic-positive-bg: #ECFDF5;
  --semantic-positive-border: #A7F3D0;

  --semantic-warning: #D97706;
  --semantic-warning-bg: #FFFBEB;
  --semantic-warning-border: #FDE68A;

  --semantic-negative: #E11D48;
  --semantic-negative-bg: #FFF1F2;
  --semantic-negative-border: #FECDD3;

  --semantic-info: #2674a9;
  --semantic-info-bg: #EBF3FA;
  --semantic-info-border: #BAE6FD;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 2px 6px -1px rgba(16, 24, 40, 0.05), 0 1px 4px -1px rgba(16, 24, 40, 0.03);
  --shadow-card: 0 4px 20px -2px rgba(16, 24, 40, 0.04), 0 2px 6px -2px rgba(16, 24, 40, 0.02);
  --shadow-card-hover: 0 12px 30px -4px rgba(16, 24, 40, 0.08), 0 4px 10px -2px rgba(16, 24, 40, 0.04);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Tabular Numerals for Financial Data */
.font-mono,
.kpi-value,
.supplier-amt,
.donut-center-val,
.waterfall-card-val,
.data-table td.text-right {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums lining-nums;
}

/* App Shell Layout */
.app-shell {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* Sidebar Navigation (Modern Light Minimalist Style) */
.app-sidebar {
  width: 250px;
  background-color: var(--surface-card);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: transform var(--transition-smooth);
}

.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #012e5c 0%, #2674a9 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(1, 46, 92, 0.3);
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.2px;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-tagline {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-nav {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 12px 14px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background-color: var(--surface-subtle);
  color: var(--text-main);
}

.nav-link.active {
  background-color: var(--brand-primary-light);
  color: var(--brand-primary);
  font-weight: 700;
  border-left: 3px solid var(--brand-primary);
}

.nav-link svg {
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.nav-link:hover svg,
.nav-link.active svg {
  opacity: 1;
  color: var(--brand-primary);
}

/* Sidebar User Info */
.sidebar-user {
  padding: 16px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FCFDFF;
}

.user-avatar-wrap {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #EBF3FA 0%, #BAE6FD 100%);
  color: var(--brand-primary);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #FFFFFF;
  box-shadow: var(--shadow-xs);
}

.user-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--brand-lime, #b6e82c);
  border: 2px solid #FFFFFF;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-app);
}

/* Header Bar (Matching Reference Images with Search & Period Badge) */
.app-header {
  height: 70px;
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.header-center {
  flex: 1;
  max-width: 420px;
}

.global-search-pill {
  display: flex;
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  gap: 10px;
  width: 100%;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.global-search-pill:focus-within {
  border-color: var(--brand-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.global-search-pill input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--text-main);
  font-family: inherit;
}

.search-kbd {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-period-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-icon-btn:hover {
  background: #FFFFFF;
  border-color: var(--border-strong);
}

.notification-indicator {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--semantic-negative);
  border: 1.5px solid #FFFFFF;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  background-image: linear-gradient(135deg, #012e5c 0%, #0a3d75 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(1, 46, 92, 0.28);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-hover);
  background-image: linear-gradient(135deg, #0a3d75 0%, #012e5c 100%);
  box-shadow: 0 4px 14px rgba(1, 46, 92, 0.38);
}

.btn-secondary {
  background-color: #FFFFFF;
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
}

.btn-success {
  background-color: var(--semantic-positive);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-success:hover:not(:disabled) {
  background-color: #047857;
}

.btn-danger-outline {
  background: #FFFFFF;
  color: var(--semantic-negative);
  border-color: var(--semantic-negative-border);
  box-shadow: var(--shadow-xs);
}

.btn-danger-outline:hover:not(:disabled) {
  background-color: var(--semantic-negative-bg);
  border-color: var(--semantic-negative);
  color: #BE123C;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  padding: 0 !important;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 1;
}

.btn-icon-only svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

/* Page Views Container */
.page-viewport {
  padding: 32px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Modern Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
  white-space: nowrap !important;
  flex-shrink: 0;
  line-height: 1.2;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.badge-emerald {
  background-color: var(--semantic-positive-bg);
  color: var(--semantic-positive);
  border: 1px solid var(--semantic-positive-border);
}

.badge-amber {
  background-color: var(--semantic-warning-bg);
  color: var(--semantic-warning);
  border: 1px solid var(--semantic-warning-border);
}

.badge-rose {
  background-color: var(--semantic-negative-bg);
  color: var(--semantic-negative);
  border: 1px solid var(--semantic-negative-border);
}

.badge-blue {
  background-color: var(--semantic-info-bg);
  color: var(--semantic-info);
  border: 1px solid var(--semantic-info-border);
}

.badge-slate {
  background-color: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

/* Stepper Progress Bar for New Report */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--surface-card);
  padding: 16px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.step-node {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.step-title {
  font-size: 13.5px;
  font-weight: 600;
}

.step-node.completed .step-num {
  background: var(--semantic-positive-bg);
  color: var(--semantic-positive);
  border-color: var(--semantic-positive-border);
}

.step-node.completed .step-title {
  color: var(--text-main);
}

.step-node.active .step-num {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(1, 46, 92, 0.35);
}

.step-node.active .step-title {
  color: var(--brand-primary);
  font-weight: 700;
}

.step-divider {
  width: 36px;
  height: 2px;
  background: var(--border-subtle);
}

/* Upload Screen (Section 4) */
.upload-card-wrapper {
  max-width: 680px;
  margin: 20px auto 40px;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 40px;
}

.upload-header {
  text-align: center;
  margin-bottom: 30px;
}

.upload-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.upload-header p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.drop-zone {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 44px 24px;
  text-align: center;
  background: #F8FAFC;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
}

.drop-zone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--brand-primary);
  background: #FFFFFF;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.drop-zone-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.drop-zone-subtext {
  font-size: 12.5px;
  color: var(--text-muted);
}

.file-selected-card {
  margin-top: 24px;
  padding: 16px 20px;
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-info-col {
  display: flex;
  align-items: center;
  gap: 14px;
}

.file-excel-icon {
  width: 40px;
  height: 40px;
  background: var(--semantic-positive-bg);
  color: var(--semantic-positive);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.file-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-actions-row {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Quality Check View (Section 7) */
.quality-banner {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.banner-success {
  background: var(--semantic-positive-bg);
  border: 1px solid var(--semantic-positive-border);
  color: #065F46;
}

.banner-warning {
  background: var(--semantic-warning-bg);
  border: 1px solid var(--semantic-warning-border);
  color: #92400E;
}

.banner-error {
  background: var(--semantic-negative-bg);
  border: 1px solid var(--semantic-negative-border);
  color: #991B1B;
}

.quality-banner h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.quality-banner p {
  font-size: 13.5px;
  line-height: 1.5;
}

.quality-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.q-metric-card {
  background: var(--surface-card);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.q-metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.q-metric-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.q-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.q-metric-lbl {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.q-metric-status {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 8px;
}

.text-success { color: var(--semantic-positive); }
.text-warning { color: var(--semantic-warning); }
.text-danger { color: var(--semantic-negative); }

.quality-sections-card,
.quality-issues-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

/* Workbook & Sheet Inspector Styling */
.workbook-inspector-card {
  margin-bottom: 24px;
}

.sheet-selector-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.sheet-pill-btn:hover {
  border-color: var(--brand-primary-border);
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}

.sheet-pill-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.sheet-pill-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}

.sheet-pill-btn:not(.active) .sheet-pill-tag {
  background: #E0E7FF;
  color: var(--brand-primary);
}

.sheet-pill-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
}

.sheet-preview-wrap {
  padding: 16px 24px;
}

.sheet-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sheet-table-scroll {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
}

.sheet-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
}

.sheet-preview-table td {
  padding: 6px 12px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.sheet-preview-table tr.row-detected-header {
  background: #F1F5F9;
  font-weight: 700;
}

.cell-row-num {
  background: var(--surface-subtle);
  color: var(--text-subtle);
  font-weight: 600;
  text-align: center;
  width: 36px;
  user-select: none;
}

.cell-empty {
  color: var(--text-subtle);
}

.cell-blank {
  opacity: 0.3;
}

.col-tag {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  margin-bottom: 3px;
  letter-spacing: 0.3px;
  width: fit-content;
}

.tag-id { background: #E0E7FF; color: #3730A3; }
.tag-cust { background: #FEF3C7; color: #92400E; }
.tag-rev { background: #D1FAE5; color: #065F46; }
.tag-cost { background: #FEE2E2; color: #991B1B; }
.tag-supp { background: #F3E8FF; color: #6B21A8; }
.tag-po { background: #CFFAFE; color: #155E75; }
.tag-cat { background: #F1F5F9; color: #475569; }

.quality-sections-header,
.quality-issues-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: #FCFDFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quality-sections-header h4,
.quality-issues-header h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

/* Modern Audit Integrity Checklist */
.quality-sections-list {
  display: flex;
  flex-direction: column;
}

.quality-section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
  transition: background 0.15s ease;
  gap: 16px;
}

.quality-section-item:last-child {
  border-bottom: none;
}

.quality-section-item:hover {
  background: var(--surface-subtle);
}

.quality-section-item.has-issue {
  background: rgba(244, 63, 94, 0.03);
}

.quality-section-item.has-issue:hover {
  background: rgba(244, 63, 94, 0.06);
}

.q-section-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.q-status-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.q-status-icon.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.q-status-icon.icon-sky {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.q-status-icon.icon-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.q-status-icon.icon-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.q-status-icon.icon-rose {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.q-section-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.q-section-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.q-section-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.worksheet-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.worksheet-role-badge.badge-role-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.worksheet-role-badge.badge-role-sky {
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.worksheet-role-badge.badge-role-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.worksheet-role-badge.badge-role-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.q-section-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.audit-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.audit-status-pill.status-verified {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.audit-status-pill.status-clean {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.audit-status-pill.status-warning {
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.quality-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.section-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.issue-item:last-child {
  border-bottom: none;
}

.issue-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.issue-content {
  flex: 1;
}

.issue-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.issue-item-ref {
  font-size: 13px;
  color: var(--text-main);
}

.issue-desc {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.issue-action {
  font-size: 12px;
  color: var(--text-muted);
}

.quality-actions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

/* ==============================================================
 * MODERN KPI CARDS (Matching Reference Images 1 & 2)
 * ============================================================== */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  width: 100%;
  min-width: 0;
}

.kpi-card {
  background: var(--surface-card);
  padding: 16px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  min-width: 0;
  overflow: hidden;
}

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

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 6px;
}

.kpi-card-header .status-pill {
  white-space: nowrap !important;
  flex-shrink: 0;
  max-width: 100%;
  font-size: 10.5px;
  padding: 2.5px 7px;
  border-radius: 6px;
  font-weight: 700;
  gap: 3px;
}

.kpi-card-header .status-pill svg {
  width: 10px;
  height: 10px;
}

.kpi-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF !important;
  flex-shrink: 0;
}

.kpi-icon-box svg {
  width: 19px;
  height: 19px;
  stroke: #FFFFFF !important;
  color: #FFFFFF !important;
}

.icon-bg-primary,
.icon-bg-navy {
  background: linear-gradient(135deg, #012e5c 0%, #174b82 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 10px rgba(1, 46, 92, 0.28);
}

.icon-bg-emerald {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.icon-bg-violet,
.icon-bg-navy-dark {
  background: linear-gradient(135deg, #012e5c 0%, #1e5c8a 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 10px rgba(1, 46, 92, 0.25);
}

.icon-bg-amber {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.icon-bg-blue,
.icon-bg-cerulean {
  background: linear-gradient(135deg, #2674a9 0%, #175785 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 10px rgba(38, 116, 169, 0.28);
}

.icon-bg-rose {
  background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.25);
}

.icon-bg-primary svg,
.icon-bg-emerald svg,
.icon-bg-violet svg,
.icon-bg-amber svg,
.icon-bg-blue svg,
.icon-bg-rose svg {
  stroke: #FFFFFF !important;
  color: #FFFFFF !important;
}

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

.kpi-value {
  font-size: clamp(17px, 1.25vw, 22px);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin: 3px 0 5px;
  white-space: nowrap !important;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value-unit {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.2px;
  white-space: nowrap !important;
  flex-shrink: 0;
}

#kpi-orders .kpi-value {
  font-size: clamp(14px, 1.0vw, 16px);
  gap: 3px;
  white-space: nowrap !important;
  line-height: 1.2;
}

#kpi-orders .kpi-value-unit {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#kpi-orders .kpi-subtext {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.kpi-subtext {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Dashboard Cards & Layout */
.dashboard-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
  width: 100%;
  min-width: 0;
}

.dashboard-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

/* Donut & Revenue Breakdown (Section 9) */
.revenue-breakdown-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.donut-chart-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
}

.donut-segment {
  cursor: pointer;
  transition: stroke-width 0.2s ease, opacity 0.2s ease;
}

.donut-segment:hover {
  stroke-width: 38;
  opacity: 0.9;
}

.donut-center-sub {
  font-size: 11px;
  fill: #64748B;
  font-weight: 600;
}

.donut-center-val {
  font-size: 18px;
  fill: #0F172A;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.revenue-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.revenue-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.cat-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-right: 8px;
}

/* Revenue vs Cost Grouped Bar (Section 10) */
.chart-legend-row {
  display: flex;
  gap: 16px;
}

.legend-indicator-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.dot-primary { background-color: #012e5c; }
.dot-rose { background-color: #2674a9; }

.bar-chart-wrapper {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 240px;
  min-width: 0;
  overflow: hidden;
}

.bar-svg {
  width: 100%;
  height: auto;
  display: block;
}

.bar-track-bg {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.bar-group:hover .bar-track-bg {
  opacity: 1;
}

.chart-axis-tick {
  font-size: 10.5px;
  fill: #94A3B8;
  font-family: inherit;
}

.chart-axis-label {
  font-size: 12px;
  fill: #475569;
  font-weight: 700;
}

.bar-rect {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.bar-rect:hover {
  opacity: 0.85;
}

/* Waterfall Hierarchy (Section 11) */
.waterfall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.waterfall-card {
  padding: 14px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.waterfall-card.subtotal-card {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.waterfall-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.waterfall-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.waterfall-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.waterfall-card-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: block;
}

.waterfall-card-pct {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
  display: block;
}

.val-positive { color: var(--semantic-positive); }
.val-negative { color: var(--semantic-negative); }

/* Order Performance (Section 12) */
.order-performance-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.order-stat-capsules {
  display: flex;
  gap: 8px;
}

.order-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.order-capsule:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.order-capsule.active {
  background: var(--text-main);
  color: #FFFFFF;
  border-color: var(--text-main);
}

.capsule-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.dot-all { background: #64748B; }
.dot-profit { background: var(--semantic-positive); }
.dot-breakeven { background: #94A3B8; }
.dot-loss { background: var(--semantic-negative); }

.order-search-wrap {
  display: flex;
  align-items: center;
  position: relative;
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
}

.order-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  outline: none;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.order-search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.order-proportion-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: #F1F5F9;
}

.segment-profit { background: var(--semantic-positive); }
.segment-breakeven { background: #94A3B8; }
.segment-loss { background: var(--semantic-negative); }

/* Responsive Table (Wise-inspired) */
.table-responsive-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background: #FAFBFD;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.data-table th.th-actions {
  text-align: right;
  width: 140px;
  min-width: 140px;
  white-space: nowrap;
}

.data-table td.table-actions {
  text-align: right;
  width: 140px;
  min-width: 140px;
  white-space: nowrap;
  vertical-align: middle;
  padding: 10px 16px;
}

.table-actions-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  vertical-align: middle;
}

.table-actions-cluster .btn-icon-only {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.table-actions-cluster .btn-icon-only:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.table-actions-cluster .btn-icon-only:active {
  transform: translateY(0);
}

.table-actions-cluster .btn-view-report {
  color: var(--text-muted);
}

.table-actions-cluster .btn-view-report:hover {
  background-color: #EFF6FF;
  border-color: #BFDBFE;
  color: var(--brand-primary);
}

.table-actions-cluster .btn-export-report {
  color: var(--text-muted);
}

.table-actions-cluster .btn-export-report:hover {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
  color: var(--text-main);
}

.table-actions-cluster .btn-delete-report {
  color: var(--semantic-negative);
  border-color: var(--semantic-negative-border);
}

.table-actions-cluster .btn-delete-report:hover {
  background-color: var(--semantic-negative-bg);
  border-color: #FDA4AF;
  color: #BE123C;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: #F8FAFD;
}

.row-loss-warning {
  background: #FFF1F2 !important;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
}

.sortable-th:hover {
  color: var(--text-main);
}

.sort-icon-svg {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
}

.sort-icon-svg.inactive {
  opacity: 0.35;
}

.sort-icon-svg.active {
  color: var(--brand-primary);
}

.client-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: #EDE9FE;
  color: #6D28D9;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-name {
  font-weight: 600;
  color: var(--text-main);
}

.category-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.tag-bags { background: #EEF2FF; color: #4338CA; }
.tag-garments { background: #ECFDF5; color: #065F46; }
.tag-printing { background: #FDF4FF; color: #86198F; }
.tag-logistics { background: #FFFBEB; color: #92400E; }

.badge-missing-po {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--semantic-warning);
  background: var(--semantic-warning-bg);
  border: 1px solid var(--semantic-warning-border);
  padding: 2px 7px;
  border-radius: 4px;
}

.supplier-cell {
  display: flex;
  flex-direction: column;
}

.supplier-main {
  font-weight: 600;
}

.table-footer-info {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  font-weight: 500;
}

/* Supplier Breakdown (Section 13) - Executive Display */
.supplier-section-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Supplier Mini Stat Strip */
.supplier-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #F8FAFC;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.supplier-stat-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.supplier-stat-card .stat-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.supplier-stat-card .stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.supplier-stat-card .stat-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Vendor Grid Layout */
.supplier-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.vendor-card {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
}

.vendor-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
}

.vendor-card-leader {
  border-color: #BAE6FD;
  background: linear-gradient(180deg, #FFFFFF 0%, #F0F9FF 100%);
}

.vendor-card-leader::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284C7 0%, #082F5B 100%);
}

.vendor-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vendor-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.vendor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.vendor-rank-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  font-size: 9px;
  font-weight: 800;
  background: #0F172A;
  color: #FFFFFF;
  padding: 1px 4px;
  border-radius: 10px;
  border: 1.5px solid #FFFFFF;
  line-height: 1.1;
}

.vendor-rank-badge.rank-gold {
  background: #D97706;
}

.vendor-rank-badge.rank-silver {
  background: #64748B;
}

.vendor-rank-badge.rank-bronze {
  background: #92400E;
}

.vendor-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.vendor-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-po-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.vendor-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vendor-cost-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.vendor-cost-val {
  font-size: 17px;
  font-weight: 800;
  color: #082F5B;
  letter-spacing: -0.3px;
}

.vendor-share-badge {
  font-size: 11px;
  font-weight: 700;
  color: #0369A1;
  background: #E0F2FE;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #BAE6FD;
}

.vendor-progress-track {
  height: 6px;
  background: #F1F5F9;
  border-radius: 999px;
  overflow: hidden;
}

.vendor-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ranked Bars View */
.supplier-bars-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supplier-table-row {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.supplier-table-row:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

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

.supplier-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.supplier-values-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Segmented Control in Card Title */
.segmented-control {
  display: inline-flex;
  align-items: center;
  background: #F1F5F9;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.segmented-btn {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.segmented-btn:hover {
  color: var(--text-main);
}

.segmented-btn.active {
  background: #FFFFFF;
  color: #082F5B;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Attention Required (Section 14) */
.attention-required-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
}

.attention-clean-state {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.clean-check-circle {
  width: 34px;
  height: 34px;
  background: var(--semantic-positive);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.attention-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.attention-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.attention-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #FEF3C7;
  color: #D97706;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attention-title-wrap h4 {
  font-size: 15px;
  font-weight: 800;
  color: #92400E;
}

.attention-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attention-item {
  background: #FFFFFF;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.attention-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.attention-item-desc {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.attention-item-rec {
  font-size: 12px;
  color: #92400E;
}

/* Tooltip global */
.chart-tooltip {
  position: absolute;
  display: none;
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.tooltip-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #CBD5E1;
}

/* Client Mode Presentation Overrides (Section 16) */
body.client-mode .app-sidebar,
body.client-mode .app-header,
body.client-mode .wizard-stepper,
body.client-mode .internal-accounting-note,
body.client-mode .btn-accounting-only,
body.client-mode .attention-required-card,
body.client-mode #btn-preview-client {
  display: none !important;
}

body.client-mode .app-shell {
  display: block;
  width: 100%;
}

body.client-mode .app-main {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

body.client-mode .page-viewport {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 36px;
  width: 100%;
}

body.client-mode .client-exit-banner {
  display: flex;
}

.client-exit-banner {
  display: none;
  width: 100%;
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 32px;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.client-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-badge-live {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--semantic-positive);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Client Report Header Styling */
.client-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  min-width: 0;
}

.report-org-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.report-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 4px 0 2px;
}

.report-main-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.dash-status-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Interactive Status Selector Pill (Directly Changeable by User) */
.status-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.status-select-pill {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 4px 22px 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
  cursor: pointer;
  outline: none;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.status-select-pill:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.status-select-pill:focus {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

.status-chevron {
  position: absolute;
  right: 7px;
  pointer-events: none;
  opacity: 0.65;
}

/* Accounting Review Card (Section 15) */
.accounting-review-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 32px;
  max-width: 860px;
  margin: 0 auto;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.review-header h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 6px 0 2px;
}

.review-kpi-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.r-kpi {
  background: var(--surface-subtle);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.r-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.r-val {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 2px;
}

.r-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.review-exceptions-box {
  background: var(--semantic-warning-bg);
  border: 1px solid var(--semantic-warning-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.review-exc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13.5px;
  color: #92400E;
  margin-bottom: 8px;
}

.review-exc-list {
  padding-left: 24px;
  font-size: 13px;
  color: #78350F;
}

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

.review-left-actions {
  display: flex;
  gap: 10px;
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
  .dashboard-grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .kpis-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .kpis-grid::-webkit-scrollbar {
    height: 4px;
  }
  .kpis-grid::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
  }
}

@media (max-width: 900px) {
  .app-sidebar {
    display: none;
  }
  .quality-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-viewport {
    padding: 20px 16px;
  }
  .revenue-breakdown-content {
    flex-direction: column;
  }
}

/* ==========================================================================
   DOCUMENTATION & USER GUIDE VIEW STYLES
   ========================================================================== */
.docs-header-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.docs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.docs-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.docs-desc {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.62;
  margin: 0;
}

.docs-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.docs-lang-switcher {
  display: inline-flex;
  background: #E2E8F0;
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.docs-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.docs-lang-btn:hover {
  color: var(--text-main);
}

.docs-lang-btn.active {
  background: #FFFFFF;
  color: var(--brand-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.docs-download-btn {
  gap: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
}

.docs-nav-pills {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.doc-nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.doc-nav-pill:hover {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border-color: var(--brand-primary-border);
  transform: translateY(-1px);
}

.doc-card {
  margin-bottom: 24px;
  padding: 30px;
}

.doc-card-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-step-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.doc-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px 0;
  letter-spacing: -0.2px;
}

.doc-section-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.doc-prose p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 16px 0;
}

.doc-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.doc-feature-box {
  background: #FAFBFD;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.doc-feature-box:hover {
  border-color: var(--brand-primary-border);
  box-shadow: var(--shadow-sm);
}

.doc-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: #FFFFFF !important;
}

.doc-feature-icon svg {
  stroke: #FFFFFF !important;
  color: #FFFFFF !important;
  display: block;
}

.doc-feature-box h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.doc-feature-box p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.doc-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.doc-step-row {
  display: flex;
  gap: 20px;
  position: relative;
}

.doc-step-marker {
  width: 86px;
  flex-shrink: 0;
}

.doc-step-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  text-align: center;
}

.doc-step-content {
  flex: 1;
  background: #FAFBFD;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}

.doc-step-content h4 {
  font-size: 17.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 10px 0;
  letter-spacing: -0.2px;
}

.doc-step-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 12px 0;
}

.doc-step-content ul {
  margin: 10px 0;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.doc-step-content li {
  margin-bottom: 6px;
}

.doc-callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.65;
}

.doc-callout strong {
  font-size: 15px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 6px;
}

.doc-callout.info {
  background: #EEF2FF;
  border-left: 4px solid var(--brand-primary);
  color: #312E81;
}

.doc-callout.success {
  background: #ECFDF5;
  border-left: 4px solid var(--semantic-positive);
  color: #065F46;
}

.doc-callout ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.65;
}

.doc-callout li {
  margin-bottom: 6px;
}

.doc-rules-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.doc-rule-item {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  box-shadow: var(--shadow-xs);
}

.doc-rule-item strong {
  font-weight: 700;
  color: var(--text-main);
}

.doc-formulas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.doc-formula-card {
  background: #FAFBFD;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
}

.doc-formula-card.full-width {
  grid-column: span 2;
  background: linear-gradient(135deg, #EEF2FF 0%, #FAFBFD 100%);
  border-color: var(--brand-primary-border);
}

.doc-formula-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand-primary);
  margin-bottom: 10px;
}

.doc-formula-math {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.doc-formula-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.doc-faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-faq-item {
  background: #FAFBFD;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}

.doc-faq-q {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.doc-faq-a {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 900px) {
  .doc-features-grid,
  .doc-rules-list,
  .doc-formulas-grid {
    grid-template-columns: 1fr;
  }
  .doc-formula-card.full-width {
    grid-column: span 1;
  }
  .doc-step-row {
    flex-direction: column;
    gap: 8px;
  }
  .doc-step-marker {
    width: auto;
  }
}

/* ==========================================================================
   PREMIUM MODAL DIALOG & TOAST SYSTEM
   ========================================================================== */
.btn-danger-solid {
  background-color: var(--semantic-negative);
  color: #FFFFFF;
  border-color: var(--semantic-negative);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.28);
}

.btn-danger-solid:hover:not(:disabled) {
  background-color: #BE123C;
  border-color: #BE123C;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.35);
  transform: translateY(-1px);
}

.sourx-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 180ms cubic-bezier(0.16, 1, 0.3, 1), visibility 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sourx-modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.sourx-modal-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
}

.sourx-modal-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: 
    0 24px 48px -12px rgba(15, 23, 42, 0.25),
    0 0 0 1px rgba(15, 23, 42, 0.05);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  transform: scale(0.94) translateY(12px);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sourx-modal-overlay.is-active .sourx-modal-card {
  transform: scale(1) translateY(0);
}

.sourx-modal-overlay.is-closing .sourx-modal-card {
  transform: scale(0.94) translateY(8px);
}

.sourx-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sourx-modal-close:hover {
  background: var(--surface-subtle);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.sourx-modal-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.sourx-modal-icon-badge.variant-danger {
  background: #FFF1F2;
  color: #E11D48;
  border: 1px solid #FECDD3;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.15);
}

.sourx-modal-icon-badge.variant-warning {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.sourx-modal-icon-badge.variant-primary {
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
}

.sourx-modal-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 6px 0;
  letter-spacing: -0.2px;
}

.sourx-modal-subtitle {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.sourx-modal-message {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 24px 0;
}

.sourx-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.modal-action-btn {
  flex: 1;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  white-space: nowrap;
  text-align: center;
}

#modal-btn-cancel {
  flex: 1;
}

#modal-btn-confirm {
  flex: 1.35;
}

/* Floating Notification Toast System */
.sourx-toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.sourx-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: 
    0 12px 30px -4px rgba(15, 23, 42, 0.16),
    0 4px 10px rgba(15, 23, 42, 0.04);
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
  max-width: 380px;
}

.sourx-toast.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.sourx-toast.is-leaving {
  transform: translateY(8px) scale(0.96);
  opacity: 0;
}

.toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: #ECFDF5;
  color: #059669;
}

.toast-danger .toast-icon {
  background: #FFF1F2;
  color: #E11D48;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.toast-message {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   REPORT EDIT MODAL & LIVE ORDER EDITOR
   ========================================================================== */

.sourx-edit-overlay {
  padding: 16px;
  z-index: 100001 !important;
}

.sourx-edit-card {
  max-width: 1040px;
  width: 96vw;
  height: 90vh;
  max-height: 860px;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-main);
  box-shadow: 0 28px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.edit-modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.edit-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.edit-modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.edit-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.2px;
}

.edit-modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.edit-modal-nav {
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.edit-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.edit-nav-tab:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-main);
}

.edit-nav-tab.active {
  background: #FFFFFF;
  color: var(--brand-primary);
  border-color: #E2E8F0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  font-weight: 700;
}

.edit-tab-counter {
  background: #E2E8F0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.edit-tab-alert-badge {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 12px;
  animation: pulse-soft 2s infinite ease-in-out;
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.edit-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #FAFAFC;
}

.edit-tab-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.edit-section-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.edit-section-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.edit-section-header-flex h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background: #FFFFFF;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.col-span-2 {
  grid-column: span 2;
}

.edit-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edit-field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.edit-poles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.edit-pole-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.edit-pole-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.edit-pole-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.edit-pole-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Callout Info in Orders tab */
.edit-callout-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 12px 16px;
  color: #1E3A8A;
}

.edit-callout-info .callout-icon {
  color: #2563EB;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Orders Tab Toolbar */
.edit-orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.edit-filter-capsules {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-filter-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.edit-filter-btn:hover {
  background: #F1F5F9;
  color: var(--text-main);
}

.edit-filter-btn.active {
  background: var(--text-main);
  color: #FFFFFF;
  border-color: var(--text-main);
}

.edit-filter-btn.has-badge {
  border-color: #FCD34D;
  background: #FFFBEB;
  color: #B45309;
}

.edit-filter-btn.has-badge.active {
  background: #D97706;
  color: #FFFFFF;
  border-color: #D97706;
}

.edit-filter-btn.has-badge-danger {
  border-color: #FECDD3;
  background: #FFF1F2;
  color: #E11D48;
}

.edit-filter-btn.has-badge-danger.active {
  background: #E11D48;
  color: #FFFFFF;
  border-color: #E11D48;
}

.edit-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.edit-search-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--text-subtle);
  pointer-events: none;
}

.edit-search-input {
  padding: 7px 12px 7px 32px;
  font-size: 12.5px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #FFFFFF;
  min-width: 220px;
  color: var(--text-main);
  transition: border-color var(--transition-fast);
}

.edit-search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

/* Orders Table in Modal */
.edit-table-scroll-container {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.edit-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.edit-orders-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #F8FAFC;
  box-shadow: 0 1px 0 var(--border-subtle);
}

.edit-orders-table th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.edit-orders-table th.th-po-highlight {
  color: #B45309;
  background: #FEF3C7;
}

.edit-orders-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.edit-orders-table tr:hover {
  background: #F8FAFC;
}

.edit-orders-table tr.row-is-loss {
  background: #FFF1F2;
}

.edit-orders-table tr.row-is-loss:hover {
  background: #FFE4E6;
}

.table-cell-input {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  background: #FFFFFF;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.table-cell-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary-light);
}

.table-cell-select {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 6px 6px;
  font-size: 12px;
  background: #FFFFFF;
  color: var(--text-main);
  cursor: pointer;
}

.table-cell-select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.input-missing-po {
  background: #FFFBEB !important;
  border-color: #F59E0B !important;
  color: #B45309 !important;
  font-weight: 600;
  box-shadow: 0 0 0 1px #F59E0B;
}

.input-missing-po::placeholder {
  color: #D97706;
  opacity: 0.9;
  font-weight: 600;
}

.input-valid-po {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: #166534;
}

.cost-is-loss {
  color: #E11D48;
  font-weight: 700;
}

.btn-delete-order-row {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-delete-order-row:hover {
  background: #FFF1F2;
  color: #E11D48;
  border-color: #FECDD3;
}

/* Edit Modal Footer */
.edit-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.edit-footer-summary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.edit-footer-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.edit-footer-stat .lbl {
  color: var(--text-secondary);
}

.edit-footer-stat .val {
  color: var(--text-main);
}

.edit-footer-stat .pct {
  color: var(--text-muted);
  font-size: 11.5px;
}

.edit-footer-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
}

.edit-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hide edit triggers in client view presentation mode */
body.client-mode #btn-edit-report,
body.client-mode #btn-fix-report-issues,
body.client-mode .btn-edit-orders {
  display: none !important;
}

/* --------------------------------------------------------------------------
   EXECUTIVE FORM CONTROLS & REPORT EDIT MODAL ENHANCEMENTS
   -------------------------------------------------------------------------- */

/* Standardized Executive Form Controls */
.form-input,
.form-select {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 600;
  color: #0F172A;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.4;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}

.form-input:hover,
.form-select:hover {
  border-color: #94A3B8;
  background-color: #FFFFFF;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #0284C7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background-color: #FFFFFF;
}

/* Remove spin buttons on number inputs for clean executive look */
input[type="number"].form-input::-webkit-inner-spin-button,
input[type="number"].form-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].form-input {
  -moz-appearance: textfield;
}

/* Affix group (Currency £ / Percent %) */
.input-affix-group {
  display: flex;
  align-items: stretch;
  position: relative;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.input-affix-group .form-input {
  flex: 1;
  min-width: 0;
  box-shadow: none;
}

.input-affix-group .input-affix-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #64748B;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-right: none;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  user-select: none;
  transition: all 0.15s ease;
}

.input-affix-group .input-affix-suffix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-left: none;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  user-select: none;
  transition: all 0.15s ease;
}

.input-affix-group:focus-within .input-affix-prefix,
.input-affix-group:focus-within .input-affix-suffix {
  border-color: #0284C7;
  color: #0284C7;
  background: #F0F9FF;
}

.input-affix-group .form-input:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-affix-group .form-input:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-affix-group:focus-within .form-input {
  border-color: #0284C7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  z-index: 1;
}

/* Styled Form Select */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: 32px;
  cursor: pointer;
  white-space: nowrap;
}

/* Modern Card Sections in Edit Modal */
.edit-card-section {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.edit-card-section:hover {
  border-color: #CBD5E1;
}

.edit-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
  gap: 16px;
}

.edit-section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-section-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.01em;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.edit-section-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.edit-section-badge-navy {
  background: #082F5B;
  color: #FFFFFF;
}

.edit-section-badge-blue {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.edit-section-desc {
  font-size: 12px;
  color: #64748B;
  margin: 0;
  line-height: 1.4;
}

.edit-section-metric-box {
  text-align: right;
  background: #F8FAFC;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}

.edit-section-metric-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748B;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.edit-section-metric-val {
  font-size: 17px;
  font-weight: 800;
  color: #082F5B;
  line-height: 1.2;
}

/* Revenue Stream Cards Grid (4 columns) */
.stream-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stream-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stream-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stream-accent, #CBD5E1);
}

.stream-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.stream-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stream-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1E293B;
  letter-spacing: -0.01em;
}

.stream-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stream-accent, #64748B);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.stream-card-hint {
  font-size: 10.5px;
  color: #64748B;
  line-height: 1.3;
}

/* Modern Fiscal Reconciliation Strip */
.fiscal-recon-card {
  margin-top: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.fiscal-recon-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.fiscal-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fiscal-field-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.fiscal-arrow {
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fiscal-result-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fiscal-result-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #082F5B;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Cost Reconciliation Strip */
.cost-recon-card {
  margin-top: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cost-recon-card .highlight-val {
  font-size: 14.5px;
  font-weight: 800;
  color: #082F5B;
}

.cost-margin-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  padding: 6px 12px;
  border-radius: 8px;
}

.cost-margin-highlight .fiscal-field-label {
  color: #166534;
}

/* Modern Cost Categories Table */
.modern-flows-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  background: #FFFFFF;
  font-size: 12.5px;
}

.modern-flows-table thead tr {
  background: #F8FAFC;
}

.modern-flows-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid #E2E8F0;
}

.modern-flows-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.modern-flows-table tbody tr:hover td {
  background: #F8FAFC;
}

.modern-flows-table tbody tr:last-child td {
  border-bottom: 1px solid #E2E8F0;
}

.modern-flows-table tfoot tr {
  background: #F8FAFC;
}

.modern-flows-table tfoot td {
  padding: 10px 14px;
  border-bottom: none;
}

/* Modern Delete Button */
.btn-del-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-del-icon:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

/* Modern Waterfall Flow Cards (7 Cards) */
.waterfall-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
}

.waterfall-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.waterfall-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--wf-color, #94A3B8);
}

.waterfall-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.waterfall-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.waterfall-card-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #334E68;
  line-height: 1.25;
}

.waterfall-card-sub {
  font-size: 9.5px;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.waterfall-card-pct {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--wf-color, #082F5B);
  font-family: var(--font-mono);
}

/* Net Margin Highlight Card */
.waterfall-card-net {
  background: linear-gradient(180deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 1.5px solid #86EFAC;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.waterfall-card-net .waterfall-card-title {
  color: #065F46;
  font-weight: 800;
}

.waterfall-card-net .waterfall-card-sub {
  color: #047857;
  font-weight: 700;
}

/* ==========================================================================
   PDF EXPORT DESIGN SELECTOR MODAL
   ========================================================================== */

.sourx-export-overlay {
  z-index: 10001;
  padding: 20px;
}

.sourx-export-card {
  max-width: 860px;
  width: 95vw;
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-main);
  box-shadow: 0 28px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.export-modal-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.export-modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.export-modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.export-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.2px;
}

.export-modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.export-designs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px;
  background: #FAFAFC;
}

.export-design-card {
  position: relative;
  background: #FFFFFF;
  border: 2px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.export-design-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
}

.export-design-card.active {
  border-color: var(--brand-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px var(--brand-primary-light), 0 8px 24px -4px rgba(79, 70, 229, 0.15);
}

.design-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-active {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.badge-pending {
  background: #F8FAFC;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

.design-thumbnail-preview {
  height: 120px;
  border-radius: 10px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.export-design-card.active .design-thumbnail-preview {
  border-color: #C7D2FE;
  background: #F8FAFF;
}

/* Design 1 Miniature wireframe */
.design-thumb-1 .thumb-header {
  height: 8px;
  width: 60%;
  background: #0F172A;
  border-radius: 3px;
}

.design-thumb-1 .thumb-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.design-thumb-1 .thumb-kpis span {
  height: 18px;
  background: #E2E8F0;
  border-radius: 3px;
}

.design-thumb-1 .thumb-charts {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6px;
  height: 34px;
}

.design-thumb-1 .thumb-donut {
  background: #E2E8F0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 4px solid #4F46E5;
}

.design-thumb-1 .thumb-bars {
  background: #E2E8F0;
  border-radius: 4px;
}

.design-thumb-1 .thumb-table {
  flex: 1;
  background: #E2E8F0;
  border-radius: 3px;
}

/* Placeholder for Designs 2 & 3 */
.thumb-placeholder-box {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.thumb-placeholder-box svg {
  stroke: #94A3B8;
}

.design-info h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.design-info p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.design-radio-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  margin-top: auto;
}

.export-design-card.active .design-radio-indicator {
  border-color: var(--brand-primary);
}

.export-design-card.active .radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-primary);
}

.export-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.export-footer-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}


