:root {
  /* Paleta oficial de Rols (manual de marca):
     sand=#D7CDC5  white=#FFF  tan=#D5B38C  graphite=#4D4D4D */
  --bg-page: #FAF8F6;
  --bg-card: #FFFFFF;
  --bg-sidebar: #4D4D4D;
  --bg-sidebar-hover: #5a5a5a;
  --bg-sidebar-active: #6a6a6a;
  --text-sidebar: #D7CDC5;
  --text-sidebar-active: #FFFFFF;
  --accent: #D5B38C;
  --accent-hover: #B89368;
  --accent-soft: #EFE2CD;
  --border: #E5DCD2;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: #2a2a2a;
}

.sidebar { background: var(--bg-sidebar); color: var(--text-sidebar); }
.rols-logo {
  width: 90px; height: auto; display: block;
  filter: brightness(0) invert(1);
}
.sidebar a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.85rem; border-radius: 0.5rem;
  font-size: 0.875rem; color: var(--text-sidebar);
  transition: background 0.15s;
}
.sidebar a:hover { background: var(--bg-sidebar-hover); }
.sidebar a.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); font-weight: 500; }
.sidebar a .check {
  width: 16px; height: 16px; border: 1.5px solid #888879; border-radius: 4px;
  display: inline-block; flex-shrink: 0;
}
.sidebar a.active .check { background: var(--accent); border-color: var(--accent); }

.btn-accent {
  background: var(--accent); color: #fff; border-radius: 999px;
  padding: 0.65rem 1.3rem; font-size: 0.9rem; font-weight: 500;
  transition: background 0.15s;
  border: none; cursor: pointer;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }

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

.input-line, select.input-line {
  width: 100%; padding: 0.7rem 0.95rem; border-radius: 14px;
  border: 1px solid var(--border); background: #fff; font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #2a2a2a;
}
.input-line:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(179,153,98,0.15); }

/* === Dropdown de país con banderas (img reales; Windows no pinta los emoji) === */
.hidden-native { display: none !important; }
.flag-select { position: relative; }
.flag-select__field {
  width: 100%; padding: 0.7rem 0.95rem; border-radius: 14px;
  border: 1px solid var(--border); background: #fff;
  display: flex; align-items: center; gap: 0.5rem; cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.flag-select.open .flag-select__field,
.flag-select__field:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(179,153,98,0.15);
}
.flag-select.is-disabled .flag-select__field {
  opacity: 0.55; cursor: not-allowed; background: var(--bg-page);
}
.flag-select__flag { display: inline-flex; align-items: center; flex-shrink: 0; }
.flag-select__flag:empty { display: none; }
.flag-select__input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 0.9rem; color: #2a2a2a; padding: 0;
}
.flag-select__input::placeholder { color: #9a8f84; }
.flag-select__input:disabled { cursor: not-allowed; }
.flag-select__empty { padding: 0.55rem 0.7rem; color: #9a8f84; font-size: 0.85rem; cursor: default; }
.flag-select__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag-select__meta { margin-left: auto; padding-left: 0.6rem; color: #9a8f84; font-size: 0.75rem; flex-shrink: 0; }
.kg-logo { height: 15px; width: auto; display: block; }
.rols-mark { height: 13px; width: auto; display: block; opacity: 0.85; }
.flag-select__arrow { color: #9a8f84; font-size: 0.7rem; transition: transform 0.2s; }
.flag-select.open .flag-select__arrow { transform: rotate(180deg); }
.flag-select__options {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10); padding: 4px; margin: 0; list-style: none;
  max-height: 280px; overflow-y: auto; display: none;
}
.flag-select.open .flag-select__options { display: block; }
.flag-select__options li {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem;
  border-radius: 10px; cursor: pointer; font-size: 0.9rem; color: #2a2a2a;
}
.flag-select__options li:hover,
.flag-select__options li.is-active { background: var(--accent-soft); }
.flag-img {
  width: 22px; height: 16px; object-fit: cover; border-radius: 2px;
  flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.06); display: inline-block;
}
.flag-fallback { width: auto; height: auto; box-shadow: none; font-size: 1rem; }

.step-badge {
  width: 28px; height: 28px; border-radius: 999px;
  background: #EFE2CD; color: #B89368;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; flex-shrink: 0;
}

.breadcrumb { color: #8a8076; font-size: 0.8rem; }
.breadcrumb a { color: #8a8076; }
.breadcrumb a:hover { color: var(--accent-hover); }

/* Tabla de cotizaciones */
.tabla-precios {
  width: 100%; border-collapse: separate; border-spacing: 0;
}
.tabla-precios th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: #8a8076; border-bottom: 1px solid var(--border);
}
.tabla-precios th.num, .tabla-precios td.num { text-align: right; }
.tabla-precios td {
  padding: 0.85rem 1rem; font-size: 0.9rem;
  border-bottom: 1px solid #F2EDE8;
}
.tabla-precios tr:last-child td { border-bottom: none; }
.tabla-precios tr.fila-mejor { background: linear-gradient(90deg, rgba(213,179,140,0.10), rgba(213,179,140,0.0) 60%); }
.tabla-precios tr.fila-mejor td:first-child { border-left: 3px solid var(--accent); padding-left: calc(1rem - 3px); }
.tabla-precios tr.sin-servicio td { color: #b3a89c; font-style: italic; }

.badge-zona {
  display: inline-block; padding: 0.18rem 0.55rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  background: var(--accent-soft); color: #8a6b3d;
}
.badge-mejor {
  display: inline-block; padding: 0.18rem 0.55rem;
  border-radius: 999px; font-size: 0.7rem; font-weight: 600;
  background: #d6efd6; color: #1f5d2c;
  letter-spacing: 0.03em; text-transform: uppercase;
  margin-left: 0.4rem; vertical-align: middle;
}
.precio-total { font-weight: 700; color: #2a2a2a; }

.kpi {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.85rem 1rem; border: 1px solid var(--border);
  border-radius: 14px; background: #FAF8F6;
}
.kpi .label {
  font-size: 0.7rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: #8a8076; font-weight: 600;
}
.kpi .value {
  font-size: 1.15rem; font-weight: 600; color: #2a2a2a;
}
.kpi .unit { font-size: 0.7rem; color: #8a8076; font-weight: 400; margin-left: 0.2rem; }

.alert-error {
  padding: 0.85rem 1rem; border-radius: 12px;
  background: #f3d4d4; color: #6f1f1f;
  font-size: 0.88rem; border: 1px solid #e6b3b3;
}

.loading { color: #8a8076; font-size: 0.88rem; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.18s ease-out; }
