:root {
  --lite-accent: #e31643;
  --lite-ink: #565555;
  --lite-muted: #666666;
  --lite-border: #e2e8f0;
  --lite-surface: #ffffff;
  --lite-surface-soft: #f8fafc;
  --lite-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body.stage-body {
  background: #f8f9fa;
  color: var(--lite-ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.stage-background.summary-portal {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f8f9fa;
}

/* Header Styles */
.stage-header {
  margin-bottom: 25px !important;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-content {
  flex: 1;
  text-align: left;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.stage-header h1 {
  color: var(--lite-accent) !important;
  font-weight: 800 !important;
  font-size: 2.2rem !important;
  margin-bottom: 4px !important;
  display: block !important;
  line-height: 1.2 !important;
}

.stage-subtitle {
  color: var(--lite-muted) !important;
  font-size: 1rem !important;
  display: block !important;
}

/* Card Overrides */
.roi-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--lite-border);
  box-shadow: var(--lite-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.roi-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.roi-card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--lite-border);
  padding: 16px 24px !important;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

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

.collapse-icon {
  color: #94a3b8;
  width: 20px;
  text-align: center;
}

.roi-card-header .collapse-icon::after {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f078";
  /* fa-chevron-down */
}

.roi-card-header .collapse-icon.expanded::after {
  content: "\f077";
  /* fa-chevron-up */
}

.roi-card-title {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
}

.header-summary {
  margin-left: 12px;
  font-size: 0.85rem;
  color: var(--lite-accent);
  font-weight: 600;
  opacity: 0.8;
}

.roi-card-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Metric Rows */
.roi-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.roi-metric-label {
  color: var(--lite-muted);
  font-size: 0.9rem;
}

.roi-metric-value {
  font-weight: 600;
  color: #1e293b;
}

.roi-metric-value.emphasis {
  color: var(--lite-accent);
  font-size: 1.1rem;
}

/* Total Bar */
.roi-card-total {
  margin-top: auto;
  background: #f1f5f9;
  padding: 16px 20px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.roi-card-total-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #475569;
}

.roi-card-total-value {
  font-weight: 800;
  font-size: 1.4rem;
  color: #1e293b;
}

.roi-card-total-value.emphasis {
  color: var(--lite-accent);
}

.roi-card-total-value.has-background {
  color: white !important;
}

.roi-card-total.highlighted {
  background: linear-gradient(135deg, #e31643, #c2133a);
  color: white !important;
}

.roi-card-total.highlighted .roi-card-total-label,
.roi-card-total.highlighted .roi-card-total-value {
  color: white !important;
}

/* Logo Styles */
.app-logo {
  height: 40px;
  width: auto;
  margin-bottom: 10px;
}

/* Modal Styling */
.modal-card-head {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.modal-card-title {
  color: #1e293b;
  font-weight: 700;
}

.modal-card-body {
  padding: 30px;
}

.field .label {
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.input {
  border-radius: 6px;
  border-color: #cbd5e1;
}

.input:focus {
  border-color: var(--lite-accent);
  box-shadow: 0 0 0 0.125em rgba(227, 22, 67, 0.1);
}

/* Table styling */
.lite-finance-table {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

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

.lite-finance-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid #e2e8f0;
}

.lite-finance-table td {
  padding: 10px 12px;
  text-align: right;
  font-size: 0.85rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.lite-finance-table th:first-child,
.lite-finance-table td:first-child {
  text-align: left;
}

/* Error Box */
.lite-error {
  margin-top: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 16px;
  border-radius: 8px;
  font-weight: 500;
}

/* Chart Card */
.chart-card {
  background: white;
}

/* Header Actions Styling */
#roiHeaderActions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

#roiHeaderActions .button {
  min-width: 130px;
  height: 40px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  justify-content: center;
  padding: 0 12px;
  transition: all 0.2s ease;
  margin-bottom: 0;
}

#roiHeaderActions .button:last-child {
  margin-bottom: 0;
}

#roiHeaderActions .button.p-button-primary {
  background: linear-gradient(135deg, #e31643, #c2133a) !important;
  color: #ffffff !important;
  border: 1px solid #b80f34 !important;
  box-shadow: 0 2px 4px rgba(227, 22, 67, 0.2);
}

#roiHeaderActions .button.p-button-primary i {
  color: #ffffff !important;
}

#roiHeaderActions .button.p-button-primary:hover {
  background: linear-gradient(135deg, #f21f4f, #d51540) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(227, 22, 67, 0.3);
}

#roiHeaderActions .button.p-button-secondary {
  background: linear-gradient(135deg, #565555, #434343) !important;
  color: #ffffff !important;
  border: 1px solid #333 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#roiHeaderActions .button.p-button-secondary i {
  color: #ffffff !important;
}

#roiHeaderActions .button.p-button-secondary:hover {
  background: linear-gradient(135deg, #666, #555) !important;
  transform: translateY(-1px);
}

#roiHeaderActions .button i {
  width: 1.25rem;
  margin-right: 10px;
  font-size: 0.9rem;
}

/* Utils */
.border-bottom {
  border-bottom: 1px solid #e2e8f0;
}

.mr-4 {
  margin-right: 1.5rem;
}

/* Help Icons & Documentation */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--lite-accent);
  color: white !important;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: help;
  transition: all 0.2s ease;
  opacity: 0.8;
  vertical-align: middle;
  position: relative;
  z-index: 10;
}

.help-icon:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(227, 22, 67, 0.4);
}

.doc-modal-body {
  padding: 1.5rem;
}

.doc-modal-body h4 {
  color: #1e293b;
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.doc-modal-body p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #475569;
}

.doc-comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.doc-comparison-table th,
.doc-comparison-table td {
  padding: 12px;
  border: 1px solid var(--lite-border);
}

.doc-comparison-table th {
  background: #f8f9fa;
  font-weight: 700;
  text-align: left;
}

.doc-pill {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.doc-pill.lite {
  background: #e1f5fe;
  color: #0288d1;
}

.doc-pill.full {
  background: #fce4ec;
  color: #c2185b;
}

/* Print Styles for PDF Export */
@media print {
  @page {
    size: portrait;
    margin: 1cm;
  }

  body {
    background: white !important;
  }

  .stage-background {
    padding: 0 !important;
    margin: 0 !important;
  }

  .stage-header {
    border-bottom: 2px solid #e2e8f0 !important;
    padding-bottom: 20px !important;
    margin-bottom: 30px !important;
  }

  #roiHeaderActions,
  .lite-error,
  .modal,
  #prevFinancePage,
  #nextFinancePage,
  .pagination-controls,
  .help-icon {
    display: none !important;
  }

  .roi-results-container {
    display: block !important;
  }

  /* Force stack Bulma columns in print for consistency */
  .columns {
    display: block !important;
  }

  .column {
    display: block !important;
    width: 100% !important;
    padding: 10px 0 !important;
  }

  .roi-card {
    margin-bottom: 25px !important;
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
  }

  .collapsible-content {
    max-height: none !important;
    display: block !important;
  }

  .roi-card-header {
    cursor: default !important;
    background: #f8fafc !important;
    padding: 12px 20px !important;
  }

  .collapse-icon {
    display: none !important;
  }

  .roi-card-content {
    padding: 15px 20px !important;
  }

  .roi-metric-row {
    padding: 6px 0 !important;
  }

  .roi-card-total {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    flex-wrap: wrap !important;
    /* Prevent layout breakage with long labels */
    gap: 10px !important;
    padding: 12px 15px !important;
  }

  .roi-card-total.highlighted .roi-card-total-label,
  .roi-card-total.highlighted .roi-card-total-value {
    color: #e31643 !important;
    font-weight: 800 !important;
  }

  .chart-card {
    height: 300px !important;
    margin: 15px 0 !important;
    padding: 5px !important;
    border: 1px solid #f1f5f9 !important;
  }

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

  .lite-finance-table table {
    font-size: 8pt !important;
  }
}