/* Comercios de escritorio: mismos colores y estilo que la app Comercios (naranja del logo + blanco, esquinas redondeadas).
   Regla de la casa: las tarjetas nunca llevan borde alrededor; se distinguen por el fondo. */
:root {
  --naranja: #F97A28; --naranja-osc: #D9600F; --naranja-press: #E0661A; --suave: #FFF1E6; --suave-sel: #FFDDC4;
  --fondo: #F4F4F6; --blanco: #FFFFFF; --gris: #F1F1F3; --linea: #E9E9EC;
  --texto: #16161A; --sec: #5E5E66; --muted: #9A9AA2;
  --verde: #1F9D55; --verde-suave: #E7F6EE; --rojo: #D93B3B; --rojo-suave: #FDECEC; --amarillo: #E8A317; --amarillo-suave: #FFF6DF; --azul: #2F6FEB;
  --r: 14px; --r-lg: 20px; --sombra: 0 4px 16px rgba(0, 0, 0, 0.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fondo); color: var(--texto); font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--naranja-osc); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 900; }
h2 { font-size: 19px; font-weight: 900; }
h3 { font-size: 15px; font-weight: 800; }
.sec { color: var(--sec); }
.muted { color: var(--muted); }
.peq { font-size: 12px; }
.fuerte { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }
.fila { display: flex; align-items: center; gap: 10px; }
.fila.sep { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.centro { text-align: center; }
.der { text-align: right; }
.oculto { display: none !important; }

/* Botones */
.btn { border: none; border-radius: 12px; padding: 10px 16px; font-weight: 800; cursor: pointer; background: var(--naranja); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background .12s, transform .05s; }
.btn:hover { background: var(--naranja-press); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sec { background: var(--suave); color: var(--naranja-osc); }
.btn.sec:hover { background: var(--suave-sel); }
.btn.gris { background: var(--gris); color: var(--texto); }
.btn.gris:hover { background: var(--linea); }
.btn.ghost { background: transparent; color: var(--naranja-osc); }
.btn.ghost:hover { background: var(--suave); }
.btn.peligro { background: var(--rojo-suave); color: var(--rojo); }
.btn.verde { background: var(--verde); }
.btn.peq { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn.grande { padding: 16px 22px; font-size: 17px; border-radius: 16px; }
.btn.ancho { width: 100%; }

/* Campos */
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo > span { font-size: 12px; font-weight: 700; color: var(--sec); }
.campo .ayuda { font-size: 12px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=time], input[type=search], input[type=url], select, textarea {
  width: 100%; border: none; background: var(--gris); border-radius: 12px; padding: 11px 12px; outline: none; transition: box-shadow .12s, background .12s;
}
input:focus, select:focus, textarea:focus { background: #fff; box-shadow: 0 0 0 2px var(--naranja); }
textarea { resize: vertical; min-height: 70px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--naranja); }

/* Interruptor */
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--linea); border-radius: 26px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--naranja); }
.switch input:checked + span::before { transform: translateX(18px); }

/* Tarjetas (sin borde) */
.tarjeta { background: var(--blanco); border-radius: var(--r-lg); padding: 18px; }
.tarjeta.suave { background: var(--suave); }
.tarjeta.gris { background: var(--gris); }
.caja-gris { background: var(--fondo); border-radius: var(--r); padding: 12px; }
.franja { border-left: 4px solid var(--naranja); padding-left: 10px; }

/* Etiquetas */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--gris); color: var(--sec); white-space: nowrap; }
.badge.naranja { background: var(--suave); color: var(--naranja-osc); }
.badge.verde { background: var(--verde-suave); color: var(--verde); }
.badge.rojo { background: var(--rojo-suave); color: var(--rojo); }
.badge.amarillo { background: var(--amarillo-suave); color: #9A6B00; }
.badge.oscuro { background: var(--texto); color: #fff; }

/* Avisos */
.aviso { border-radius: var(--r); padding: 12px 14px; font-size: 13px; line-height: 1.45; background: var(--suave); color: var(--naranja-osc); }
.aviso.rojo { background: var(--rojo-suave); color: var(--rojo); }
.aviso.verde { background: var(--verde-suave); color: var(--verde); }
.aviso.amarillo { background: var(--amarillo-suave); color: #8A5F00; }
.aviso.gris { background: var(--gris); color: var(--sec); }

/* Tablas */
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; }
.tabla td { padding: 10px; border-top: 1px solid var(--gris); vertical-align: middle; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: var(--fondo); }

/* Modal */
.modal-fondo { position: fixed; inset: 0; background: rgba(0,0,0,.42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.modal { background: #fff; border-radius: 22px; width: min(560px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.ancho { width: min(860px, 100%); }
.modal-pie { display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: -22px; background: #fff; padding: 12px 0 0; margin-bottom: -6px; }

/* Aviso flotante */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--texto); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 80; box-shadow: var(--sombra); max-width: 80vw; }
.toast.rojo { background: var(--rojo); }
.toast.verde { background: var(--verde); }

/* Vacío y cargando */
.vacio { text-align: center; color: var(--muted); padding: 40px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vacio .ico { font-size: 34px; }
.cargando { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); gap: 10px; }
.giro { width: 20px; height: 20px; border: 3px solid var(--suave-sel); border-top-color: var(--naranja); border-radius: 50%; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* Barras de gráfico simples */
.barras { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.barras .b { flex: 1; background: var(--suave-sel); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.barras .b.on { background: var(--naranja); }
.barras-etq { display: flex; gap: 4px; }
.barras-etq span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }
.progreso { height: 8px; background: var(--gris); border-radius: 8px; overflow: hidden; }
.progreso > div { height: 100%; background: var(--naranja); border-radius: 8px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D5D5DA; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* Resultados del buscador de lugares (mapa) */
.sug { display: block; width: 100%; border: none; background: var(--suave); color: var(--texto); padding: 10px 12px; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; }
.sug:hover { background: var(--suave-sel); }
