:root {
  --bg: #f5efe5;
  --surface: rgba(255, 252, 246, 0.92);
  --surface-strong: #fffaf2;
  --ink: #1f1b16;
  --muted: #6c6458;
  --line: rgba(82, 62, 36, 0.12);
  --accent: #0f766e;
  --accent-dark: #0a4f4a;
  --danger: #9f2d2d;
  --shadow: 0 28px 70px rgba(43, 31, 12, 0.12);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html { font-size: 12.8px; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 123, 42, 0.20), transparent 24%),
    radial-gradient(circle at 85% 15%, rgba(15, 118, 110, 0.16), transparent 20%),
    linear-gradient(180deg, #f7f2ea 0%, #efe7d9 100%);
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.login-copy {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.12), transparent 50%),
    linear-gradient(340deg, rgba(201, 123, 42, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.46);
}
.login-form {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(92, 77, 52, 0.08);
}
.login-submit {
  width: 100%;
  justify-content: center;
}
.login-status {
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}
.login-status.error {
  background: rgba(159, 45, 45, 0.10);
  color: var(--danger);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(92, 77, 52, 0.10);
  color: var(--accent-dark);
  font-weight: 800;
}
.user-chip .btn {
  padding: 8px 12px;
}
.page-shell { width: min(1440px, calc(100% - 26px)); margin: 18px auto 34px; }
.hero, .workspace, .main-column, .top-stack, .top-content { display: grid; gap: 24px; }
.hero { grid-template-columns: 1fr; }
.top-stack { grid-template-columns: 205px minmax(0, 1fr); align-items: start; }
.hero-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 22px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.10), transparent 35%),
    linear-gradient(270deg, rgba(201, 123, 42, 0.10), transparent 28%);
  pointer-events: none;
}
.hero-banner-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
}
.hero-overview {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.workspace { grid-template-columns: minmax(0, 1.58fr) minmax(300px, 0.78fr); align-items: start; }
.sidebar { display: grid; gap: 24px; }
.hero-card, .panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}
.hero-card, .panel { border-radius: 24px; padding: 22px; }
.hero-card { position: relative; overflow: hidden; }
.compact-general-card {
  padding: 18px 18px 16px;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.15), transparent 50%),
    linear-gradient(340deg, rgba(201, 123, 42, 0.14), transparent 60%);
  pointer-events: none;
}
.compact-general-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.compact-general-grid input {
  padding: 9px 11px;
}
.eyebrow, .panel-kicker, .hero-card-label {
  margin: 0 0 14px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
}
h1, h2, h3, h4 { margin: 0; }
h1, .panel h2 { font-family: "Playfair Display", serif; }
h1 { max-width: none; font-size: clamp(1.02rem, 1.45vw, 1.52rem); line-height: 1.02; letter-spacing: -0.02em; }
.hero-text { max-width: 62ch; margin: 4px 0 0; color: var(--muted); line-height: 1.28; font-size: 0.78rem; }
.hero-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions { justify-content: flex-end; align-items: center; position: relative; z-index: 1; }
.hero-actions .btn {
  padding: 9px 13px;
}
.section-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
}
.flow-panel {
  padding: 18px 16px;
}
.flow-panel-head h3 {
  font-size: 1.1rem;
}
.wizard-sidebar {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.section-nav-btn {
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(92, 77, 52, 0.12);
  background: rgba(255,255,255,0.78);
  color: var(--muted);
  font-weight: 800;
}
.section-nav-btn:hover {
  color: var(--ink);
  border-color: rgba(15, 118, 110, 0.3);
}
.section-nav-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  border-radius: 18px;
}
.wizard-step-number {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}
.section-nav-btn.active .wizard-step-number {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.wizard-step-text {
  font-weight: 800;
}
.wizard-step-copy {
  display: grid;
  gap: 2px;
}
.wizard-step-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.section-nav-btn.active .wizard-step-meta {
  color: rgba(255, 255, 255, 0.78);
}
.wizard-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(92, 77, 52, 0.08);
}
.wizard-toolbar h3 {
  font-size: 1.2rem;
}
.wizard-toolbar-vertical {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
}
.wizard-toolbar-vertical .btn {
  width: 100%;
}
.btn, .icon-btn {
  border: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover, .icon-btn:hover { transform: translateY(-1px); }
.btn {
  padding: 10px 15px;
  border-radius: 999px;
  font-weight: 700;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  border: 1px solid rgba(15, 118, 110, 0.16);
}
.icon-btn {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(159, 45, 45, 0.10);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}
.hero-stat-grid, .result-totals, .saved-list, .city-stack, .city-results, .lines-container, .detail-lines { display: grid; gap: 10px; }
.city-results { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.hero-stat-grid { position: relative; z-index: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.hero-stat-grid article, .result-totals article {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.65);
  padding: 10px 12px;
  border-radius: 14px;
}
.hero-summary-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}
.hero-summary-head h3 {
  font-size: 1rem;
  font-weight: 800;
}
.hero-summary-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.hero-stat-grid span, .result-totals span, .saved-meta span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.72rem; }
.hero-stat-grid strong, .result-totals strong { font-size: 0.92rem; }
.panel-header, .section-heading, .city-card-header, .line-items-header, .saved-card-top, .saved-detail-top, .result-city-head, .saved-meta, .saved-line, .detail-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.city-card-header {
  align-items: center;
}
.city-card-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.city-card-total {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.12);
  min-width: 140px;
}
.city-card-total span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.city-card-total strong {
  font-size: 1rem;
  color: var(--accent-dark);
}
.panel-header { margin-bottom: 16px; }
.panel-header h2 { font-size: 1.65rem; }
.card-block + .card-block { margin-top: 18px; }
.card-block {
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}
.section-block {
  overflow: hidden;
}
.section-block[open] {
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.06);
}
.section-summary {
  list-style: none;
  cursor: pointer;
}
.section-summary::-webkit-details-marker {
  display: none;
}
.section-summary-indicator {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-block[open] .section-summary-indicator::after {
  content: " Ocultar";
}
.section-block:not([open]) .section-summary-indicator::after {
  content: " Mostrar";
}
.section-body {
  padding-top: 4px;
}
.section-heading { margin-bottom: 14px; align-items: end; }
.section-heading p, .city-card-title p, .line-items-header p, .empty-state, .saved-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.form-grid, .currency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.city-grid { grid-template-columns: 1fr 0.75fr 1.2fr 1.65fr; }
.currency-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.field { display: grid; gap: 8px; }
.field span { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.field-wide { grid-column: 1 / -1; }
input, select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(92, 77, 52, 0.14);
  background: #fffdfa;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.10);
}
.status-banner { padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; font-weight: 600; }
.city-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.city-workspace {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.city-rail {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(92, 77, 52, 0.10);
  position: sticky;
  top: 12px;
}
.city-rail-head {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.city-rail-head h4 {
  font-size: 0.92rem;
}
.city-tabs-rail {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
  padding-bottom: 0;
  overflow: visible;
}
.city-tab {
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(92, 77, 52, 0.12);
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  font-weight: 700;
}
.city-tabs-rail .city-tab {
  display: grid;
  justify-items: start;
  gap: 3px;
  border-radius: 16px;
  padding: 12px 14px;
  white-space: normal;
}
.city-tabs-rail .city-tab::after {
  content: "Editar destino";
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.city-tabs-rail .city-tab.active::after {
  color: rgba(255, 255, 255, 0.82);
}
.city-tab.active {
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  color: #fff;
  border-color: transparent;
}
.status-info { background: rgba(15, 118, 110, 0.10); color: var(--accent-dark); }
.status-error { background: rgba(159, 45, 45, 0.10); color: var(--danger); }
.city-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 250, 242, 0.96) 100%);
  border: 1px solid rgba(92, 77, 52, 0.12);
}
.city-editor-stack {
  gap: 14px;
}
.city-card.hidden-city { display: none; }
.city-card-title h3 {
  font-size: 1.2rem;
}
.city-grid, .line-items { margin-top: 14px; }
.city-grid {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.62);
}
.line-table-head, .line-row {
  display: grid;
  grid-template-columns: 0.95fr 2.25fr 1.08fr 0.9fr 1.12fr 1.08fr auto;
  gap: 10px;
  align-items: center;
}
.flight-table-head, .flight-row {
  grid-template-columns: 0.8fr 0.8fr 1.2fr 0.9fr 1fr auto;
}
.line-table-head {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 12px 0 8px;
}
.line-row {
  padding: 10px;
  border-radius: 14px;
  background: rgba(249, 245, 238, 0.9);
  border: 1px solid rgba(92, 77, 52, 0.08);
}
.calc-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(92, 77, 52, 0.1);
  color: var(--muted);
  font-weight: 700;
}
.calc-chip-strong {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.16);
  color: var(--accent-dark);
}
.result-city, .saved-card, .empty-state {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(92, 77, 52, 0.10);
}
.result-city {
  display: grid;
  gap: 8px;
}
.result-city-head > div:first-child {
  min-width: 0;
}
.result-city-head h3,
.result-city-head p {
  overflow-wrap: anywhere;
}
.result-city-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.result-city-quick article {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(247, 242, 234, 0.9);
  border: 1px solid rgba(92, 77, 52, 0.08);
}
.result-city-quick span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.result-city-quick strong {
  font-size: 0.88rem;
}
.result-city-detail {
  border-top: 1px solid rgba(92, 77, 52, 0.08);
  padding-top: 8px;
}
.result-city-detail summary {
  cursor: pointer;
  list-style: none;
  color: var(--accent-dark);
  font-weight: 800;
}
.result-city-detail summary::-webkit-details-marker {
  display: none;
}
.result-city-detail .detail-lines {
  margin-top: 8px;
}
.result-city .detail-lines {
  gap: 8px;
}
.result-city .detail-line {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(247, 242, 234, 0.88);
  border: 1px solid rgba(92, 77, 52, 0.08);
}
.proposal-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(15, 118, 110, 0.10), rgba(201, 123, 42, 0.10));
  border: 1px solid rgba(15, 118, 110, 0.16);
}
.proposal-copy { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }
.proposal-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.proposal-highlights article {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(92, 77, 52, 0.10);
}
.sticky-panel {
  position: sticky;
  top: 18px;
}
.proposal-highlights span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.city-total-stack {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 108px;
}
.city-total-stack .city-net {
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
}
.saved-card.active {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.2);
}
.saved-card button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
.saved-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.saved-detail-city + .saved-detail-city { margin-top: 12px; }
.muted { color: var(--muted); }

@media (max-width: 1120px) {
  .login-card { grid-template-columns: 1fr; }
  .top-stack, .hero-overview, .workspace { grid-template-columns: 1fr; }
  .hero-banner { flex-direction: column; align-items: stretch; }
  .hero-actions { justify-content: flex-start; }
  .sticky-panel { position: static; }
  .city-results { grid-template-columns: 1fr; }
  .result-city-quick { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 20px, 100%); margin: 12px auto 28px; }
  .hero-banner, .hero-card, .panel { padding: 18px; border-radius: 24px; }
  .compact-general-grid { grid-template-columns: 1fr; }
  .city-workspace { grid-template-columns: 1fr; }
  .city-rail { position: static; }
  .form-grid, .currency-grid, .line-table-head, .line-row { grid-template-columns: 1fr; }
  .line-table-head { display: none; }
  .panel-header, .section-heading, .city-card-header, .line-items-header, .saved-card-top, .saved-detail-top, .result-city-head, .saved-meta, .saved-line, .detail-line { flex-direction: column; align-items: stretch; }
  .wizard-toolbar, .wizard-step { align-items: stretch; }
  .proposal-highlights { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  .hero-actions, .inline-actions, .saved-panel, .status-banner, .line-items-header .btn, .city-card-actions, #load-draft-btn, #new-quote-btn, #add-city-btn, #calculate-btn, #save-btn, #refresh-saved-btn, #print-btn { display: none !important; }
  .page-shell { width: 100%; margin: 0; }
  .hero, .workspace { grid-template-columns: 1fr; gap: 12px; }
  .hero-copy, .hero-card, .panel, .card-block, .city-card, .proposal-card, .result-city { box-shadow: none; border: 1px solid #ddd; background: #fff; }
}
