/* =====================================================
   Brincolín Control — estilos "caramelo"
   Paleta: amarillo #FFC93C · naranja #FF8A3D · rosa #FF5D8F
   lima #4ECB71 · cielo #38BDF8 · uva #A855F7 · nube #FFFDF7
   ===================================================== */

:root {
    --amarillo: #FFC93C;
    --naranja: #FF8A3D;
    --rosa: #FF5D8F;
    --lima: #4ECB71;
    --cielo: #38BDF8;
    --uva: #A855F7;
    --nube: #FFFDF7;
    --tinta: #334155;
    --linea: #F1E9DC;
}

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

body {
    font-family: 'Nunito', system-ui, sans-serif;
    background: var(--nube);
    color: var(--tinta);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .fred { font-family: 'Fredoka', 'Nunito', sans-serif; }

/* ---------- Barra ---------- */
.barra {
    position: sticky; top: 0; z-index: 40;
    background: #fff; border-bottom: 4px solid var(--amarillo);
    box-shadow: 0 6px 24px rgba(255, 201, 60, .25);
}
.barra-int {
    max-width: 1180px; margin: 0 auto; padding: 12px 22px;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.marca {
    font-family: 'Fredoka'; font-weight: 700; font-size: 1.3rem;
    color: var(--tinta); text-decoration: none;
}
.menu { display: flex; gap: 6px; flex-wrap: wrap; }
.menu a {
    font-weight: 800; font-size: .85rem; text-transform: uppercase;
    letter-spacing: .04em; color: #8A6A45; text-decoration: none;
    padding: 8px 14px; border-radius: 999px; transition: .15s;
}
.menu a:hover { background: #FFF3D6; color: #B45309; }
.sesion {
    margin-left: auto; display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: .85rem; flex-wrap: wrap;
}
.rol-badge {
    background: linear-gradient(135deg, #EAF9F0, #DFF6FF);
    border: 2px dashed var(--lima); border-radius: 999px;
    padding: 5px 14px; color: #237A45; font-weight: 800;
}
.reloj { font-family: 'Fredoka'; font-weight: 600; color: var(--uva); font-size: 1.05rem; }
.btn-salir {
    border: none; background: #FFE9EF; color: #C2185B; font-weight: 800;
    border-radius: 999px; padding: 8px 16px; cursor: pointer; font: inherit;
    font-size: .82rem;
}
.btn-salir:hover { background: #FFD3DE; }

/* ---------- Contenedor ---------- */
.contenedor { max-width: 1180px; width: 100%; margin: 0 auto; padding: 24px 22px; flex: 1; }
.pie {
    text-align: center; padding: 22px; font-weight: 700; font-size: .8rem;
    color: #B48A5A;
}

/* ---------- Tarjetas KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi { border-radius: 20px; padding: 18px 20px; color: #fff; box-shadow: 0 10px 22px rgba(0,0,0,.08); }
.kpi b { font-family: 'Fredoka'; font-size: 2rem; display: block; line-height: 1.05; }
.kpi span { font-weight: 700; font-size: .86rem; opacity: .95; }
.k1 { background: linear-gradient(135deg, var(--cielo), #1E9BD7); }
.k2 { background: linear-gradient(135deg, var(--uva), #8B3FE8); }
.k3 { background: linear-gradient(135deg, var(--lima), #2FA858); }
.k4 { background: linear-gradient(135deg, var(--naranja), #F26513); }

/* ---------- Banner ---------- */
.banner {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(90deg, #FFF3D6, #FFE6EE);
    border: 2px solid var(--amarillo); border-radius: 18px;
    padding: 13px 20px; margin-bottom: 18px; font-weight: 700;
    box-shadow: 0 8px 20px rgba(255, 201, 60, .18);
}
.banner b { color: #B45309; }
.banner-info { background: linear-gradient(90deg, #EAF6FF, #F0EAFF); border-color: var(--cielo); }
.banner-info b { color: #0C77A8; }

/* ---------- Captura ---------- */
.captura {
    background: #fff; border: 3px dashed var(--cielo); border-radius: 22px;
    padding: 20px 22px; margin-bottom: 24px;
    display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
}
.captura .campo { flex: 1; min-width: 200px; }
.captura label, .campo label {
    display: block; font-weight: 800; font-size: .8rem; color: #0C77A8;
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em;
}
.captura input, .campo input, .campo select, .campo textarea {
    width: 100%; padding: 14px 16px; border: 2px solid #DDEBF5;
    border-radius: 14px; font: inherit; font-weight: 700; font-size: 1.05rem;
    background: #F8FCFF; color: var(--tinta);
}
.captura input:focus, .campo input:focus, .campo select:focus, .campo textarea:focus {
    outline: none; border-color: var(--cielo);
}
.nota { width: 100%; font-size: .8rem; color: #94A3B8; font-weight: 700; }

/* ---------- Botones ---------- */
.btn-iniciar {
    border: none; background: linear-gradient(135deg, var(--naranja), #FF6B00);
    color: #fff; font-family: 'Fredoka'; font-weight: 700; font-size: 1.2rem;
    border-radius: 999px; padding: 16px 34px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 138, 61, .45); transition: .15s;
}
.btn-iniciar:hover { transform: translateY(-2px) scale(1.02); }
.btn-iniciar:disabled { opacity: .6; cursor: wait; }

.btn-wa {
    border: none; border-radius: 999px; padding: 10px 16px; font-weight: 800;
    font-size: .84rem; cursor: pointer; font-family: 'Nunito';
    background: linear-gradient(135deg, #5AEB8A, #16C265); color: #fff;
    box-shadow: 0 5px 12px rgba(22, 194, 101, .3); transition: .15s;
}
.btn-wa:hover { transform: translateY(-1px); }
.btn-wa.ok { background: #D7F7E4; color: #237A45; box-shadow: none; }

.btn-exentar {
    border: none; border-radius: 999px; padding: 10px 16px; font-weight: 800;
    font-size: .84rem; cursor: pointer; font-family: 'Nunito';
    background: linear-gradient(135deg, #FFD86B, #F59E0B); color: #5C3D00;
}
.btn-terminar {
    border: none; border-radius: 999px; padding: 10px 16px; font-weight: 800;
    font-size: .84rem; cursor: pointer; font-family: 'Nunito';
    background: #EEF2F7; color: #64748B;
}
.btn-terminar:hover { background: #E2E8F0; }

.btn-guardar {
    border: none; border-radius: 999px; padding: 14px 30px; font-family: 'Fredoka';
    font-weight: 700; font-size: 1.05rem; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, var(--uva), #8B3FE8);
    box-shadow: 0 8px 18px rgba(168, 85, 247, .35);
}
.btn-mini {
    border: none; border-radius: 999px; padding: 7px 14px; font-weight: 800;
    font-size: .78rem; cursor: pointer; font-family: 'Nunito';
    background: #EEF2F7; color: #475569;
}
.btn-mini:hover { background: #E2E8F0; }
.btn-mini.rojo { background: #FFE3E3; color: #C2185B; }

/* ---------- Tabla ---------- */
.tabla-box {
    background: #fff; border-radius: 24px; padding: 8px 8px 16px;
    box-shadow: 0 14px 34px rgba(255, 201, 60, .16); border: 2px solid var(--linea);
    overflow-x: auto;
}
.titulo-caja {
    padding: 16px 16px 10px; font-size: 1.3rem; font-family: 'Fredoka';
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.chip-count {
    font-family: 'Nunito'; font-weight: 800; font-size: .75rem;
    background: #F1F5F9; color: #64748B; border-radius: 999px; padding: 5px 12px;
}
table { width: 100%; border-collapse: separate; border-spacing: 0 10px; padding: 0 8px; }
th {
    font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
    color: #94A3B8; text-align: left; padding: 4px 12px;
}
td {
    background: #FDFDFB; padding: 13px 12px; vertical-align: middle;
    border-top: 2px solid var(--linea); border-bottom: 2px solid var(--linea);
}
td.prim { border-left: 8px solid; border-radius: 16px 0 0 16px; border-top-color: transparent; border-bottom-color: transparent; }
td.ult { border-radius: 0 16px 16px 0; border-top-color: transparent; border-bottom-color: transparent; }
.folio { font-family: 'Fredoka'; font-weight: 700; color: #64748B; }
.nino { font-family: 'Fredoka'; font-weight: 700; font-size: 1.25rem; }
.alertico {
    display: inline-block; background: var(--rosa); color: #fff; font-size: .6rem;
    border-radius: 999px; padding: 3px 9px; vertical-align: middle; margin-left: 8px;
    font-family: 'Nunito'; font-weight: 800; cursor: pointer;
}
.resp { font-weight: 800; font-size: .95rem; }
.resp small { display: block; font-weight: 700; color: var(--cielo); }
.hora { font-family: 'Fredoka'; font-weight: 600; font-size: 1rem; }
.vacio { text-align: center; padding: 34px; font-weight: 800; color: #94A3B8; }

.restante {
    text-align: center; border-radius: 999px; padding: 9px 6px;
    font-family: 'Fredoka'; font-weight: 700; color: #fff; font-size: .98rem;
    min-width: 116px; display: inline-block;
}
.r-verde { background: linear-gradient(135deg, var(--lima), #2FA858); }
.r-ambar { background: linear-gradient(135deg, var(--amarillo), #F59E0B); }
.r-rojo { background: linear-gradient(135deg, #FF5A5A, #E02424); animation: latido 1.2s infinite; }
.r-terminado { background: #CBD5E1; }
@keyframes latido { 50% { transform: scale(1.06); } }

.extras { display: block; font-size: .72rem; font-weight: 800; color: #C2185B; margin-top: 4px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.fondo {
    position: fixed; inset: 0; background: rgba(51, 65, 85, .55);
    display: none; align-items: center; justify-content: center; z-index: 80; padding: 16px;
}
.fondo.on { display: flex; }
.modal {
    background: #fff; border-radius: 26px; max-width: 560px; width: 100%;
    overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .3); animation: pop .25s;
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal-top { background: linear-gradient(135deg, var(--rosa), #D63C7E); color: #fff; padding: 20px 26px; }
.modal-top h3 { font-size: 1.3rem; }
.modal-top p { font-weight: 700; opacity: .95; font-size: .92rem; }
.modal-body { padding: 18px 26px; }
.modal-acciones { display: flex; gap: 10px; padding: 4px 26px 24px; flex-wrap: wrap; }
.btn-permitir {
    border: none; border-radius: 999px; padding: 13px 20px;
    background: linear-gradient(135deg, var(--amarillo), #F59E0B);
    color: #5C3D00; font-weight: 800; cursor: pointer; font: inherit;
}
.btn-rechazar {
    border: none; border-radius: 999px; padding: 13px 20px;
    background: linear-gradient(135deg, #FF8A8A, #E02424);
    color: #fff; font-weight: 800; cursor: pointer; font: inherit;
}
.btn-cancelar {
    border: none; border-radius: 999px; padding: 13px 20px; background: #EEF2F7;
    color: #64748B; font-weight: 800; cursor: pointer; font: inherit;
}
.modal textarea {
    width: 100%; padding: 12px 14px; border: 2px solid #F1D5DF; border-radius: 12px;
    font: inherit; font-weight: 700; margin-top: 8px; resize: vertical;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    background: var(--uva); color: #fff; font-weight: 800; border-radius: 999px;
    padding: 12px 24px; opacity: 0; pointer-events: none; transition: .3s; z-index: 90;
    max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; }

/* ---------- Login ---------- */
.login-cuerpo {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(600px 320px at 85% -10%, rgba(255, 201, 60, .35), transparent 60%),
        radial-gradient(500px 300px at -10% 110%, rgba(56, 189, 248, .25), transparent 60%),
        var(--nube);
    padding: 20px;
}
.login-caja {
    background: #fff; border-radius: 28px; padding: 38px 34px; width: 100%; max-width: 420px;
    box-shadow: 0 26px 60px rgba(255, 201, 60, .3); border: 2px solid var(--linea);
    text-align: center;
}
.login-caja .globo { font-size: 3rem; }
.login-caja h1 { font-size: 1.6rem; margin: 8px 0 2px; }
.login-caja .sub { font-weight: 700; color: #94A3B8; font-size: .88rem; margin-bottom: 22px; }
.login-caja input {
    width: 100%; padding: 14px 16px; border: 2px solid #DDEBF5; border-radius: 14px;
    font: inherit; font-weight: 700; font-size: 1.05rem; background: #F8FCFF;
    margin-bottom: 12px; text-align: center;
}
.login-caja input:focus { outline: none; border-color: var(--cielo); }
.login-caja .btn-iniciar { width: 100%; }
.error-login {
    background: #FFE3E3; color: #C2185B; border-radius: 12px; padding: 10px;
    font-weight: 800; font-size: .88rem; margin-bottom: 14px;
}

/* ---------- Corte ---------- */
.totales { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.total-c { border-radius: 18px; padding: 16px 18px; background: #fff; border: 2px solid var(--linea); text-align: center; }
.total-c b { font-family: 'Fredoka'; font-size: 1.7rem; display: block; }
.total-c span { font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: #94A3B8; }
.total-c.verde b { color: #2FA858; }
.total-c.uva b { color: var(--uva); }
.total-c.ambar b { color: #F59E0B; }
.total-c.rosa b { color: var(--rosa); }
.total-c.cielo b { color: var(--cielo); }
.filtros { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filtros input {
    padding: 11px 14px; border: 2px solid #DDEBF5; border-radius: 12px; font: inherit;
    font-weight: 700; background: #fff;
}
.motivo-box { background: #FFF7FA; border: 2px dashed #FFC4DA; border-radius: 16px; padding: 14px 18px; margin-top: 16px; }
.motivo-box h3 { font-size: 1rem; color: #C2185B; margin-bottom: 6px; }
.motivo-box p { font-weight: 700; font-size: .9rem; }

/* ---------- Configuración ---------- */
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.panel-blanco { background: #fff; border: 2px solid var(--linea); border-radius: 22px; padding: 24px; }
.panel-blanco h2 { font-size: 1.2rem; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.campo { margin-bottom: 14px; }
.campo textarea { font-size: .95rem; font-weight: 600; }
.fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tabla-mini { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla-mini th { padding: 8px; text-align: left; font-size: .7rem; }
.tabla-mini td { padding: 9px 8px; border-bottom: 1px solid var(--linea); background: none; }
.aviso-demo {
    background: linear-gradient(90deg, #F0EAFF, #FFE6F2); border: 2px dashed var(--uva);
    border-radius: 16px; padding: 14px 18px; font-weight: 700; margin-bottom: 20px;
}

/* ---------- Seguimiento público ---------- */
.seguimiento {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 24px; text-align: center;
    background:
        radial-gradient(700px 360px at 80% -10%, rgba(78, 203, 113, .3), transparent 60%),
        radial-gradient(600px 320px at -10% 110%, rgba(56, 189, 248, .22), transparent 60%),
        var(--nube);
}
.seguimiento .tarjeta {
    background: #fff; border-radius: 30px; padding: 40px 34px; max-width: 480px; width: 100%;
    box-shadow: 0 26px 60px rgba(78, 203, 113, .25); border: 2px solid var(--linea);
}
.seguimiento h1 { font-size: 1.7rem; margin: 6px 0; }
.grande { font-family: 'Fredoka'; font-weight: 700; font-size: 3.4rem; line-height: 1.05; margin: 14px 0 4px; }
.grande.verde { color: #2FA858; }
.grande.ambar { color: #F59E0B; }
.grande.rojo { color: #E02424; }
.estado-texto { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #94A3B8; }
.barra-tiempo {
    height: 18px; background: #F1F5F9; border-radius: 999px; overflow: hidden; margin: 18px 0;
    border: 2px solid var(--linea);
}
.barra-tiempo .relleno { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lima), var(--amarillo)); transition: width 1s linear; }
.horarios-seg { font-weight: 700; color: #94A3B8; font-size: .88rem; margin-top: 14px; }
.deslinde-seg {
    margin-top: 18px; font-size: .74rem; color: #94A3B8; font-weight: 600;
    border-top: 1px dashed var(--linea); padding-top: 14px; text-align: left;
}

/* ---------- Error ---------- */
.error-caja { text-align: center; padding: 70px 20px; }
.error-caja .emoji { font-size: 4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .totales { grid-template-columns: repeat(2, 1fr); }
    .config-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .kpis, .totales { grid-template-columns: 1fr; }
    .captura { flex-direction: column; align-items: stretch; }
    .sesion { margin-left: 0; }
}
