:root {
  --bg-page: #f6f5f0;
  --bg-surface: #ffffff;
  --bg-subtle: #efede6;
  --bg-tech-header: #0f172a;
  --bg-accent-soft: #eff6ff;
  --bg-warn-soft: #fef2f2;
  --bg-success-soft: #ecfdf5;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --text-inverse: #f8fafc;

  --border-light: #d6d3c9;
  --border-strong: #1e293b;
  --border-accent: #1d4ed8;

  --brand-primary: #1e3a8a;
  --brand-primary-hover: #172554;
  --brand-red: #b91c1c;
  --brand-red-hover: #991b1b;
  --brand-green: #047857;
  --brand-amber: #b45309;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-elevated: 0 12px 28px -6px rgba(15, 23, 42, 0.18);
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-page);
  text-align: start;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 800;
  color: var(--text-primary);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.mono, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.num {
  text-align: right;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ==========================================
   TOP TECHNICAL TICKER BAR
   ========================================== */
.top-ticker {
  background-color: var(--bg-tech-header);
  color: var(--text-inverse);
  border-bottom: 2px solid var(--brand-red);
  font-size: 0.8125rem;
  padding-block: 0.45rem;
}

.ticker-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ticker-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.03em;
}

.ticker-badge .sep {
  opacity: 0.4;
}

.ticker-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ticker-label {
  color: #cbd5e1;
}

.badge-up {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.currency-switcher {
  display: inline-flex;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.curr-btn {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.curr-btn:hover {
  color: #ffffff;
  background: #334155;
}

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

/* ==========================================
   EDITORIAL MASTHEAD
   ========================================== */
.masthead {
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 1rem;
}

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

.brand-mark {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--bg-tech-header);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  border-left: 5px solid var(--brand-red);
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.brand-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-red);
  text-transform: uppercase;
}

.brand-title {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.brand-title span {
  color: var(--brand-primary);
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* HEADER BUDGET WIDGET */
.header-budget-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
}

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

.hbw-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.hbw-project {
  font-size: 0.875rem;
  color: var(--text-primary);
  max-width: 26ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hbw-stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-top: 0.1rem;
}

.hbw-total {
  color: var(--brand-primary);
  font-size: 0.95rem;
}

.hbw-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ==========================================
   MAIN NAVIGATION TABS
   ========================================== */
.main-nav {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

.nav-inner {
  display: flex;
  overflow-x: auto;
  gap: 0.25rem;
  padding-top: 0.35rem;
}

.nav-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--bg-page);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: 0 -3px 0 inset var(--brand-primary);
}

.nav-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-count {
  background: #e2e8f0;
  color: var(--text-primary);
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}

.badge-accent {
  background: var(--brand-red);
  color: #ffffff;
}

/* ==========================================
   MAIN CONTENT & EDITORIAL BANNERS
   ========================================== */
.main-content {
  flex: 1;
  padding-block: 1.5rem 3rem;
}

.tab-panel {
  display: none;
}

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

.editorial-banner {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-left: 6px solid var(--brand-primary);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
}

.admin-banner {
  border-left-color: var(--brand-red);
}

.eb-left {
  max-width: 78ch;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.editorial-banner h2 {
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.65rem);
  margin-bottom: 0.35rem;
}

.eb-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.quick-actions-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ==========================================
   BUTTONS & FORM CONTROLS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}

.btn-block {
  width: 100%;
  padding-block: 0.75rem;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
}

.btn-secondary {
  background: var(--bg-tech-header);
  color: #ffffff;
  border-color: var(--bg-tech-header);
}

.btn-secondary:hover {
  background: #1e293b;
}

.btn-danger {
  background: var(--brand-red);
  color: #ffffff;
  border-color: var(--brand-red);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-subtle);
}

.btn-whatsapp {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
}

.btn-whatsapp:hover {
  background: #047857;
}

.input-control, .select-control, .input-search {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid #94a3b8;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-control:focus, .select-control:focus, .input-search:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

/* ==========================================
   FILTER BAR & CATEGORY PILLS
   ========================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}

.search-input-wrap {
  flex: 1 1 320px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-search {
  padding-left: 2.35rem;
}

.filter-select-wrap {
  min-width: 250px;
}

.view-mode-switch {
  display: inline-flex;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-view {
  background: var(--bg-surface);
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary);
}

.btn-view.active {
  background: var(--bg-tech-header);
  color: #ffffff;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.cat-pill {
  background: var(--bg-surface);
  border: 1px solid #94a3b8;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
}

.cat-pill:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.cat-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* ==========================================
   RUBROS (APU) CARDS GRID
   ========================================== */
.rubros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(410px, 1fr));
  gap: 1.15rem;
}

.rubro-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.rubro-card:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.rc-top {
  padding: 1.1rem 1.25rem;
}

.rc-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rc-code-badge {
  background: var(--bg-tech-header);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
}

.rc-chapter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rc-title {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  cursor: pointer;
}

.rc-title:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.rc-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

/* APU MINI BREAKDOWN INSIDE CARD */
.rc-apu-breakdown {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.8125rem;
}

.rc-apu-bar {
  height: 6px;
  background: #cbd5e1;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  margin-bottom: 0.5rem;
}

.rc-bar-mat {
  background: var(--brand-primary);
}

.rc-bar-mo {
  background: var(--brand-red);
}

.rc-apu-stats {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.rc-stat-col {
  display: flex;
  flex-direction: column;
}

.rc-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.rc-insumos-preview {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.rc-footer {
  background: #f8fafc;
  border-top: 1.5px solid var(--border-light);
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rc-price-block {
  display: flex;
  flex-direction: column;
}

.rc-price-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rc-price-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.rc-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ==========================================
   HIGH VISIBILITY TECHNICAL TABLES
   ========================================== */
.table-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-section-header {
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border-bottom: 1.5px solid var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-section-header h3 {
  font-size: 1.05rem;
}

.card-section-header p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.tech-table thead th {
  background: var(--bg-tech-header);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.9rem;
  border-bottom: 2px solid var(--brand-primary);
  white-space: nowrap;
}

.tech-table tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.tech-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.tech-table tbody tr:hover {
  background-color: #eff6ff;
}

.tech-table .chapter-row td {
  background: #e2e8f0;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding-block: 0.55rem;
  border-top: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
}

.col-code {
  width: 95px;
  white-space: nowrap;
}

.col-unit {
  width: 110px;
  text-align: center;
  white-space: nowrap;
}

.col-price, .col-total, .col-qty {
  white-space: nowrap;
}

.col-actions {
  white-space: nowrap;
  text-align: right;
}

.code-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  background: #e2e8f0;
  color: var(--text-primary);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.cat-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid #cbd5e1;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.usd-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================
   BUDGET BUILDER STYLES
   ========================================== */
.budget-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.meta-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
}

.meta-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1.5px solid var(--border-light);
}

.meta-step {
  width: 1.75rem;
  height: 1.75rem;
  background: var(--bg-tech-header);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
}

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

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group.span-2 {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.logo-upload-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.7rem;
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-accent);
  border-radius: var(--radius-sm);
}

.logo-preview-box {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.logo-placeholder-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.logo-upload-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pdf-color-picker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.pdf-swatches-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pdf-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--swatch-color, #1e3a8a);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1.5px #94a3b8;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
}

.pdf-color-swatch:hover {
  transform: scale(1.12);
}

.pdf-color-swatch.active {
  box-shadow: 0 0 0 2.5px #0f172a, 0 2px 6px rgba(15, 23, 42, 0.35);
  transform: scale(1.12);
}

.modal-swatches .pdf-color-swatch {
  width: 22px;
  height: 22px;
}

.pdf-custom-color-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  background: #ffffff;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.pdf-custom-color-label input[type="color"],
.pdf-modal-color-input {
  width: 22px;
  height: 22px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.budget-add-bar {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem;
}

.bab-select-group {
  flex: 1 1 380px;
}

.bab-qty-group {
  width: 150px;
}

.bab-custom-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}

.btn-accent-Action {
  background: #0f766e;
  color: #ffffff;
  border: 1.5px solid #0f766e;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-accent-Action:hover {
  background: #115e59;
  border-color: #115e59;
}

.chapter-row-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bab-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.qty-inline-input {
  width: 95px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--border-accent);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

/* BUDGET TOTALS LAYOUT */
.budget-summary-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.budget-indirects-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
}

.indirects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.budget-totals-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btc-header {
  background: var(--bg-tech-header);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.75rem 1.25rem;
  letter-spacing: 0.05em;
}

.btc-rows {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.btc-subtotal {
  padding-top: 0.45rem;
  border-top: 1px solid #cbd5e1;
  font-weight: 700;
}

.btc-grand-total {
  margin-top: 0.35rem;
  padding: 0.75rem;
  background: var(--bg-accent-soft);
  border: 1.5px solid var(--brand-primary);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.btc-m2-indicator {
  padding: 0.45rem 0.75rem;
  background: var(--bg-subtle);
  font-size: 0.85rem;
}

.btc-footer-actions {
  padding: 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ==========================================
   KPI STRIP & INSUMOS EXPLOSION
   ========================================== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-top: 4px solid var(--brand-primary);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.35rem;
  margin-block: 0.2rem;
}

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

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ==========================================
   PROVEEDORES DESIGNADOS & QUOTE DISPATCH
   ========================================== */
.quote-dispatch-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.suppliers-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.supplier-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  transition: border-color 0.15s, background-color 0.15s;
}

.supplier-card.selected {
  border-color: var(--brand-primary);
  background: #f8faff;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
}

.supplier-check {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.supplier-info {
  flex: 1;
}

.supplier-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.verified-pill {
  background: var(--bg-success-soft);
  color: var(--brand-green);
  border: 1px solid #6ee7b7;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
}

.supplier-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-block: 0.45rem;
}

.supplier-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.quote-materials-preview {
  margin-block: 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qmp-header {
  background: var(--bg-subtle);
  padding: 0.6rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-light);
}

.badge-neutral {
  background: #e2e8f0;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.qmp-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 0.5rem 0.85rem;
  background: #ffffff;
  font-size: 0.82rem;
}

.qmp-item {
  display: flex;
  justify-content: space-between;
  padding-block: 0.35rem;
  border-bottom: 1px dashed #e2e8f0;
}

.quote-dispatch-result {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--bg-success-soft);
  border: 1.5px solid var(--brand-green);
  border-radius: var(--radius-sm);
}

/* ==========================================
   ADMIN PANEL SUBTABS
   ========================================== */
.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border-strong);
  padding-bottom: 0.5rem;
}

.admin-subtab {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  padding: 0.5rem 0.9rem;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.admin-subtab.active {
  background: var(--bg-tech-header);
  color: #ffffff;
  border-color: var(--bg-tech-header);
}

.admin-subpanel {
  display: none;
}

.admin-subpanel.active {
  display: block;
}

/* ==========================================
   MODALS (<dialog>) & APU INSPECTOR
   ========================================== */
.tech-dialog {
  margin: auto;
  width: min(94vw, 680px);
  max-height: 90vh;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-elevated);
  padding: 0;
}

.tech-dialog.dialog-lg {
  width: min(95vw, 980px);
}

.tech-dialog.dialog-xl {
  width: min(96vw, 1180px);
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

.tech-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
}

.dialog-header {
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border-strong);
  padding: 1rem 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dialog-body {
  padding: 1.35rem;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.dialog-footer {
  background: var(--bg-subtle);
  border-top: 1.5px solid var(--border-light);
  padding: 0.9rem 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.btn-close-dialog {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  cursor: pointer;
}

.mrd-add-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
}

.doc-mode-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.spec-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-primary);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
}

.spec-box h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-primary);
  margin-bottom: 0.35rem;
}

.spec-box p {
  font-size: 0.86rem;
  white-space: pre-line;
  color: var(--text-secondary);
}

/* COMPOSER MODAL */
.composer-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.composer-box {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  background: #fcfcfb;
}

.composer-box-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.composer-add-inline {
  display: flex;
  gap: 0.4rem;
}

.calculated-box {
  background: var(--bg-accent-soft);
  border: 1.5px solid var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 800;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-link-inline {
  background: none;
  border: none;
  color: var(--brand-primary);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link-inline:hover {
  color: var(--brand-accent);
}

.mrc-budget-incorporate-box {
  background: var(--bg-subtle);
  border: 1.5px dashed var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.composer-custom-insumo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

.ccib-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.input-sm {
  padding: 0.28rem 0.45rem !important;
  font-size: 0.78rem !important;
}

/* ==========================================
   PRINT & CLIENT DOCUMENT A4 PAGINATED SHEET STYLING
   ========================================== */
.document-preview-canvas {
  background: #475569;
  padding: 2rem 1rem;
  overflow-x: auto;
}

.pdf-document-stack {
  --pdf-primary: #1e3a8a;
  --pdf-primary-dark: #0f172a;
  --pdf-accent: #2563eb;
  --pdf-soft-bg: #f1f5f9;
  --pdf-chapter-bg: #dbeafe;
  --pdf-border: #334155;
  --pdf-on-dark: #ffffff;
  --pdf-on-dark-muted: #e2e8f0;
  --pdf-on-accent: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.pdf-page {
  background: #ffffff;
  color: #0f172a;
  width: 210mm;
  min-height: 297mm;
  padding: 13mm 15mm;
  border: 1px solid #64748b;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-sizing: border-box;
}

.pdf-page-body {
  flex: 1;
}

.pdf-page-footer {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--pdf-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7.5pt;
  color: #475569;
  font-family: var(--font-mono);
}

/* STRUCTURED 3-TIER PDF HEADER CARD */
.pdf-header-card {
  border: 2px solid var(--pdf-primary-dark);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #ffffff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-title-banner {
  background: var(--pdf-primary-dark);
  color: var(--pdf-on-dark, #ffffff);
  padding: 0.55rem 0.95rem;
  border-bottom: 3px solid var(--pdf-accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-banner-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pdf-banner-kicker {
  font-family: var(--font-mono);
  font-size: 6.5pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pdf-on-dark-muted, #e2e8f0);
}

.pdf-banner-doc-title {
  font-size: 11pt;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--pdf-on-dark, #ffffff);
  line-height: 1.2;
  margin: 0;
}

.pdf-banner-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.18rem;
}

.pdf-page-pill {
  background: var(--pdf-accent);
  color: var(--pdf-on-accent, #ffffff);
  font-family: var(--font-mono);
  font-size: 7pt;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-banner-meta {
  font-family: var(--font-mono);
  font-size: 7pt;
  color: var(--pdf-on-dark-muted, #e2e8f0);
}

.pdf-identity-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
  padding: 0.75rem 0.95rem;
  align-items: center;
  border-bottom: 1.5px solid #cbd5e1;
}

.pdf-project-block {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pdf-logo-frame {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  background: #ffffff;
}

.pdf-logo-frame img {
  max-height: 54px;
  max-width: 155px;
  object-fit: contain;
  display: block;
}

.pdf-project-titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pdf-field-caption {
  font-family: var(--font-mono);
  font-size: 6.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pdf-primary);
}

.pdf-project-name {
  font-size: 12pt;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.22;
  margin: 0;
}

.pdf-project-sub {
  font-size: 8.2pt;
  color: #334155;
  line-height: 1.35;
}

.pdf-company-block {
  border-left: 2px solid var(--pdf-primary);
  padding-left: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.16rem;
}

.pdf-company-name {
  font-size: 9.2pt;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.pdf-company-detail {
  font-size: 7.6pt;
  color: #475569;
  line-height: 1.3;
}

.pdf-client-strip {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.9fr 1fr;
  background: var(--pdf-soft-bg);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-strip-cell {
  padding: 0.42rem 0.75rem;
  border-right: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.pdf-strip-cell:last-child {
  border-right: none;
}

.pdf-strip-label {
  font-family: var(--font-mono);
  font-size: 6.2pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.pdf-strip-value {
  font-size: 8.2pt;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

/* COMPACT CONTINUATION HEADER (PAGES 2+) */
.pdf-compact-header {
  border: 1.5px solid var(--pdf-primary-dark);
  border-left: 5px solid var(--pdf-primary);
  border-radius: 2px;
  background: var(--pdf-soft-bg);
  padding: 0.45rem 0.8rem;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* SECTION HEADINGS */
.pdf-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.42rem 0.7rem;
  background: var(--pdf-soft-bg);
  border-left: 4px solid var(--pdf-primary);
  border-bottom: 1.5px solid var(--pdf-primary);
  margin: 0.15rem 0 0.65rem 0;
  font-size: 8.8pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pdf-primary-dark);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-section-heading span.pdf-section-badge {
  font-family: var(--font-mono);
  font-size: 7pt;
  font-weight: 700;
  color: var(--pdf-primary);
}

/* A4 OPTIMIZED TABLE (NO HORIZONTAL OVERFLOW) */
.pdf-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 8.2pt;
  line-height: 1.35;
}

.pdf-table thead {
  display: table-header-group;
}

.pdf-table thead th {
  background: var(--pdf-primary-dark);
  color: #ffffff;
  font-weight: 700;
  font-size: 7.2pt;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.48rem 0.5rem;
  border: 1px solid var(--pdf-primary-dark);
  text-align: left;
  vertical-align: middle;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-table thead th.num {
  text-align: right;
}

.pdf-table thead th.center {
  text-align: center;
}

.pdf-table tbody tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-table tbody td {
  padding: 0.42rem 0.5rem;
  border-bottom: 1px solid #cbd5e1;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.pdf-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.pdf-table .chapter-row td {
  background: var(--pdf-chapter-bg);
  font-weight: 800;
  color: var(--pdf-primary-dark);
  text-transform: uppercase;
  font-size: 7.6pt;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.55rem;
  border-top: 1.5px solid var(--pdf-primary);
  border-bottom: 1.5px solid var(--pdf-primary);
  border-left: 4px solid var(--pdf-primary);
  vertical-align: middle;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-avoid-break {
  break-inside: avoid;
  page-break-inside: avoid;
}

  .pdf-summary-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0.9rem;
  margin-top: 0.95rem;
  align-items: stretch;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-totals-box {
  border: 2px solid var(--pdf-primary-dark);
  border-radius: 3px;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
  color: #0f172a;
  font-size: 8.2pt;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pdf-totals-box-header {
  font-size: 7.6pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pdf-primary-dark);
  background: var(--pdf-soft-bg);
  border-left: 4px solid var(--pdf-primary);
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.45rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-grand-total-box {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--pdf-primary-dark);
  color: var(--pdf-on-dark, #ffffff) !important;
  border: 1.5px solid var(--pdf-primary-dark);
  border-left: 5px solid var(--pdf-accent);
  border-radius: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.8pt;
  font-weight: 800;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.pdf-grand-total-box span,
.pdf-grand-total-box strong {
  color: var(--pdf-on-dark, #ffffff) !important;
}

.pdf-apu-card {
  border: 1.5px solid var(--pdf-border);
  border-top: 3px solid var(--pdf-primary);
  border-radius: 2px;
  margin-bottom: 0.7rem;
  padding: 0.6rem 0.75rem;
  background: #ffffff;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-pet-card {
  border: 1.5px solid var(--pdf-border);
  border-left: 4px solid var(--pdf-primary);
  border-radius: 2px;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #ffffff;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* TOASTS */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-tech-header);
  color: #ffffff;
  border-left: 5px solid #10b981;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-elevated);
  font-size: 0.85rem;
  font-weight: 600;
}

/* FOOTER */
.site-footer {
  background: var(--bg-tech-header);
  color: #cbd5e1;
  padding-block: 1.75rem;
  border-top: 3px solid var(--brand-primary);
  font-size: 0.82rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-note {
  max-width: 75ch;
  margin-top: 0.35rem;
  color: #94a3b8;
}

.footer-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.footer-sep {
  color: #475569;
  opacity: 0.6;
}

.footer-admin-discreet {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0.1rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #64748b;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-admin-discreet:hover,
.footer-admin-discreet.unlocked {
  opacity: 1;
  color: #cbd5e1;
  text-decoration: underline;
}

.print-only {
  display: none;
}

/* 6-DIGIT ADMIN PIN MODAL */
.pin-boxes-container {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.pin-digit-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  outline: none;
}

.pin-digit-input:focus {
  border-color: var(--brand-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.18);
  transform: translateY(-1px);
}

.pin-error-msg {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0.5rem;
}

/* ==========================================
   MODAL 8: PDF STRUCTURAL QUANTITIES IMPORTER (m³)
   ========================================== */
.btn-pdf-computo {
  background: var(--bg-tech-header);
  color: #ffffff;
  border: 1.5px solid var(--bg-tech-header);
  border-left: 4px solid var(--brand-red);
}

.btn-pdf-computo:hover {
  background: #1e293b;
  border-color: #1e293b;
  border-left-color: #ef4444;
}

.pdf-computo-dropzone {
  border: 2px dashed var(--border-accent);
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.pdf-computo-dropzone.drag-over {
  border-color: var(--brand-green);
  background: var(--bg-success-soft);
  transform: scale(1.005);
}

.pcd-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
}

.pcd-icon {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tech-header);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  flex-shrink: 0;
  border-left: 4px solid var(--brand-red);
}

.pcd-copy {
  flex: 1;
  min-width: 260px;
}

.pcd-copy strong {
  display: block;
  font-size: 0.98rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.pcd-copy p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.pcd-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pdf-computo-status {
  margin-top: 0.85rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border-left: 4px solid var(--brand-primary);
  background: var(--bg-accent-soft);
  color: var(--text-primary);
}

.pdf-computo-status.status-success {
  border-left-color: var(--brand-green);
  background: var(--bg-success-soft);
  color: #064e3b;
}

.pdf-computo-status.status-error {
  border-left-color: var(--brand-red);
  background: var(--bg-warn-soft);
  color: #7f1d1d;
}

.pdf-computo-kpis {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pck-item {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pck-item.pck-highlight {
  background: var(--bg-accent-soft);
  border-color: var(--brand-primary);
}

.pck-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.pck-val {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.pck-item.pck-highlight .pck-val {
  color: var(--brand-primary);
  font-size: 1.12rem;
}

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

.pdf-computo-controls-card {
  margin-top: 0.9rem;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pcc-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.pcc-scope-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.pcc-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pcc-smart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border-light);
  font-size: 0.82rem;
}

.pdf-levels-panel {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}

.plp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.plp-quick-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pdf-levels-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pdf-level-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
}

.pdf-level-chip.active {
  border-color: var(--brand-primary);
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
}

.pdf-live-sum-pill {
  background: var(--bg-tech-header);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  border-left: 4px solid var(--brand-green);
}

.pdf-elem-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.pdf-elem-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.pdf-conf-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.42rem;
  border-radius: 3px;
}

.pdf-conf-badge.conf-high {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.pdf-conf-badge.conf-med {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.pdf-conf-badge.conf-warn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.pdf-vol-input {
  width: 118px;
  text-align: right;
  font-weight: 700;
  padding: 0.32rem 0.5rem;
}

.pdf-rubro-select {
  width: 100%;
  min-width: 270px;
  font-size: 0.83rem;
  padding: 0.34rem 0.5rem;
}

.pdf-steel-note {
  font-size: 0.72rem;
  color: var(--brand-primary);
  margin-top: 0.22rem;
}

.pdf-row-excluded {
  opacity: 0.45;
  background: #f8fafc;
}

.pdf-incorporate-options {
  margin-top: 1rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  align-items: center;
}

/* ==========================================
   SEARCHABLE COMBOBOX (KEYBOARD AUTOCOMPLETE)
   & QUICK RUBRO LOADING CONTROLS
   ========================================== */
.scb-native-hidden {
  display: none !important;
}

.searchable-combobox {
  position: relative;
  width: 100%;
  flex: 1;
  min-width: 240px;
}

.scb-composer {
  min-width: 210px;
}

.scb-pdf-row {
  min-width: 270px;
}

.scb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.scb-icon {
  position: absolute;
  left: 0.65rem;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.75;
}

.scb-input {
  width: 100%;
  padding-left: 2.05rem !important;
  padding-right: 3.1rem !important;
  font-weight: 600;
  cursor: text;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.searchable-combobox.open .scb-input,
.scb-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.14);
}

.scb-clear-btn {
  position: absolute;
  right: 1.65rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scb-clear-btn:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.scb-chevron {
  position: absolute;
  right: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.scb-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 80;
  background: #ffffff;
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.scb-dropdown-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.36rem 0.7rem;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.scb-options-scroll {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.scb-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.48rem 0.7rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.08s ease;
}

.scb-option:last-child {
  border-bottom: none;
}

.scb-option:hover,
.scb-option.active {
  background: #dbeafe;
}

.scb-opt-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.scb-code {
  flex-shrink: 0;
}

.scb-name {
  font-weight: 700;
  color: var(--text-primary);
}

.scb-cat {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.06rem 0.38rem;
  border-radius: 3px;
}

.scb-in-budget-pill,
.in-budget-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
}

.rubro-card-in-budget {
  border-color: #16a34a;
}

.scb-opt-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  font-size: 0.78rem;
}

.scb-unit {
  color: var(--text-secondary);
  background: #f1f5f9;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
}

.scb-price {
  color: var(--brand-primary);
}

.scb-empty {
  padding: 0.9rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Inline Quick Quantity + Add Controls on Rubro Cards & Table */
.quick-add-inline-group {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.quick-qty-input {
  width: 68px !important;
  padding: 0.28rem 0.4rem !important;
  font-size: 0.8rem !important;
  font-weight: 700;
  text-align: right;
}

.quick-qty-unit {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.btn-quick-catalog {
  background: #0f766e;
  color: #ffffff;
  border: 1.5px solid #115e59;
  font-weight: 800;
}

.btn-quick-catalog:hover {
  background: #115e59;
}

/* Quick Bulk Rubros Modal */
.mqbr-helper-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #1e3a8a;
}

.mqbr-qty-input {
  width: 92px !important;
  padding: 0.3rem 0.45rem !important;
  font-weight: 700;
  text-align: right;
}

.mqbr-row-selected {
  background: #f0fdf4 !important;
}

/* ==========================================================================
   PRESET BUDGETS LAUNCHPAD, CUSTOMIZABLE M2 CARDS & INTERACTIVE WIZARD
   ========================================================================== */
dialog:modal {
  overscroll-behavior: contain;
}

.presets-launchpad-card {
  border: 2px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

/* Interactive Questionnaire Hero Strip */
.wizard-hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
  color: #ffffff;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid #1e40af;
  margin-bottom: 1.15rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.whs-left {
  flex: 1;
  min-width: 0;
}

.whs-badge {
  display: inline-block;
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.5);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.45rem;
}

.whs-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
  line-height: 1.25;
}

.whs-desc {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin: 0 0 0.75rem 0;
  line-height: 1.45;
  max-width: 78ch;
}

.whs-quick-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.whs-chip-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-right: 0.2rem;
}

.whs-chip {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.26rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.whs-chip:hover {
  background: #f59e0b;
  color: #0f172a;
  border-color: #fbbf24;
  transform: translateY(-1px);
}

.whs-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-wizard-cta {
  background: #f59e0b !important;
  color: #0f172a !important;
  border: 2px solid #fbbf24 !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  padding: 0.72rem 1.25rem !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

.btn-wizard-cta:hover {
  background: #fbbf24 !important;
  transform: translateY(-1px);
}

.whs-meta {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-family: var(--font-mono);
}

/* Presets Header Bar */
.presets-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.95rem;
}

.presets-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.presets-filter-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 0.22rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 0.2rem;
  flex-wrap: wrap;
}

/* Preset Templates Grid */
.presets-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 0.9rem;
}

.preset-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.preset-card:hover {
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
}

.preset-card-active {
  border: 2px solid #16a34a;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 38%);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.12);
}

.pc-header,
.pc-top {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pc-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.1rem;
}

.pc-badge,
.pc-type-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #1e40af;
  background: #dbeafe;
  padding: 0.14rem 0.48rem;
  border-radius: 4px;
}

.pc-rubros-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
}

.pc-active-pill {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 0.1rem 0.44rem;
  border-radius: 4px;
}

.pc-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.pc-desc {
  font-size: 0.77rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.preset-tag {
  font-size: 0.67rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
}

/* Preset Card m2 Customizer Box */
.pc-m2-customizer {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
}

.pc-m2-label-row,
.pc-m2-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.38rem;
}

.pc-m2-header label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
}

.pc-plazo-label {
  font-size: 0.68rem;
  color: #0f766e;
  font-weight: 700;
}

.pc-m2-controls,
.pc-m2-input-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.pc-step-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s;
}

.pc-step-btn:hover {
  background: #e2e8f0;
}

.pc-m2-input-wrap,
.pc-m2-field-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  padding: 0 0.45rem;
}

.pc-m2-input-wrap:focus-within,
.pc-m2-field-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.pc-m2-input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  font-family: var(--font-mono);
  font-size: 0.92rem !important;
  font-weight: 800;
  text-align: center;
  padding: 0.26rem 0.2rem !important;
  color: #0f172a;
  box-shadow: none !important;
}

.pc-m2-unit,
.pc-m2-suffix {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: #475569;
}

.pc-m2-chips {
  display: flex;
  gap: 0.28rem;
  flex-wrap: wrap;
}

.pc-m2-chip,
.preset-m2-chip {
  flex: 1;
  min-width: 52px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.28rem;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
}

.pc-m2-chip:hover,
.preset-m2-chip:hover {
  border-color: #2563eb;
  color: #1d4ed8;
}

.pc-m2-chip.active,
.preset-m2-chip.active {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #ffffff;
}

/* Preset Card Live Metrics */
.pc-metrics-box {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  border-left: 3px solid #1e3a8a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.pc-metric-col {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.pc-metric-right {
  text-align: right;
  align-items: flex-end;
}

.pc-metric-label {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  font-weight: 700;
}

.pc-metric-m2 {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e3a8a;
}

.pc-metric-total {
  font-size: 0.94rem;
  font-weight: 800;
  color: #0f172a;
}

.pc-actions .btn-block,
.pc-load-btn {
  width: 100%;
  justify-content: center;
  font-weight: 800;
  padding: 0.52rem 0.75rem;
}

/* Card A: Auto-scale m2 Box */
.m2-autoscale-box {
  margin-top: 0.35rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.m2-autoscale-check {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: #1e3a8a !important;
  cursor: pointer;
  margin: 0 !important;
}

/* ==========================================================================
   MODAL ASISTENTE DE PRESUPUESTO POR PREGUNTAS (WIZARD)
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wizard-dialog-body {
  max-height: 68vh;
  overflow-y: auto;
  padding: 0 1.35rem 1.15rem 1.35rem;
}

.wizard-stepper-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
  margin: 0 -1.35rem 1rem -1.35rem;
  padding: 0.65rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.wizard-stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.wiz-step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wiz-step-item:hover {
  border-color: #2563eb;
}

.wiz-step-item.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

.wiz-step-item.done {
  background: #ecfdf5;
  color: #065f46;
  border-color: #6ee7b7;
}

.wiz-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.wiz-step-item.active .wiz-step-num {
  background: #f59e0b;
  color: #0f172a;
}

.wiz-step-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.wiz-step-text strong {
  font-size: 0.78rem;
}

.wiz-step-text span {
  font-size: 0.68rem;
  opacity: 0.85;
}

.wizard-fieldset {
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.05rem;
  margin: 0 0 1rem 0;
  background: #ffffff;
}

.wizard-legend {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  padding: 0 0.4rem;
}

.wizard-split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.wizard-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.wizard-choice-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
}

.wizard-choice-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.wiz-choice-card {
  position: relative;
  display: block;
  padding: 0.72rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.14s ease;
}

.wiz-choice-card:hover {
  border-color: #3b82f6;
  background: #ffffff;
}

.wiz-choice-card input[type="radio"] {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  accent-color: #1e3a8a;
}

.wiz-choice-card:has(input:checked) {
  border-color: #1e3a8a;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #1e3a8a;
}

.wcc-body {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding-right: 1.1rem;
}

.wcc-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.wcc-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wcc-info strong {
  font-size: 0.84rem;
  color: #0f172a;
}

.wcc-info span {
  font-size: 0.73rem;
  color: #475569;
  line-height: 1.35;
}

/* Wizard Step 1 m2 Box */
.wiz-m2-control-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.wiz-m2-input-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.wiz-m2-big-input {
  width: 135px !important;
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  text-align: center;
  color: #1e3a8a !important;
  border: 2px solid #1e3a8a !important;
}

.wiz-m2-unit {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  color: #334155;
}

.wiz-m2-slider {
  width: 100%;
  accent-color: #1e3a8a;
  margin-bottom: 0.45rem;
}

.wiz-m2-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.wiz-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.wiz-chip:hover,
.wiz-chip.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

/* Wizard Step 3 Counters */
.wiz-field-hint {
  font-size: 0.78rem;
  color: #475569;
  margin: 0 0 0.65rem 0;
}

.wizard-counters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.wiz-counter-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.wiz-counter-card label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.wiz-counter-sub {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
}

/* Wizard Step 4 Extras Grid */
.wizard-extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 0.65rem;
}

.wiz-extra-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.14s ease;
}

.wiz-extra-card:hover {
  border-color: #2563eb;
  background: #ffffff;
}

.wiz-extra-card input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 16px;
  height: 16px;
  accent-color: #1e3a8a;
  flex-shrink: 0;
}

.wiz-extra-card:has(input:checked) {
  border-color: #16a34a;
  background: #f0fdf4;
}

.wec-content {
  flex: 1;
  min-width: 0;
}

.wec-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

.wec-top strong {
  font-size: 0.82rem;
  color: #0f172a;
}

.wec-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #334155;
  padding: 0.08rem 0.38rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.wec-content p {
  font-size: 0.72rem;
  color: #475569;
  margin: 0;
  line-height: 1.35;
}

/* Wizard Footer Live Summary & Actions */
.wizard-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #f8fafc;
}

.wiz-live-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wls-item {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
}

.wls-label {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
}

.wls-item strong {
  font-size: 0.85rem;
  color: #0f172a;
}

.wls-total-box strong {
  font-size: 1.05rem;
  color: #1e3a8a;
}

.wls-sep {
  width: 1px;
  height: 26px;
  background: #cbd5e1;
}

.wiz-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-wiz-generate {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

.btn-wiz-generate:hover {
  background: #15803d !important;
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .wizard-hero-strip {
    flex-direction: column;
    align-items: stretch;
  }
  .whs-right {
    align-items: stretch;
  }
  .wizard-stepper,
  .wizard-split-2 {
    grid-template-columns: 1fr;
  }
  .budget-summary-layout,
  .quote-dispatch-layout,
  .composer-split,
  .spec-grid,
  .form-grid-4,
  .pdf-computo-kpis,
  .pdf-incorporate-options {
    grid-template-columns: 1fr;
  }
  .rubros-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   PRINT STYLESHEET FOR A4 MULTI-PAGE PDF
   ========================================== */
@page {
  size: A4 portrait;
  margin: 10mm 12mm;
}

@media print {
  html, body {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 9pt;
    margin: 0 !important;
    padding: 0 !important;
  }

  .no-print,
  header,
  nav,
  main,
  footer,
  dialog,
  .toast-container {
    display: none !important;
  }

  .print-only {
    display: block !important;
    width: 100% !important;
  }

  .pdf-document-stack {
    display: block !important;
  }

  .pdf-page {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 274mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    page-break-after: always !important;
    break-after: page !important;
  }

  .pdf-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .pdf-header-card,
  .pdf-title-banner,
  .pdf-page-pill,
  .pdf-client-strip,
  .pdf-compact-header,
  .pdf-section-heading,
  .pdf-totals-box-header,
  .pdf-grand-total-box,
  .pdf-table thead th,
  .pdf-table .chapter-row td,
  .btc-grand-total {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
