/**
 * Asian International Machinery Portal — Interactive Engineering Studio Stylesheet
 * 
 * Production design system for:
 * - 3D WebGL Viewport, HUD tray, Hotspots, and Inspection Modals
 * - Turnkey RFQ Configurator grids, pills, and utility metrics
 * - Industrial CAPEX/ROI financial dashboard & 5-Year Cash Flow Trajectory
 * - Commercial Proposal Quotation modal and `@media print` layout
 */

/* ==========================================================================
   1. Design Tokens & Studio Layout
   ========================================================================== */
:root {
  --primary: #0f172a;       /* Slate-900: primary dark brand color */
  --primary-light: #1e293b; /* Slate-800: secondary dark */
  --accent: #dc2626;        /* Crimson Red: high-impact primary buttons */
  --accent-hover: #b91c1c;  /* Dark red hover state */
  --gold: #d97706;          /* Amber-600: secondary accents */
  --gold-light: #fef3c7;    /* Warm gold badge background */
  --cyan: #0ea5e9;          /* Cyan-500: telemetry and tech highlights */
  --text-main: #0f172a;     /* Body text */
  --text-muted: #64748b;    /* Slate-500: descriptions, specs labels */
  --bg-page: #f8fafc;       /* Slate-50: cool page background */
  --bg-card: #ffffff;       /* Pure white card backgrounds */
  --border-color: #e2e8f0;  /* Slate-200: standard borders */
  --border-focus: #94a3b8;  /* Slate-400: input focus borders */
  --success: #16a34a;       /* Green-600: verified badges, ROI positive */
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.25);
}

/* Studio Hero */
.studio-hero {
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.studio-hero-container {
  max-width: 1100px;
  margin: 0 auto;
}

.studio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.studio-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: #ffffff;
}

.studio-subtitle {
  font-size: 1.15rem;
  color: #94a3b8;
  max-width: 780px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.studio-nav-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.studio-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.studio-pill-link:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Master Studio Sections */
.studio-main-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.studio-section {
  margin-bottom: 4rem;
  scroll-margin-top: 2rem;
}

.section-intro-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-intro-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.section-intro-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ==========================================================================
   2. 3D WebGL Machinery Inspection Viewport
   ========================================================================== */
.machinery-viewer-wrapper {
  background: #090d16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.machinery-viewer-root {
  width: 100%;
  height: 580px;
  min-height: 440px;
  position: relative;
  overflow: hidden;
  user-select: none;
  outline: none;
}

.machinery-viewer-root:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* 3D Top Header Bar */
.viewport-header-bar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.viewport-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
}

.viewport-tag .dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

.viewport-shortcuts-hint {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
}

/* HUD Controls Tray */
.machinery-hud-tray {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 15;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hud-slider-group {
  flex: 1;
  min-width: 240px;
  max-width: 360px;
}

.hud-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.hud-value {
  color: #f87171;
  font-family: monospace;
  font-size: 0.9rem;
}

/* Styled Range Input */
input[type="range"]#explodeSlider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #334155;
  outline: none;
  cursor: pointer;
}

input[type="range"]#explodeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.8);
  cursor: pointer;
  border: 2px solid #ffffff;
  transition: transform 0.1s ease;
}

input[type="range"]#explodeSlider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.hud-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: rgba(220, 38, 38, 0.8);
  border-color: var(--accent);
}

.hud-preset-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-preset-btn:hover,
.hud-preset-btn.active {
  background: rgba(220, 38, 38, 0.25);
  color: #ffffff;
  border-color: var(--accent);
}

.hud-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-icon-btn:hover,
.hud-icon-btn.active {
  background: rgba(220, 38, 38, 0.3);
  color: #ffffff;
  border-color: var(--accent);
}

/* Screen-Space Hotspot Pins */
.hotspot-pin {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #ef4444;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
  outline: none;
}

.hotspot-pin:hover,
.hotspot-pin:focus-visible {
  transform: scale(1.25) !important;
  border-color: #fca5a5;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.9);
}

.pin-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.4);
  animation: hotspotPulse 2s infinite ease-out;
  pointer-events: none;
}

@keyframes hotspotPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

.pin-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Floating Tooltip */
.hotspot-tooltip {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 220px;
  text-align: left;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 20;
}

.hotspot-pin:hover .hotspot-tooltip,
.hotspot-pin:focus-visible .hotspot-tooltip {
  opacity: 1;
  visibility: visible;
  bottom: 48px;
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.tooltip-id {
  background: var(--accent);
  color: #ffffff;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
}

.tooltip-title {
  font-size: 0.85rem;
  color: #ffffff;
}

.tooltip-body {
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.tooltip-prompt {
  font-size: 0.65rem;
  color: #38bdf8;
  font-weight: 600;
  text-transform: uppercase;
}

/* Inspection Modal Backdrop */
.machinery-inspection-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
  animation: fadeIn 0.2s ease-out;
}

.machinery-inspection-modal {
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  padding: 1.75rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.modal-badge {
  display: inline-block;
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.4);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.5rem;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.6rem;
}

.modal-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.modal-specs-table th,
.modal-specs-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.modal-specs-table th {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  width: 38%;
}

.modal-specs-table td {
  color: #ffffff;
}

.modal-maintenance-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  color: #fde68a;
  font-size: 0.85rem;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   3. Turnkey RFQ Configurator Cards & Forms
   ========================================================================== */
.rfq-configurator-card,
.capex-roi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  padding: 2rem;
  margin-bottom: 2rem;
}

.config-card-header,
.roi-card-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.badge-tag {
  display: inline-block;
  background: #fef2f2;
  color: var(--accent);
  border: 1px solid #fecaca;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.config-title,
.roi-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.config-subtitle,
.roi-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

.config-grid-layout,
.roi-grid-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.25rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.form-unit-hint {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.8rem;
}

.form-select,
.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.92rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Pills Button Group */
.pills-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-btn {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.25);
}

/* Radio Cards Grid */
.radio-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.radio-card {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-page);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card:hover {
  border-color: #cbd5e1;
}

.radio-card.active {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.rc-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.rc-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Currency Toggles */
.currency-toggle-group {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-page);
}

.curr-btn {
  background: transparent;
  border: none;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.curr-btn:hover {
  color: var(--primary);
}

.curr-btn.active {
  background: var(--primary);
  color: #ffffff;
}

/* Summary Display Box */
.summary-display-box {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.summary-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.display-price-wrap {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 1.25rem;
}

.summary-big-price {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.summary-tax-note {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
  display: block;
}

.summary-cost-breakdown {
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.cost-row strong {
  color: #ffffff;
}

.metrics-subheading {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.5rem 0 0.85rem;
}

.utility-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.utility-metric-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.metric-icon {
  font-size: 1.25rem;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0.1rem 0;
}

.metric-sub {
  font-size: 0.7rem;
  color: #38bdf8;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ==========================================================================
   4. Industrial CAPEX Financing & ROI Results
   ========================================================================== */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
}

.kpi-card.highlight-card {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.kpi-card.highlight-card .kpi-value {
  color: #2563eb;
}

.kpi-card.success-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.kpi-card.success-card .kpi-value {
  color: #16a34a;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.25rem 0;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 5-Year Cash Flow Trajectory Chart */
.cash-flow-section {
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
}

.cash-flow-bars-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  align-items: flex-end;
  height: 160px;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.cash-flow-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar-visual-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cf-bar {
  width: 70%;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.cf-bar.cf-positive {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.cf-bar.cf-negative {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.cf-amount {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0.4rem;
  white-space: nowrap;
}

.cf-year {
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
}

/* Savings Breakdown Card */
.savings-breakdown-card {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
}

.sb-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border-color);
  color: var(--text-main);
}

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

.negative-text {
  color: #dc2626;
}

/* ==========================================================================
   5. Commercial Proposal Quotation Modal
   ========================================================================== */
.proposal-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

.proposal-modal-container {
  max-width: 960px;
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
  position: relative;
}

.proposal-top-action-bar {
  background: var(--primary);
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.ref-tag {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.proposal-close-btn {
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.5rem;
}

/* Printable Document Sheet */
.printable-proposal-document {
  padding: 3rem;
  background: #ffffff;
  color: #0f172a;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.doc-brand-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0.15rem 0;
}

.brand-hq {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.meta-block {
  text-align: right;
}

.meta-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.meta-table {
  font-size: 0.82rem;
  border-collapse: collapse;
}

.meta-table th {
  text-align: right;
  padding: 0.15rem 0.5rem;
  color: var(--text-muted);
}

.meta-table td {
  text-align: left;
  padding: 0.15rem 0.5rem;
  color: var(--primary);
}

.status-badge {
  background: #dcfce7;
  color: #16a34a;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.75rem;
}

.doc-client-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.client-card .section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

.client-card p {
  margin: 0.25rem 0;
  font-size: 0.88rem;
  color: var(--primary);
}

.doc-section {
  margin-bottom: 2rem;
}

.doc-section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.doc-spec-table,
.doc-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.doc-spec-table th,
.doc-spec-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.doc-spec-table th {
  background: var(--bg-page);
  color: var(--primary);
  font-weight: 600;
}

.doc-price-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.doc-price-table .highlight-row td {
  background: #f8fafc;
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
}

.ddp-usd {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.ddp-pkr {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.utility-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.utility-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
}

.uc-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.uc-val {
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0.2rem 0;
}

.uc-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.roi-summary-strip {
  display: flex;
  justify-content: space-around;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.roi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.85rem;
}

.roi-item span {
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.roi-item strong {
  font-size: 1.15rem;
  color: #16a34a;
}

.doc-terms-list {
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.6;
}

.doc-terms-list li {
  margin-bottom: 0.4rem;
}

.doc-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
}

.sig-line {
  width: 220px;
  height: 1px;
  background: var(--primary);
  margin-bottom: 0.75rem;
}

/* Floating Dispatch Tray */
.proposal-dispatch-tray {
  background: var(--bg-page);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
}

.tray-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 1rem;
}

.dispatch-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
}

.dispatch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #1ebc59;
  transform: translateY(-1px);
}

.btn-whatsapp-secondary {
  background: #128c7e;
  color: #ffffff;
}

.btn-whatsapp-secondary:hover {
  background: #0d7065;
  transform: translateY(-1px);
}

.btn-wechat {
  background: #07c160;
  color: #ffffff;
}

.btn-wechat:hover {
  background: #06a853;
  transform: translateY(-1px);
}

.proposal-toast-msg {
  margin-top: 0.85rem;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   6. Print Stylesheet (@media print)
   ========================================================================== */
@media print {
  /* Hide all interactive screen elements */
  body * {
    visibility: hidden;
  }

  .no-print,
  .top-bar,
  header,
  footer,
  .studio-hero,
  .machinery-viewer-wrapper,
  .rfq-configurator-card,
  .capex-roi-card,
  .proposal-top-action-bar,
  .proposal-dispatch-tray,
  .proposal-close-btn {
    display: none !important;
  }

  .proposal-modal-backdrop {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .proposal-modal-container {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .printable-proposal-document,
  .printable-proposal-document * {
    visibility: visible;
  }

  .printable-proposal-document {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    padding: 0 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .doc-header {
    border-bottom: 2pt solid #000000 !important;
  }

  .doc-spec-table th,
  .doc-spec-table td,
  .doc-price-table td {
    border-color: #999999 !important;
  }

  .doc-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }
}

/* ==========================================================================
   7. Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .config-grid-layout,
  .roi-grid-layout {
    grid-template-columns: 1fr;
  }

  .utility-spec-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dispatch-buttons-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .machinery-viewer-root {
    height: 440px;
  }

  .machinery-hud-tray {
    flex-direction: column;
    align-items: stretch;
  }

  .hud-slider-group {
    max-width: 100%;
  }

  .hud-presets-group {
    justify-content: center;
  }

  .form-row-2,
  .kpi-cards-grid,
  .doc-client-section {
    grid-template-columns: 1fr;
  }

  .doc-header {
    flex-direction: column;
    gap: 1rem;
  }

  .meta-block {
    text-align: left;
  }

  .printable-proposal-document {
    padding: 1.5rem;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
