:root {
  --olive-950: #293018;
  --olive-900: #3f4b20;
  --olive-800: #596728;
  --olive-700: #6f7d34;
  --olive-600: #83934a;
  --olive-200: #dfe5c9;
  --olive-100: #eef1e3;
  --cream: #f6f4ed;
  --paper: #fffefa;
  --ink: #22271f;
  --muted: #6f756b;
  --line: #e2e3da;
  --orange: #f26422;
  --orange-dark: #d84e12;
  --regular: #7da887;
  --premium: #39788e;
  --launch: #e89a34;
  --reserved: #abb0a8;
  --sold: #626861;
  --danger: #b84040;
  --success: #34704b;
  --shadow-sm: 0 1px 2px rgba(43, 49, 26, .04), 0 8px 28px rgba(43, 49, 26, .06);
  --shadow: 0 18px 55px rgba(43, 49, 26, .14);
  --radius-xl: 22px;
  --radius: 15px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.hidden { display: none !important; }

/* ──────────────────────────────────────────────
   COTIZADOR COMERCIAL
────────────────────────────────────────────── */
.quote-app-body {
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(131, 147, 74, .11), transparent 28%),
    linear-gradient(135deg, #f7f5ef 0%, #f1f2e9 100%);
}

.site-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px clamp(16px, 2.4vw, 34px);
  background: rgba(255, 254, 250, .95);
  border-bottom: 1px solid rgba(89, 103, 40, .13);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 50;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 110px;
  height: 2px;
  background: var(--orange);
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 5px 15px rgba(63, 75, 32, .18); }
.brand span { display: grid; line-height: 1.1; min-width: 0; }
.brand strong { font-size: 1rem; letter-spacing: -.02em; color: var(--olive-950); }
.brand small { margin-top: 4px; color: var(--muted); font-size: .69rem; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-pill {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  color: #586052; background: rgba(255,255,255,.7);
  font-size: .71rem; font-weight: 750;
}
.header-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #56a36c; box-shadow: 0 0 0 4px rgba(86,163,108,.12); }
.admin-link {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 8px 13px;
  border: 1px solid rgba(89, 103, 40, .22); border-radius: 10px;
  color: var(--olive-800); background: var(--paper);
  font-size: .73rem; font-weight: 800;
  transition: .16s ease;
}
.admin-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.admin-link:hover { background: var(--olive-100); border-color: rgba(89,103,40,.38); transform: translateY(-1px); }

.quote-layout {
  height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
  gap: 14px;
  padding: 14px clamp(12px, 1.7vw, 24px) 16px;
  max-width: 1760px;
  margin: 0 auto;
}
.map-card, .quote-panel {
  min-width: 0; min-height: 0;
  background: rgba(255, 254, 250, .96);
  border: 1px solid rgba(89, 103, 40, .15);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Mapa */
.map-card { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
.map-toolbar {
  min-height: 86px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 20px 13px;
}
.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--olive-700);
  font-size: .62rem; font-weight: 900; letter-spacing: .115em; text-transform: uppercase;
}
.map-heading h1, .panel-head h2 { margin: 0; color: var(--olive-950); letter-spacing: -.035em; }
.map-heading h1 { font-size: clamp(1.16rem, 1.55vw, 1.48rem); line-height: 1.08; }
.map-heading p { margin: 5px 0 0; color: var(--muted); font-size: .74rem; }
.inventory-summary { display: grid; grid-template-columns: repeat(3, minmax(70px, 1fr)); gap: 7px; flex: 0 0 auto; }
.inventory-summary > div {
  min-width: 72px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 11px;
  background: #faf9f4; text-align: center;
}
.inventory-summary strong { display: block; color: var(--olive-900); font-size: 1rem; line-height: 1; }
.inventory-summary span { display: block; margin-top: 4px; color: var(--muted); font-size: .58rem; font-weight: 750; }

.map-filterbar {
  min-height: 54px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid #ecece5;
  border-bottom: 1px solid #ecece5;
  background: #fbfaf6;
}
.lot-search {
  flex: 1 1 260px; max-width: 360px; min-width: 190px;
  height: 36px; display: flex; align-items: center; gap: 8px;
  padding: 0 11px;
  border: 1px solid #d9dbcf; border-radius: 10px;
  background: white;
  transition: border .15s, box-shadow .15s;
}
.lot-search:focus-within { border-color: var(--olive-600); box-shadow: 0 0 0 3px rgba(131,147,74,.13); }
.lot-search svg { width: 16px; height: 16px; fill: none; stroke: #7b8174; stroke-width: 1.8; stroke-linecap: round; flex: 0 0 auto; }
.lot-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .75rem; }
.lot-search input::placeholder { color: #979c91; }
.block-tabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 10px; background: #e9ebdf; }
.block-tab {
  min-width: 34px; height: 30px; padding: 0 9px;
  border: 0; border-radius: 8px; background: transparent;
  color: #72786a; font-size: .69rem; font-weight: 850; cursor: pointer;
  transition: .14s ease;
}
.block-tab:hover { color: var(--olive-900); }
.block-tab.active { background: white; color: var(--olive-900); box-shadow: 0 2px 8px rgba(61,71,35,.1); }
.icon-button {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid #d9dbcf; border-radius: 10px; background: white; cursor: pointer;
  transition: .15s ease;
}
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: var(--olive-700); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { background: var(--olive-100); border-color: #c4c9af; }

.legend {
  min-height: 38px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 13px;
  padding: 8px 17px;
  background: #fffefa;
  border-bottom: 1px solid #efefe8;
}
.legend-label { color: #9a9e94; font-size: .58rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; color: #636a5f; font-size: .63rem; font-weight: 750; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.legend-dot.regular { background: var(--regular); }
.legend-dot.premium { background: var(--premium); }
.legend-dot.launch { background: var(--launch); }
.legend-dot.reserved { background: var(--reserved); }
.legend-dot.sold { background: var(--sold); }
.legend-divider { width: 1px; height: 14px; background: var(--line); }

.map-stage {
  min-height: 0; position: relative;
  padding: 6px 8px;
  background:
    linear-gradient(rgba(89,103,40,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89,103,40,.025) 1px, transparent 1px),
    #f0f2e9;
  background-size: 24px 24px;
}
.loading-state { height: 100%; min-height: 320px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.loader { width: 30px; height: 30px; border: 3px solid #d8ddc7; border-top-color: var(--olive-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { color: var(--danger); text-align: center; padding: 25px; }
.map-viewport { width: 100%; height: 100%; min-height: 0; border-radius: 15px; overflow: hidden; background: #f8f8f2; box-shadow: inset 0 0 0 1px rgba(89,103,40,.08); }
#lotMap { width: 100%; height: 100%; min-height: 0; }
.lot-group { cursor: pointer; transition: opacity .16s ease; outline: none; }
.lot-group rect { transition: filter .14s ease, stroke-width .14s ease, opacity .14s ease; }
.lot-group:hover rect, .lot-group:focus rect { filter: brightness(1.07); }
.lot-group.disabled { cursor: not-allowed; }
.lot-group.is-muted { opacity: .16; pointer-events: none; }
.lot-group.is-search-match rect { stroke: var(--orange) !important; stroke-width: 4px !important; filter: drop-shadow(0 3px 5px rgba(242,100,34,.28)); }
.lot-group.is-selected rect { filter: drop-shadow(0 5px 8px rgba(41,48,24,.28)); }
.map-footer {
  min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 17px;
  border-top: 1px solid #ecece4; background: #fbfaf6;
  color: #777d72; font-size: .61rem;
}
.map-footer p { margin: 0; display: flex; align-items: center; gap: 6px; }
.map-footer > span { color: var(--olive-700); font-weight: 850; white-space: nowrap; }
.info-icon { width: 15px; height: 15px; display: inline-grid; place-items: center; border: 1px solid #bdc4a7; border-radius: 50%; color: var(--olive-700); font-size: .56rem; font-weight: 900; }

/* Panel de cotización */
.quote-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.panel-head {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #ecece5;
}
.panel-head h2 { font-size: 1.18rem; }
.step-counter { padding: 5px 9px; border-radius: 999px; background: var(--olive-100); color: var(--olive-800); font-size: .62rem; font-weight: 850; }
.empty-selection {
  min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 34px; text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(131,147,74,.1), transparent 36%),
    #fffefa;
}
.empty-illustration { width: 118px; height: 118px; margin-bottom: 12px; }
.empty-illustration svg { width: 100%; height: 100%; }
.empty-illustration .map-shape { fill: #eff1e4; stroke: #cbd0b8; stroke-width: 2; }
.empty-illustration .map-line { fill: none; stroke: #cbd0b8; stroke-width: 2; stroke-dasharray: 5 5; }
.empty-illustration .pin { fill: var(--olive-700); }
.empty-selection > strong { color: var(--olive-950); font-size: 1.04rem; letter-spacing: -.02em; }
.empty-selection > p { max-width: 300px; margin: 7px 0 18px; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.empty-hint { display: flex; align-items: center; gap: 7px; color: #888e82; font-size: .61rem; font-weight: 700; }
.empty-hint kbd { min-width: 21px; height: 21px; display: inline-grid; place-items: center; border: 1px solid #d4d7ca; border-bottom-width: 2px; border-radius: 6px; background: white; color: var(--olive-800); font: inherit; font-weight: 900; }

.quote-workspace { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.selected-lot {
  margin: 12px 14px 10px; padding: 12px 13px;
  border: 1px solid rgba(89,103,40,.2); border-radius: 13px;
  background: linear-gradient(135deg, #f3f4e8 0%, #fbfaf5 100%);
}
.selected-lot-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.selected-lot-code { display: flex; align-items: center; gap: 9px; }
.selected-lot-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--olive-800); color: white; }
.selected-lot-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.selected-lot-code span { display: block; color: var(--muted); font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.selected-lot-code strong { display: block; margin-top: 2px; color: var(--olive-950); font-size: .94rem; letter-spacing: -.02em; }
.selected-lot-price { text-align: right; }
.selected-lot-price span { display: block; color: var(--muted); font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.selected-lot-price strong { display: block; margin-top: 2px; color: var(--orange-dark); font-size: 1.05rem; line-height: 1.1; }
.selected-lot-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.selected-lot-meta div { padding: 6px 8px; border: 1px solid rgba(89,103,40,.1); border-radius: 8px; background: rgba(255,255,255,.68); }
.selected-lot-meta span { display: block; color: #8a8f84; font-size: .52rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.selected-lot-meta strong { display: block; margin-top: 2px; color: #4a5145; font-size: .68rem; }

.form-stepper {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 0 14px 10px;
  border-bottom: 1px solid #eeeeE7;
}
.step-tab {
  position: relative; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 9px; background: transparent; color: #90958b; cursor: pointer;
  font-size: .64rem; transition: .14s ease;
}
.step-tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -11px; height: 2px; border-radius: 2px; background: transparent; }
.step-tab span { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #d5d8cd; border-radius: 50%; font-size: .58rem; font-weight: 900; }
.step-tab strong { font-weight: 800; }
.step-tab.active { color: var(--olive-900); background: var(--olive-100); }
.step-tab.active span { border-color: var(--olive-700); background: var(--olive-700); color: white; }
.step-tab.active::after { background: var(--orange); }
.step-tab.completed { color: var(--olive-700); }
.step-tab.completed span { border-color: var(--olive-600); color: var(--olive-700); }

.quotation-form { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; }
.form-step { display: none; min-height: 0; padding: 13px 16px 8px; }
.form-step.active { display: block; overflow-y: auto; }
.step-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.step-heading h3 { margin: 0; color: var(--olive-950); font-size: .96rem; letter-spacing: -.025em; }
.step-heading p { max-width: 190px; margin: 0; color: var(--muted); font-size: .59rem; line-height: 1.35; text-align: right; }
.step-kicker { display: block; margin-bottom: 2px; color: var(--orange-dark); font-size: .53rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.compact-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compact-form-grid .span-2 { grid-column: 1 / -1; }
.form-group { display: grid; gap: 5px; min-width: 0; }
.form-group label { color: #4d5548; font-size: .62rem; font-weight: 820; }
.form-group label b { color: var(--orange); }
.form-group label span { margin-left: 4px; color: #979c92; font-size: .54rem; font-weight: 700; }
.form-group input, .form-group select, .currency-input {
  width: 100%; min-height: 38px;
  border: 1px solid #d9dbd1; border-radius: 9px;
  background: #fff; color: var(--ink); outline: none;
  font-size: .71rem;
  transition: border .14s, box-shadow .14s, background .14s;
}
.form-group input, .form-group select { padding: 8px 10px; }
.form-group input::placeholder { color: #a6aaa1; }
.form-group input:focus, .form-group select:focus, .currency-input:focus-within { border-color: var(--olive-600); box-shadow: 0 0 0 3px rgba(131,147,74,.13); }
.form-group input:invalid:not(:placeholder-shown) { border-color: #dca9a9; }
.currency-input { display: flex; align-items: center; overflow: hidden; }
.currency-input span { padding-left: 10px; color: #73796f; font-size: .7rem; font-weight: 850; }
.currency-input input { min-height: 36px; border: 0; box-shadow: none !important; }
.installment-box {
  display: grid; grid-template-columns: 1.1fr .8fr 1.15fr; gap: 8px;
  margin-top: 10px; padding: 10px;
  border: 1px solid #e0e2d7; border-radius: 10px; background: #f8f7f1;
}
.preview-box {
  margin-top: 10px; padding: 11px 12px;
  border-radius: 11px;
  background: var(--olive-950); color: white;
  box-shadow: 0 8px 20px rgba(41,48,24,.14);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.preview-head span { color: rgba(255,255,255,.62); font-size: .55rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.preview-head strong { font-size: .65rem; color: #e3e9c9; }
.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.preview-grid > div { padding: 7px 8px; border: 1px solid rgba(255,255,255,.11); border-radius: 8px; background: rgba(255,255,255,.045); }
.preview-grid span { display: block; color: rgba(255,255,255,.55); font-size: .53rem; }
.preview-grid strong { display: block; margin-top: 2px; font-size: .7rem; }

.review-summary { display: grid; gap: 8px; }
.review-card { border: 1px solid #e0e2d8; border-radius: 10px; background: #fbfaf6; overflow: hidden; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid #e9eae2; background: #f2f3e8; }
.review-card-head strong { color: var(--olive-900); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; }
.review-card-head button { border: 0; background: transparent; color: var(--orange-dark); font-size: .59rem; font-weight: 850; cursor: pointer; }
.review-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; padding: 8px 10px; }
.review-lines div { min-width: 0; }
.review-lines span { display: block; color: #969b91; font-size: .51rem; text-transform: uppercase; letter-spacing: .05em; }
.review-lines strong { display: block; margin-top: 2px; color: #4a5146; font-size: .65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acceptance-row {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 9px; padding: 9px 10px;
  border: 1px solid #e2e3da; border-radius: 10px; background: #fff;
  color: #656c61; font-size: .59rem; line-height: 1.4; cursor: pointer;
}
.acceptance-row input { width: 15px; height: 15px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--olive-700); }
.acceptance-row strong { color: var(--olive-950); }

#formMessage { padding: 0 16px; }
.alert { margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; font-size: .62rem; line-height: 1.35; }
.alert.error { border: 1px solid #efc8c8; background: #fff2f2; color: #8f2929; }
.alert.success { border: 1px solid #c8e1d0; background: #eef8f1; color: #24653c; }
.alert.warning { border: 1px solid #ecd9a8; background: #fff8e7; color: #795512; }

.form-actions {
  min-height: 59px; display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid #ecece5;
  background: #fbfaf6;
}
.button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px;
  border: 1px solid transparent; border-radius: 9px;
  font-size: .68rem; font-weight: 850; cursor: pointer;
  transition: .15s ease;
}
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: progress; transform: none; }
.button.primary { min-width: 124px; background: var(--olive-800); color: white; box-shadow: 0 6px 14px rgba(89,103,40,.18); }
.button.primary:hover { background: var(--olive-900); }
.button.secondary { background: white; color: var(--olive-800); border-color: #d8dbce; }
.button.secondary:hover { background: var(--olive-100); }
.button.accent { min-width: 174px; background: var(--orange); color: white; box-shadow: 0 7px 16px rgba(242,100,34,.22); }
.button.accent:hover { background: var(--orange-dark); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(31,36,23,.62); backdrop-filter: blur(5px); }
.modal-dialog { position: relative; width: min(440px, 100%); padding: 30px; border: 1px solid rgba(255,255,255,.45); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); text-align: center; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #eff0e8; color: #60665b; font-size: 1.15rem; cursor: pointer; }
.success-check { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: var(--olive-100); color: var(--olive-700); }
.success-check svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.modal-dialog h2 { margin: 4px 0 7px; color: var(--olive-950); font-size: 1.35rem; letter-spacing: -.03em; }
.modal-dialog p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.modal-actions { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }

/* ──────────────────────────────────────────────
   ADMIN / INSTALADOR (compatibilidad)
────────────────────────────────────────────── */
.installer-body { display: grid; min-height: 100vh; place-items: center; padding: 22px; background: #e9ece2; }
.installer-card, .login-card { width: min(680px, 100%); padding: clamp(25px, 5vw, 44px); border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow-sm); }
.login-card { width: min(470px, 100%); }
.installer-card h1, .login-card h1 { margin: 6px 0 8px; font-size: clamp(1.65rem, 4vw, 2.3rem); letter-spacing: -.045em; }
.brand-mark { display: grid; width: 54px; height: 54px; margin-bottom: 17px; place-items: center; border-radius: 15px; background: var(--olive-800); color: white; font-size: 1.05rem; font-weight: 900; }
.installer-form, .login-card .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 8px 0 0; }
.installer-form label, .login-card label { display: grid; gap: 6px; color: #444c40; font-size: .78rem; font-weight: 800; }
.installer-form input, .login-card input, .installer-form select { min-height: 42px; padding: 9px 12px; border: 1px solid #d5d8ce; border-radius: 10px; outline: none; }
.form-section-title { grid-column: 1 / -1; margin-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--olive-800); font-size: .82rem; font-weight: 900; }
.span-2 { grid-column: 1 / -1; }
.install-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.back-link { display: inline-flex; margin-bottom: 24px; color: var(--olive-800); font-size: .88rem; font-weight: 800; }
.admin-body { background: #f1f2ec; }
.admin-header { position: relative; }
.admin-user { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .82rem; }
.admin-user span { font-weight: 800; color: var(--ink); }
.admin-user a { color: var(--olive-800); font-weight: 900; }
.admin-shell { max-width: 1440px; margin: 0 auto; padding: 27px clamp(14px, 3vw, 40px) 50px; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.admin-title h1 { margin: 5px 0 0; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.045em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-card { min-height: 132px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 7px 22px rgba(22, 46, 31, .06); }
.stat-card span { color: var(--muted); font-size: .76rem; font-weight: 800; }
.stat-card strong { display: block; margin: 8px 0 5px; color: var(--olive-950); font-size: 2rem; line-height: 1; }
.stat-card small { color: #7b8178; }
.skeleton { background: #e8eae2; animation: pulse 1.2s infinite alternate; }
@keyframes pulse { to { opacity: .55; } }
.admin-card { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.tabs { display: inline-flex; gap: 5px; padding: 4px; border-radius: 12px; background: #eceee5; }
.tab { min-height: 36px; padding: 7px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 900; cursor: pointer; }
.tab.active { background: white; color: var(--olive-800); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.search-box { display: flex; width: min(440px, 100%); gap: 8px; }
.search-box input { width: 100%; min-height: 39px; padding: 8px 12px; border: 1px solid #cfd3c7; border-radius: 10px; outline: none; }
.search-box button { padding: 8px 14px; border: 0; border-radius: 10px; background: var(--olive-800); color: white; font-weight: 900; cursor: pointer; }
#adminMessage { padding: 0 18px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .79rem; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f7f8f4; color: #687065; text-align: left; text-transform: uppercase; letter-spacing: .06em; font-size: .65rem; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #eceee8; vertical-align: middle; }
tbody tr:hover { background: #fafbf8; }
.table-action { display: inline-flex; padding: 7px 10px; border: 1px solid #cdd2c6; border-radius: 8px; background: white; color: var(--olive-800); font-size: .73rem; font-weight: 900; cursor: pointer; }
.table-sub { display: block; margin-top: 3px; color: var(--muted); }
.empty-cell { padding: 40px; color: var(--muted); text-align: center; }
.modal-form { display: grid; gap: 13px; text-align: left; }
.modal-form h2 { margin: 0 0 4px; }
.modal-form label { display: grid; gap: 6px; color: #344038; font-size: .78rem; font-weight: 800; }
.modal-form input, .modal-form select { width: 100%; min-height: 42px; padding: 9px 12px; border: 1.5px solid #d5d8ce; border-radius: 10px; outline: none; background: white; }
.status-badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.status-badge.available, .status-badge.disponible { background: #dff0e3; color: #1d6b3c; }
.status-badge.reservado { background: #f3ead6; color: #8c6217; }
.status-badge.vendido { background: #e5e8e6; color: #4e5752; }
.status-badge.vigente { background: #e4edf6; color: #2f628c; }
.status-badge.vencida { background: #f7e2e2; color: #983636; }
.status-badge.convertida { background: #e4f0e9; color: #286344; }

/* Alturas compactas para laptops */
@media (min-width: 981px) and (max-height: 760px) {
  .quote-layout { gap: 11px; padding-top: 10px; padding-bottom: 11px; }
  .map-toolbar { min-height: 76px; padding-top: 12px; padding-bottom: 10px; }
  .map-filterbar { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .legend { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
  .map-footer { min-height: 31px; padding-top: 6px; padding-bottom: 6px; }
  .panel-head { min-height: 63px; padding-top: 11px; padding-bottom: 10px; }
  .selected-lot { margin-top: 9px; margin-bottom: 7px; padding-top: 9px; padding-bottom: 9px; }
  .selected-lot-meta { margin-top: 7px; }
  .form-stepper { padding-bottom: 8px; }
  .step-tab::after { bottom: -9px; }
  .form-step { padding-top: 10px; }
  .step-heading { margin-bottom: 8px; }
  .compact-form-grid { gap: 8px; }
  .form-group input, .form-group select, .currency-input { min-height: 35px; }
  .form-group input, .form-group select { padding-top: 7px; padding-bottom: 7px; }
  .installment-box, .preview-box { margin-top: 8px; }
  .form-actions { min-height: 53px; padding-top: 8px; padding-bottom: 8px; }
}

/* Responsive: en tablet y móvil se permite desplazamiento natural */
@media (max-width: 1100px) {
  .quote-layout { grid-template-columns: minmax(0, 1fr) minmax(355px, 400px); }
  .inventory-summary > div { min-width: 64px; padding-inline: 8px; }
}
@media (max-width: 980px) {
  .quote-app-body { overflow: auto; }
  .site-header { position: sticky; top: 0; }
  .quote-layout { height: auto; min-height: calc(100vh - 64px); grid-template-columns: 1fr; padding: 12px; }
  .map-card { min-height: 690px; }
  .quote-panel { min-height: 610px; }
  .map-stage { min-height: 480px; }
}
@media (max-width: 680px) {
  .site-header { padding-inline: 12px; }
  .header-pill { display: none; }
  .admin-link { padding: 8px 10px; }
  .admin-link svg { display: none; }
  .brand strong { font-size: .88rem; }
  .brand small { font-size: .61rem; }
  .map-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .inventory-summary { width: 100%; }
  .map-filterbar { flex-wrap: wrap; }
  .lot-search { max-width: none; flex-basis: calc(100% - 46px); }
  .block-tabs { order: 3; width: 100%; justify-content: space-between; }
  .block-tab { flex: 1; }
  .legend-label, .legend-divider { display: none; }
  .map-card { min-height: 650px; }
  .map-stage { min-height: 420px; padding: 7px; }
  .map-footer > span { display: none; }
  .selected-lot-meta { grid-template-columns: repeat(3, 1fr); }
  .step-heading { align-items: flex-start; flex-direction: column; }
  .step-heading p { max-width: none; text-align: left; }
  .compact-form-grid { grid-template-columns: 1fr; }
  .compact-form-grid .span-2 { grid-column: auto; }
  .installment-box { grid-template-columns: 1fr; }
  .form-actions { position: sticky; bottom: 0; z-index: 4; }
  .modal-actions { flex-direction: column; }
  .modal-actions .button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .installer-form, .login-card .form-grid { grid-template-columns: 1fr; }
  .installer-form .span-2, .login-card .span-2, .form-section-title { grid-column: auto; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .admin-user span { display: none; }
}
