/* AnswerRig · estilos del alta y del panel (mismo diseño que el lienzo) */
:root {
  --fondo: #F4F2EE; --tinta: #16181B; --texto: #3A3E44; --suave: #5B5F66; --linea: #DEDAD2; --campo: #C9C5BC; --tenue: #EFEBE4;
  --naranja: #C2410C; --naranja-claro: #F97316; --naranja-fondo: #FFF7F2; --verde: #15803D; --verde-fondo: #DCFCE7;
  --ambar: #92400E; --ambar-fondo: #FEF3C7; --rojo: #B42318; --rojo-fondo: #FDE2D6;
  --titulo: Archivo, Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
a { color: var(--tinta); } a:hover { color: var(--naranja); }
h1, h2, h3 { font-family: var(--titulo); letter-spacing: -0.02em; margin: 0; }
h1 { font-weight: 800; font-size: 32px; } h2 { font-weight: 800; font-size: 20px; } h3 { font-weight: 700; font-size: 16px; }
p { margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.oculto { position: absolute; left: -9999px; }
[hidden] { display: none !important; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); }
.logo b { font-weight: 800; font-size: 20px; letter-spacing: -0.035em; }
.logo b span { color: var(--naranja); }
.oscuro .logo, .logo.oscuro { color: #F4F2EE; } .oscuro .logo b span { color: var(--naranja-claro); }

/* Estructura */
.cabecera { background: #fff; border-bottom: 1px solid var(--linea); }
.cabecera > div { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.contenido { max-width: 1120px; margin: 0 auto; padding: 8px 24px 64px; }
.fila { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.fila > * { min-width: 0; }
.col { display: flex; flex-direction: column; gap: 16px; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tarjeta { background: #fff; border: 1px solid var(--linea); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.tarjeta.oscura { background: var(--tinta); color: #F4F2EE; border-color: var(--tinta); }
.tarjeta.destacada { border: 2px solid var(--naranja); }
.nota { background: var(--fondo); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--texto); }
.aviso { border-radius: 12px; padding: 12px 16px; font-size: 15px; }
.aviso.ambar { background: var(--ambar-fondo); border: 1px solid #F5D58A; }
.aviso.rojo { background: var(--rojo-fondo); border: 1px solid #F3B4A3; color: #7A1A10; }
.aviso.verde { background: var(--verde-fondo); border: 1px solid #A7E3B9; }
.suave { color: var(--suave); } .peq { font-size: 14px; } .mini { font-size: 13px; }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label, .etiqueta { font-weight: 600; font-size: 14px; }
.campo input, .campo select, .campo textarea { border: 1px solid var(--campo); border-radius: 10px; padding: 12px 14px; min-height: 48px; background: #fff; width: 100%; }
.campo textarea { resize: vertical; min-height: 96px; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--naranja); outline-offset: 1px; border-color: var(--naranja); }
.campo .error { color: var(--rojo); font-size: 13px; }
.campo.mal input, .campo.mal select, .campo.mal textarea { border-color: var(--rojo); }
.dinero { display: flex; align-items: center; border: 1px solid var(--campo); border-radius: 10px; padding: 0 14px; background: #fff; }
.dinero input { border: 0 !important; outline: none; min-height: 46px; padding: 0 6px !important; }

/* Botones */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 10px; font-weight: 700; text-decoration: none; cursor: pointer; border: 0; background: var(--naranja); color: #fff; }
.boton:hover { background: #A8370A; color: #fff; }
.boton.negro { background: var(--tinta); } .boton.negro:hover { background: #000; }
.boton.borde { background: #fff; color: var(--tinta); border: 1px solid var(--campo); font-weight: 600; }
.boton.borde:hover { border-color: var(--tinta); color: var(--tinta); }
.boton.peligro { background: #fff; color: var(--rojo); border: 1px solid var(--campo); font-weight: 600; }
.boton.peq { min-height: 40px; padding: 0 14px; font-size: 15px; }
.boton.grande { min-height: 56px; font-size: 18px; padding: 0 32px; }
.boton[disabled] { opacity: 0.55; cursor: not-allowed; }
.boton.enlace { background: none; color: var(--tinta); padding: 0 8px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--campo); background: #fff; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--naranja); background: var(--naranja-fondo); }
.chip.cuadrado { border-radius: 10px; border-width: 1px; font-weight: 500; }
.chip.cuadrado[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.etiq { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.etiq.Booked { background: var(--verde-fondo); color: var(--verde); }
.etiq.Message { background: var(--ambar-fondo); color: var(--ambar); }
.etiq.Emergency { background: var(--rojo-fondo); color: var(--rojo); }
.etiq.Chat, .etiq.No { background: var(--tenue); color: var(--texto); }
.interruptor { width: 52px; height: 30px; border-radius: 999px; border: 0; cursor: pointer; background: var(--campo); position: relative; flex: 0 0 auto; }
.interruptor::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.interruptor[aria-checked="true"] { background: var(--verde); } .interruptor[aria-checked="true"]::after { left: 25px; }

/* Pasos del alta */
.pasos { list-style: none; margin: 0; padding: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pasos li { flex: 1 1 150px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--suave); }
.pasos li::before { content: ""; height: 6px; border-radius: 3px; background: var(--linea); }
.pasos li.hecho, .pasos li.ahora { color: var(--tinta); } .pasos li.ahora { font-weight: 700; }
.pasos li.hecho::before, .pasos li.ahora::before { background: var(--naranja); }

/* Tablas */
.tabla-caja { overflow-x: auto; background: #fff; border: 1px solid var(--linea); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 13px; color: var(--suave); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--linea); }
td { padding: 10px 14px; border-bottom: 1px solid var(--tenue); font-size: 14px; vertical-align: top; }

/* Panel */
.panel { display: flex; flex-wrap: wrap; min-height: 100vh; }
.menu { flex: 1 1 240px; max-width: 100%; background: var(--tinta); color: #F4F2EE; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 900px) { .menu { flex: 0 0 248px; min-height: 100vh; position: sticky; top: 0; align-self: flex-start; } }
.menu nav { display: flex; flex-direction: column; gap: 2px; }
.menu nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: #C9CCD1; font-weight: 500; }
.menu nav a[aria-current="page"] { background: #2E3238; color: #fff; font-weight: 700; }
.menu nav a .cuenta { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--tinta); background: var(--naranja-claro); border-radius: 999px; padding: 1px 7px; }
.empresa { background: #23262B; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #22C55E; } .punto.parado { background: #F59E0B; }
.principal { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) { .principal { padding: 20px 16px 40px; } .contenido { padding: 8px 16px 48px; } }
.kpi { background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi .valor { font-weight: 800; font-size: 34px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.barra { height: 10px; border-radius: 5px; background: var(--tenue); overflow: hidden; } .barra > span { display: block; height: 100%; border-radius: 5px; background: var(--naranja); }
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { border-bottom: 1px solid var(--tenue); }
.elemento { display: flex; gap: 12px; align-items: center; padding: 10px 0; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; color: inherit; }
.icono { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; background: var(--tenue); }
.icono.wa { background: var(--verde-fondo); color: var(--verde); }
.recorta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burbuja { max-width: 82%; border-radius: 12px; padding: 8px 12px; font-size: 14px; white-space: pre-wrap; }
.burbuja.ava { align-self: flex-start; background: var(--tinta); color: #F4F2EE; }
.burbuja.cliente { align-self: flex-end; background: var(--tenue); }
.burbuja small { display: block; font-size: 12px; font-weight: 700; opacity: 0.8; }
.pestanas { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--linea); }
.pestanas button { border: 0; background: none; min-height: 48px; padding: 0 14px; cursor: pointer; border-bottom: 3px solid transparent; font-weight: 500; }
.pestanas button[aria-selected="true"] { border-bottom-color: var(--naranja); font-weight: 700; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 10; }
.cargando { color: var(--suave); padding: 24px 0; }

/* Panel en el móvil: menú compacto arriba, secciones en una fila que se desliza */
@media (max-width: 899px) {
  .menu { padding: 12px 14px; gap: 10px; }
  .menu .empresa { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 8px 12px; }
  .menu nav { flex-direction: row; overflow-x: auto; gap: 4px; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .menu nav a { white-space: nowrap; min-height: 40px; }
  .menu > div:last-child { flex-direction: row !important; justify-content: space-between; align-items: center; margin-top: 0 !important; }
}
