/* =============================================================================
   JAMM — Panel de Inicio (monitor del local)
   -----------------------------------------------------------------------------
   Página read-only tipo dashboard. Superficies planas, tokens, sin glow.
   Clases con prefijo .jic-* (Jamm InICio). Datos reales donde existen;
   los bloques de ejemplo llevan la etiqueta .jic-mock.
   ============================================================================= */

/* El tope estaba en 1460px y en un monitor ancho sobraba aire a los dos lados (margin:auto lo
   repartía). Al subirlo, la columna central se estira y el aside se corre a la derecha; el gap
   de .jic-grid mantiene el aire ENTRE las dos secciones, que es el que sí hace falta. Sigue
   habiendo tope para no dejar líneas larguísimas en pantallas gigantes. */
.jic-wrap {
    max-width: 1760px;
    margin: 0 auto;
    padding: 14px 24px 48px;
    font-family: var(--font);
    color: var(--ink-900);
}

.jic-grid {
    display: grid;
    grid-template-columns: 1fr 328px;
    gap: 40px;
    align-items: start;
}

.jic-main { display: flex; flex-direction: column; gap: 22px; }
.jic-aside { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 980px) {
    .jic-grid { grid-template-columns: 1fr; }
    .jic-aside { order: 2; }
}

/* ── Card base ── */
.jic-card {
    background: var(--surface-nav);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: none;
}

.jic-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.jic-section-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink-500);
}

.jic-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--acc-info);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
}
.jic-link:hover { text-decoration: underline; }

.jic-mock {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink-500);
    background: var(--surface-chip);
    border-radius: 999px;
    padding: 1px 8px;
}

/* Contador de dispositivos conectados. Ocupa el lugar donde antes iba la etiqueta
   "ejemplo" de la tarjeta, con el mismo peso visual: ahora el dato es real. */
.jic-act-count {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink-500);
    background: var(--surface-chip);
    border-radius: 999px;
    padding: 1px 8px;
}
.jic-act-count:empty { display: none; }

.jic-empty {
    color: var(--ink-500);
    font-size: 0.85rem;
    padding: 8px 2px;
}

/* ── Visor de caja ── */
.jic-caja {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-panel);
}
.jic-caja.closed { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.jic-caja-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}
.jic-caja-go {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 8px 5px 12px;
    border-radius: 999px;
    background: var(--surface-chip);
    border: 1px solid var(--line);
    color: var(--ink-700);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.jic-caja-go:hover { background: var(--surface-chip-hover); border-color: var(--acc-info); color: var(--acc-info); }
.jic-caja-go .jico { width: 14px; height: 14px; }
.jic-caja-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.jic-caja.open .jic-caja-dot { background: var(--acc-ok); }
.jic-caja.closed .jic-caja-dot { background: var(--danger); }
.jic-caja.open .jic-caja-badge { color: var(--acc-ok); }
.jic-caja.closed .jic-caja-badge { color: var(--danger); }
.jic-caja-sub { color: var(--ink-700); font-size: 0.85rem; }

/* ── Acciones rápidas ── */
.jic-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.jic-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 10px;
    background: var(--surface-chip);
    border: 1px solid var(--line);
    color: var(--ink-900);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.jic-action:hover { background: var(--surface-chip-hover); }
.jic-action.primary {
    background: var(--btn-success);
    border-color: var(--btn-success);
    color: #fff;
}
.jic-action.primary:hover { background: var(--btn-success-hover); }
.jic-action .jico { width: 18px; height: 18px; }

/* Editor de accesos rápidos */
.jic-actions-edit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.jic-chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--surface-chip);
    border: 1px solid var(--line);
    color: var(--ink-700);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.jic-chip-toggle.on { border-color: var(--acc-info); color: var(--ink-900); }
.jic-chip-toggle.fixed { opacity: 0.6; cursor: default; }
.jic-chip-toggle .jico { width: 15px; height: 15px; }

/* ── Card mini (ARCA en el aside) ── */
.jic-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}
.jic-mini-ic {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-chip);
    flex-shrink: 0;
}
.jic-mini-ic .jico { width: 20px; height: 20px; color: var(--acc-info); }
.jic-mini-lab { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; color: var(--ink-500); }
.jic-mini-val { font-size: 1.05rem; font-weight: 800; color: var(--ink-900); }
.jic-mini-val .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 4px; background: var(--ink-500); }
.jic-mini-val .dot.ok { background: var(--acc-ok); }
.jic-mini-val .dot.off { background: var(--danger); }

/* Tarjeta ARCA: botón "Verificar ahora" + última verificación */
.jic-arca-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.jic-arca-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--surface-chip);
    border: 1px solid var(--line);
    color: var(--ink-900);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.jic-arca-btn:hover { background: var(--surface-chip-hover); }
.jic-arca-btn:disabled { opacity: 0.6; cursor: default; }
.jic-arca-btn .jico { width: 14px; height: 14px; }
.jic-arca-ts { font-size: 0.7rem; color: var(--ink-500); }

/* ── Operaciones del día ── */
.jic-op-resumen-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.jic-op-total { font-size: 2rem; font-weight: 800; color: var(--ink-900); margin: 4px 0 2px; }
.jic-op-sub { font-size: 0.82rem; color: var(--ink-500); }
.jic-op-kpis { display: flex; gap: 12px; }
.jic-op-kpi {
    background: var(--surface-panel);
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 110px;
}
.jic-op-kpi-lab { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; color: var(--ink-500); }
.jic-op-kpi-val { font-size: 1.2rem; font-weight: 800; color: var(--ink-900); margin-top: 2px; }

.jic-op-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
@media (max-width: 720px) { .jic-op-breakdown { grid-template-columns: 1fr; } }
.jic-op-col-sep { padding-left: 22px; border-left: 1px solid var(--line); }
@media (max-width: 720px) { .jic-op-col-sep { padding-left: 0; border-left: none; } }
.jic-op-bars { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.jic-op-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.jic-op-bar-name { font-size: 0.86rem; font-weight: 600; color: var(--ink-900); }
.jic-op-bar-cant { font-size: 0.72rem; font-weight: 600; color: var(--ink-500); }
.jic-op-bar-amt { font-size: 0.86rem; font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.jic-op-bar { height: 6px; border-radius: 999px; background: var(--surface-chip); overflow: hidden; }
.jic-op-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--acc-info); }

/* Tarjetas de estado */
.jic-op-estados { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.jic-est {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface-nav);
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 3px solid var(--line);
}
.jic-est.pend { border-left-color: var(--acc-warn); }
.jic-est.proc { border-left-color: var(--acc-info); }
.jic-est.mesa { border-left-color: var(--acc-info); }
.jic-est.comp { border-left-color: var(--acc-ok); }
.jic-est.cont { border-left-color: color-mix(in srgb, var(--acc-warn) 55%, var(--danger)); }
.jic-est.inci { border-left-color: var(--danger); }
.jic-est-lab { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; color: var(--ink-500); }
.jic-est-val { font-size: 1.6rem; font-weight: 800; color: var(--ink-900); margin-top: 2px; }
.jic-est-sub { font-size: 0.7rem; font-weight: 600; color: var(--ink-500); margin-top: 2px; }
.jic-est-ic { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-chip); flex-shrink: 0; }
.jic-est.pend .jic-est-ic .jico { color: var(--acc-warn); }
.jic-est.proc .jic-est-ic .jico { color: var(--acc-info); }
.jic-est.mesa .jic-est-ic .jico { color: var(--acc-info); }
.jic-est.comp .jic-est-ic .jico { color: var(--acc-ok); }
.jic-est.cont .jic-est-ic .jico { color: color-mix(in srgb, var(--acc-warn) 55%, var(--danger)); }
.jic-est.inci .jic-est-ic .jico { color: var(--danger); }
.jic-est-ic .jico { width: 17px; height: 17px; }

/* ── Stock crítico ── */
.jic-stock-group {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-500);
    padding: 8px 0 4px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
}
.jic-stock-group:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.jic-stock-row {
    display: grid;
    grid-template-columns: 120px 1fr 78px;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}
.jic-stock-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jic-bar { height: 8px; border-radius: 999px; background: var(--surface-chip); overflow: hidden; }
.jic-bar > i { display: block; height: 100%; border-radius: 999px; }
.jic-bar.crit > i { background: var(--danger); }
.jic-bar.low  > i { background: var(--acc-warn); }
.jic-stock-tag { font-size: 0.72rem; font-weight: 800; text-align: right; }
.jic-stock-tag.crit { color: var(--danger); }
.jic-stock-tag.low  { color: var(--acc-warn); }

/* ── Facturas por vencer (alargado) ── */
.jic-count-badge {
    display: inline-block;
    margin-left: 6px;
    min-width: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--acc-warn) 22%, transparent);
    color: var(--acc-warn);
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    line-height: 18px;
}
.jic-venc-list { display: flex; flex-direction: column; }
.jic-venc-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.jic-venc-row:first-child { border-top: none; }
.jic-venc-info { min-width: 0; display: flex; flex-direction: column; }
.jic-venc-name { font-size: 0.88rem; font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jic-venc-sub { font-size: 0.76rem; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jic-venc-amt { font-size: 0.9rem; font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.jic-venc-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    min-width: 108px;
    text-align: center;
}
.jic-venc-tag.crit { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.jic-venc-tag.warn { color: var(--acc-warn); background: color-mix(in srgb, var(--acc-warn) 15%, transparent); }
.jic-venc-tag.ok { color: var(--ink-700); background: var(--surface-chip); }

/* ── Tickets en curso ── */
.jic-tickets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .jic-tickets { grid-template-columns: 1fr; } }
.jic-ticket {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
}
.jic-ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.jic-ticket-state { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em; }
.jic-ticket-state.proc { color: var(--acc-warn); }
.jic-ticket-state.open { color: var(--acc-ok); }
/* Resuelto: apagado a propósito — ya no requiere atención del cliente. */
.jic-ticket-state.done { color: var(--ink-500); }
.jic-ticket-time { font-size: 0.7rem; color: var(--ink-500); }
.jic-ticket-txt { font-size: 0.84rem; color: var(--ink-700); line-height: 1.35; }
/* Última respuesta publicada por soporte, debajo del título del ticket.
   Tokens: --ink-600 NO existe en el tema oscuro (solo en el claro), así que
   acá van 700/900/500, que sí están definidos en los dos temas. */
.jic-ticket-com {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--ink-700);
    line-height: 1.4;
}
.jic-ticket-com-autor { font-weight: 700; color: var(--ink-900); }
.jic-ticket-com-mas { color: var(--ink-500); }

/* ── Log de cambios ── */
.jic-log-item {
    display: flex;
    gap: 11px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}
.jic-log-item:first-child { border-top: none; }
.jic-log-ic {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: var(--surface-chip);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.jic-log-ic .jico { width: 14px; height: 14px; color: var(--acc-info); }
.jic-log-body { min-width: 0; flex: 1; }
.jic-log-act { font-size: 0.84rem; font-weight: 700; color: var(--ink-900); }
.jic-log-det { font-size: 0.78rem; color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jic-log-meta { font-size: 0.7rem; color: var(--ink-500); white-space: nowrap; }

/* ── Aside: actividad ── */
.jic-act-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}
.jic-act-row:first-child { border-top: none; }
.jic-act-ic {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--surface-chip);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.jic-act-ic .jico { width: 15px; height: 15px; color: var(--ink-700); }
.jic-act-body { flex: 1; min-width: 0; }
.jic-act-name { font-size: 0.84rem; font-weight: 700; color: var(--ink-900); }
.jic-act-dev { font-size: 0.72rem; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jic-act-state { font-size: 0.68rem; font-weight: 700; }
.jic-act-state.on { color: var(--acc-ok); }
.jic-act-state.off { color: var(--ink-500); }

.jic-btn-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--btn-success);
    border: 1px solid var(--btn-success);
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.jic-btn-block:hover { background: var(--btn-success-hover); }
.jic-btn-block .jico { width: 17px; height: 17px; }
