:root {
  --bg: #0b111e;
  --bg-card: #111a2e;
  --bg-card-alt: #16223b;
  --bg-input: #0d1526;
  --border: #233454;
  --border-hi: #3b82f6;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-hi: #fbbf24;
  --blue: #3b82f6;
  --emerald: #10b981;
  --rose: #f43f5e;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 80px;
}

.topbar {
  background: rgba(17, 26, 46, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 20px;
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b111e;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-stat {
  font-size: 12px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--text-muted);
}

.pill-stat strong {
  color: var(--emerald);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b111e;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card-alt);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--blue);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #06130e;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px;
}

.hero {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 55%),
              radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.12), transparent 55%),
              var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 22px;
}

.hero-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  max-width: 880px;
  font-size: 14.5px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 13px 16px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  border-color: #3b82f6;
  color: var(--text);
}

.tab-btn.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(17, 26, 46, 0.95));
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}

.tab-btn .tab-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 2px;
}

.tab-btn .tab-title {
  font-size: 14px;
  font-weight: 700;
  display: block;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 20px;
}

@media (max-width: 940px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 800;
}

.card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.field label span.unit {
  color: #64748b;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.section-divider {
  margin: 18px 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-box {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.kpi-box.gold {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.13), rgba(22, 34, 59, 0.9));
}

.kpi-box.emerald {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(22, 34, 59, 0.9));
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

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

.line-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

.line-table th,
.line-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(35, 52, 84, 0.65);
  text-align: left;
}

.line-table th {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.line-table td.num,
.line-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line-table tr.total-row td {
  font-weight: 800;
  color: var(--accent-hi);
  border-top: 2px solid var(--border);
  font-size: 14px;
}

.alert-callout {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--accent);
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #fde68a;
  margin: 14px 0;
}

.proposal-preview {
  background: #080d18;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #cbd5e1;
  white-space: pre-wrap;
  max-height: 270px;
  overflow-y: auto;
  margin-top: 10px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  margin-top: 3px;
  transform: scale(1.15);
  accent-color: var(--accent);
}

.check-item-body {
  flex: 1;
}

.check-item-title {
  font-size: 13px;
  font-weight: 700;
}

.check-item-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.check-item-amt {
  font-weight: 800;
  font-size: 13px;
  color: var(--emerald);
  white-space: nowrap;
}

.smoke-section {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.offer-card {
  background: linear-gradient(160deg, #16223b 0%, #0f172a 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.offer-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0b111e;
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 999px;
  width: fit-content;
}

.offer-card h3 {
  font-size: 18px;
  font-weight: 800;
}

.offer-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
}

.offer-bullets li::before {
  content: "✓ ";
  color: var(--emerald);
  font-weight: 800;
}

.offer-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.price-tag {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.price-tag span {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 500;
  margin-left: 6px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 18, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  padding: 24px;
  max-height: 92vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #10b981;
  color: #04130d;
  font-weight: 800;
  font-size: 13px;
  padding: 11px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 200;
}
