/* Central Soluciones D.S. · marca SDS oscura (brief sección 3). Mobile-first, 375 px. */
:root {
  --naranja: #F97316; --naranja-2: #FB923C; --fondo: #111113; --tarjeta: #1C1C20; --tarjeta-2: #28282C;
  --borde: #34343A; --texto: #FFFFFF; --texto-2: #BEBEC4; --texto-3: #8A8A92; --wa: #25D366;
  --verde: #22C55E; --azul: #3B82F6; --ambar: #F59E0B; --gris: #9CA3AF; --gris-osc: #52525B; --rojo: #EF4444;
  --radio: 16px; --barra-h: 108px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: 'Fira Sans', system-ui, sans-serif; font-weight: 400;
  background: var(--fondo); color: var(--texto); line-height: 1.4; overflow-x: hidden;
  background-image: radial-gradient(120% 50% at 50% 115%, rgba(78, 34, 8, .55), transparent 70%); background-attachment: fixed;
}
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--texto-2); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--naranja-2); outline-offset: 2px; }

/* ---------- Botones e inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--borde); background: var(--tarjeta-2); font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #0B2A16; }
.btn-full { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; pointer-events: none; }
.btn-off[aria-disabled="true"] { opacity: .85; }
.btn-off { background: transparent; border-style: dashed; color: var(--texto-2); font-weight: 500; font-size: 13px; }
.btn-sm { min-height: 36px; font-size: 13px; padding: 0 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; font-size: 20px; cursor: pointer; flex-shrink: 0; }
.icon-btn:active { background: var(--tarjeta-2); }
.lbl { display: block; font-size: 13px; font-weight: 500; color: var(--texto-2); margin: 12px 0 6px; }
.inp {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--borde);
  background: var(--tarjeta); font-size: 16px; /* 16 px: iOS no hace zoom */
}
textarea.inp { min-height: 90px; resize: vertical; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.inp:focus { border-color: var(--naranja); outline: none; }
.err { color: #FCA5A5; font-size: 14px; margin: 10px 0 0; }
.ayuda { font-size: 12px; color: var(--texto-3); margin: 6px 0 0; }

/* ---------- Login ---------- */
.login { max-width: 380px; margin: 0 auto; padding: 14vh 24px 40px; text-align: center; }
.login-logo { width: 240px; height: auto; }
.login-tit { font-weight: 900; font-size: 30px; margin: 18px 0 4px; }
.login-form { text-align: left; margin-top: 22px; }
.login-form .btn { margin-top: 20px; }

/* ---------- Encabezado ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px 14px; background: rgba(17, 17, 19, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--borde);
}
.hdr-logo { height: 30px; width: auto; }
.hdr-tag { font-size: 12px; font-weight: 700; color: var(--naranja); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.view { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(var(--barra-h) + 24px + env(safe-area-inset-bottom)); }
.view.sin-barra { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

/* ---------- Títulos y bloques ---------- */
.h1 { font-weight: 900; font-size: 24px; margin: 4px 0 2px; letter-spacing: -.01em; }
.h2 { font-weight: 900; font-size: 18px; margin: 22px 0 10px; }
.sub { font-size: 14px; color: var(--texto-2); margin: 0 0 12px; }
.card { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; }

/* Bloque "Hoy" */
.hoy { border-color: rgba(249, 115, 22, .45); background: linear-gradient(180deg, rgba(249, 115, 22, .10), var(--tarjeta) 60%); }
.hoy-tit { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.hoy-tit h2 { font-weight: 900; font-size: 20px; margin: 0; }
.hoy-tit span { font-size: 13px; color: var(--texto-2); }
.hoy-lista { list-style: none; margin: 0; padding: 0; }
.hoy-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 2px; border: 0; border-top: 1px solid var(--borde);
  background: none; cursor: pointer; min-height: 48px; }
.hoy-lista li:first-child .hoy-item { border-top: 0; }
.hoy-item b { display: block; font-weight: 700; font-size: 15px; }
.hoy-item small.linea { display: flex; gap: 8px; align-items: flex-start; color: var(--texto-2); font-size: 13.5px; margin-top: 3px; }
.hoy-item small.linea .punto { margin-top: 5px; width: 8px; height: 8px; }
.hoy-item .flecha { color: var(--texto-3); font-size: 22px; line-height: 1; align-self: center; }
.hoy-vacio { margin: 4px 0 2px; color: var(--texto-2); }
.punto { width: 10px; height: 10px; border-radius: 99px; margin-top: 6px; flex-shrink: 0; background: var(--rojo); }
.punto.ambar { background: var(--ambar); } .punto.azul { background: var(--azul); }

/* Números compactos */
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 12px; padding: 10px 4px; }
.num { text-align: center; padding: 0 4px; border-left: 1px solid var(--borde); min-width: 0; }
.num:first-child { border-left: 0; }
.num dd { margin: 0; font-weight: 900; font-size: 20px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num dt { font-size: 10.5px; font-weight: 500; color: var(--texto-2); text-transform: uppercase; letter-spacing: .03em; line-height: 1.2; margin-top: 3px; }
.num dd.chico { font-size: 12px; font-weight: 500; white-space: normal; color: var(--texto-2); line-height: 1.2; }

/* Tarjeta de comercio */
.lista { display: grid; gap: 12px; margin-top: 14px; }
.com { position: relative; cursor: pointer; }
.com:active { border-color: var(--naranja); }
.com-top { display: flex; gap: 12px; align-items: center; }
.logo { width: 48px; height: 48px; border-radius: 12px; background: var(--tarjeta-2); object-fit: cover; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 900; font-size: 20px; color: var(--naranja); overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.com-nombre { font-weight: 900; font-size: 17px; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.com-slug { font-size: 12px; color: var(--texto-3); }
.etqs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.etq { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  border: 1px solid currentColor; line-height: 1.2; }
.etq::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.etq.sin-punto::before { display: none; }
.e-cliente { color: #4ADE80; } .e-prueba { color: #60A5FA; } .e-prospecto { color: #FBBF24; } .e-pausado { color: #D1D5DB; } .e-baja { color: #A1A1AA; border-style: dashed; }
.e-plan { color: var(--texto-2); border-color: var(--borde); }
.e-demo { color: #fff; background: var(--naranja); border-color: var(--naranja); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; background: var(--fondo); border-radius: 12px; padding: 8px 2px; }
.stats div { text-align: center; min-width: 0; }
.stats b { display: block; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats span { font-size: 11px; color: var(--texto-3); }
.ultimo { font-size: 13px; color: var(--texto-2); margin: 8px 0 0; }
.alerta { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  background: rgba(239, 68, 68, .14); color: #FECACA; border: 1px solid rgba(239, 68, 68, .45); }
.alerta.ambar { background: rgba(245, 158, 11, .12); color: #FDE68A; border-color: rgba(245, 158, 11, .45); }
.alerta.gris { background: rgba(156, 163, 175, .12); color: #E5E7EB; border-color: rgba(156, 163, 175, .4); }
.alerta .mas { margin-left: auto; font-weight: 700; font-size: 12px; opacity: .85; white-space: nowrap; }
.paso { display: flex; gap: 8px; align-items: baseline; margin-top: 10px; font-size: 14px; }
.paso b { font-weight: 700; color: var(--naranja-2); white-space: nowrap; }
.paso.vacio { color: var(--texto-3); }
.paso.vacio u { color: var(--naranja-2); text-decoration: none; font-weight: 700; }
.acciones { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.acciones .btn { padding: 0 8px; font-size: 14px; }

/* Barra fija de filtros (al alcance del pulgar) */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(17, 17, 19, .96); border-top: 1px solid var(--borde); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.barra > * { max-width: 736px; margin-left: auto; margin-right: auto; }
.inp-buscar { min-height: 42px; border-radius: 999px; padding-left: 16px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--borde); background: var(--tarjeta);
  font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--texto-2); }
.chip.on { background: var(--naranja); border-color: var(--naranja); color: #fff; }
.vacio-lista { text-align: center; color: var(--texto-2); padding: 28px 10px; }

/* ---------- Ficha ---------- */
.ficha-cab { display: flex; gap: 12px; align-items: center; }
.ficha-cab .logo { width: 60px; height: 60px; border-radius: 14px; font-size: 26px; }
.ficha-botones { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 14px; }
.ficha-botones .btn-full { grid-column: 1 / -1; }
.salud { list-style: none; margin: 0; padding: 0; }
.salud li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--borde); font-size: 14.5px; }
.salud li:first-child { border-top: 0; }
.salud .ic { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; font-size: 13px; font-weight: 900; flex-shrink: 0; }
.ic.ok { background: rgba(34, 197, 94, .2); color: #4ADE80; } .ic.no { background: rgba(239, 68, 68, .18); color: #FCA5A5; } .ic.info { background: var(--tarjeta-2); color: var(--texto-2); }
.salud small { display: block; color: var(--texto-3); font-size: 12.5px; }
.salud-res { font-weight: 700; margin: 0 0 8px; }
.salud-res.ok { color: #4ADE80; } .salud-res.no { color: #FDE68A; }
.dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.dato { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--borde); font-size: 14.5px; }
.dato:first-child { border-top: 0; }
.dato span { color: var(--texto-2); }
.dato b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.aviso-fijo { font-size: 12.5px; color: #FDE68A; margin: 6px 0 0; }
.rapidas { display: grid; gap: 8px; }
.rapida { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--borde); }
.rapida:first-child { border-top: 0; }
.rapida p { margin: 0; flex: 1; font-size: 14.5px; }
.rapida small { display: block; color: var(--texto-3); font-size: 12.5px; }
.seg { display: inline-flex; background: var(--fondo); border: 1px solid var(--borde); border-radius: 999px; padding: 3px; }
.seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-weight: 700; font-size: 13.5px; color: var(--texto-2); cursor: pointer; }
.seg button.on { background: var(--naranja); color: #fff; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.hist li { padding: 7px 0; border-top: 1px solid var(--borde); }
.hist li:first-child { border-top: 0; }
.hist time { color: var(--texto-3); font-variant-numeric: tabular-nums; margin-right: 6px; }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▾"; float: right; color: var(--texto-3); }
details[open].card > summary::after { content: "▴"; }
.guardar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); margin-top: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--barra-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: #fff; color: #111113; font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  max-width: calc(100% - 32px); text-align: center; }
.cargando { text-align: center; color: var(--texto-2); padding: 40px 0; }

@media (min-width: 640px) {
  .view { padding-left: 20px; padding-right: 20px; }
  .lista { grid-template-columns: 1fr 1fr; }
  .h1 { font-size: 28px; }
}

/* Los campos de fecha tienen un ancho mínimo propio: que no se salgan de la grilla en 375 px */
.dos > div { min-width: 0; }
input[type="date"].inp { min-width: 0; max-width: 100%; display: block; -webkit-appearance: none; appearance: none; }

/* Celulares muy angostos (320-359 px): el encabezado entra con la flecha de volver */
@media (max-width: 359px) {
  .hdr { gap: 2px; padding-left: 6px; }
  .hdr-tag { display: none; }
  .hdr-logo { height: 26px; }
  .nums dd { font-size: 17px; }
}

/* Sugerencia de @Marketing: "Ofrecer Plan Full" */
.sugerencia { margin-top: 12px; border-color: rgba(245, 158, 11, .5); background: linear-gradient(180deg, rgba(245, 158, 11, .10), var(--tarjeta) 70%); }
.sugerencia p { margin: 0 0 10px; font-size: 14.5px; }

/* Botón "Instalar": solo en el inicio, y le deja lugar ocultando la palabra "Central" */
.hdr.con-instalar .hdr-tag { display: none; }
body.en-ficha #hdr-instalar { display: none !important; }
