@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #13192b;
  --bg-card: rgba(22, 30, 53, 0.7);
  --border-glow: rgba(235, 178, 32, 0.15);
  --border-light: rgba(255, 255, 255, 0.08);
  --accent-solar: #eb9f20;
  --accent-solar-glow: rgba(235, 159, 32, 0.3);
  --accent-cyan: #00e6c3;
  --accent-cyan-glow: rgba(0, 230, 195, 0.25);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #334155;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Print Palette overrides */
  --print-bg: #ffffff;
  --print-text: #0f172a;
  --print-muted: #64748b;
  --print-border: #cbd5e1;
  --print-accent: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-solar);
}

/* Header Section */
header {
  background: linear-gradient(180deg, rgba(10, 14, 26, 1) 0%, rgba(19, 25, 43, 0.8) 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-solar) 0%, #ff5e36 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-display);
  box-shadow: 0 0 15px var(--accent-solar-glow);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Tab controls in header */
.tab-container {
  display: flex;
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--border-light);
  padding: 0.25rem;
  border-radius: 8px;
  gap: 0.25rem;
}

.tab-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #0a0e1a;
  background: var(--accent-solar);
  box-shadow: 0 2px 8px rgba(235, 159, 32, 0.25);
}

.actions-top {
  display: flex;
  gap: 1rem;
}

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-solar) 0%, #e68000 100%);
  color: #0a0e1a;
  box-shadow: 0 4px 12px rgba(235, 159, 32, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(235, 159, 32, 0.35);
  background: linear-gradient(135deg, #ffa826 0%, #ff8c00 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-solar);
  transform: translateY(-2px);
}

/* Dashboard Layout */
.dashboard-container {
  display: grid;
  grid-template-columns: 400px 1fr;
  flex: 1;
  height: calc(100vh - 73px);
  overflow: hidden;
}

/* Left Controls Panel */
.controls-panel {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.tab-content-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-content-panel.active {
  display: flex;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-solar);
  letter-spacing: 0.75px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.3s ease;
}

.card:hover {
  border-color: var(--border-glow);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-main);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--accent-solar);
  outline: none;
  box-shadow: 0 0 8px rgba(235, 159, 32, 0.15);
}

/* Toggle Switch Styling */
.toggle-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.toggle-wrapper:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.toggle-label-desc {
  display: flex;
  flex-direction: column;
}

.toggle-label-desc span.label-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.toggle-label-desc span.label-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 22px;
  border: 1px solid var(--border-light);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: rgba(0, 230, 195, 0.15);
  border-color: var(--accent-cyan);
}

input:checked + .switch-slider:before {
  transform: translateX(22px);
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
}

/* Range Slider Customization */
.slider-container {
  margin-top: 0.5rem;
}

.capacity-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  margin: 1rem 0;
}

.capacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-solar);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-solar-glow);
  transition: transform 0.1s ease;
}

.capacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pill-selectors {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.4rem 0.1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.pill-btn.active {
  background: rgba(235, 159, 32, 0.1);
  border-color: var(--accent-solar);
  color: var(--accent-solar);
  font-weight: 700;
}

/* Sizing Recommendation Box */
.recommendation-box {
  background: rgba(0, 230, 195, 0.03);
  border: 1px solid rgba(0, 230, 195, 0.15);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

.recommendation-box.warning {
  background: rgba(235, 159, 32, 0.03);
  border-color: rgba(235, 159, 32, 0.15);
}

.rec-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.recommendation-box.warning .rec-title {
  color: var(--accent-solar);
}

.rec-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-display);
}

.rec-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Right Content Area */
.content-area {
  display: grid;
  grid-template-columns: 440px 1fr;
  overflow: hidden;
  height: 100%;
}

/* Quick Summary Middle Panel */
.summary-panel {
  padding: 1.5rem;
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: rgba(13, 18, 33, 0.5);
}

.mega-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.mega-val {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-solar);
}

.mega-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.25rem;
}

.model-badge {
  background: rgba(0, 230, 195, 0.1);
  border: 1px solid rgba(0, 230, 195, 0.2);
  color: var(--accent-cyan);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  display: inline-block;
  font-family: var(--font-display);
}

.pricing-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-light);
}

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

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

.breakdown-value {
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-display);
}

.grand-total-card {
  background: linear-gradient(135deg, rgba(22, 30, 53, 0.9) 0%, rgba(13, 18, 33, 0.9) 100%);
  border: 2px solid var(--accent-solar);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.grand-total-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-solar), var(--accent-cyan));
}

.total-title {
  font-size: 0.75rem;
  color: var(--accent-solar);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.total-val {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Interactive Checklist */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.check-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.check-item.done {
  color: var(--text-main);
  border-color: rgba(0, 230, 195, 0.2);
  background: rgba(0, 230, 195, 0.02);
}

.check-item input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 14px;
  height: 14px;
  margin-top: 0.1rem;
  cursor: pointer;
}

/* Preview Sheet Panel (Paper Simulation) */
.preview-panel {
  background-color: #0b0f1d;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.paper-sheet {
  display: none;
  background-color: var(--print-bg);
  color: var(--print-text);
  width: 100%;
  max-width: 800px;
  min-height: 1050px;
  padding: 3.5rem 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  border-radius: 2px;
}

.paper-sheet.active {
  display: flex;
}

/* Sheet Typography */
.sheet-header {
  border-bottom: 2px solid var(--print-text);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.sheet-logo-placeholder {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: #000;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sheet-logo-placeholder span {
  background: #000;
  color: #fff;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 1rem;
}

.company-details {
  text-align: right;
  font-size: 0.75rem;
  color: var(--print-muted);
}

.proposal-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
}

.meta-block h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--print-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--print-border);
  padding-bottom: 0.2rem;
}

.meta-block p {
  font-weight: 600;
}

.proposal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--print-text);
  margin-bottom: 1.5rem;
}

.proposal-body {
  flex-grow: 1;
}

.proposal-body p {
  margin-bottom: 1rem;
  color: #334155;
  text-align: justify;
}

.sheet-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.sheet-section h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--print-text);
  margin-bottom: 0.8rem;
  border-bottom: 1.5px solid var(--print-text);
  padding-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Checklist and tables in print */
.print-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.print-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #334155;
}

.print-check-item::before {
  content: "✓";
  color: #0f766e;
  font-weight: bold;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.print-table th {
  background-color: #f8fafc;
  border-bottom: 2px solid var(--print-text);
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-weight: 700;
  color: var(--print-text);
}

.print-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--print-border);
  color: #334155;
}

.print-table tr.total-row td {
  border-top: 2px solid var(--print-text);
  border-bottom: 2px double var(--print-text);
  font-weight: 800;
  color: var(--print-text);
  font-size: 0.85rem;
  background-color: #f8fafc;
}

/* Signature block */
.signature-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  margin-top: 3.5rem;
}

.sig-line {
  border-top: 1px solid var(--print-border);
  margin-top: 2.5rem;
  padding-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--print-muted);
}

.sheet-footer {
  border-top: 1px solid var(--print-border);
  padding-top: 1rem;
  margin-top: 2rem;
  font-size: 0.7rem;
  color: var(--print-muted);
  display: flex;
  justify-content: space-between;
}

/* Responsive adjust */
@media (max-width: 1150px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .controls-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    height: auto;
    overflow: visible;
  }
  .content-area {
    grid-template-columns: 1fr;
    height: auto;
  }
  .summary-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  body {
    background-color: #fff;
    color: #000;
    min-height: auto;
    overflow: visible;
  }

  header,
  .controls-panel,
  .summary-panel,
  .actions-top,
  .btn {
    display: none !important;
  }

  .dashboard-container {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .content-area {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .preview-panel {
    padding: 0 !important;
    background: transparent !important;
    display: block !important;
    overflow: visible !important;
    height: auto !important;
  }

  .paper-sheet {
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    display: none !important;
    page-break-after: always;
  }

  .paper-sheet.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  
  .sheet-header {
    border-color: #000 !important;
  }
  
  .sheet-section h2 {
    border-color: #000 !important;
  }

  .print-table th {
    border-color: #000 !important;
  }
  
  .print-table tr.total-row td {
    border-top-color: #000 !important;
    border-bottom-color: #000 !important;
  }
}
