@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --sime-bg: #f8fafc;
    --sime-card-bg: #ffffff;
    --sime-border: #e2e8f0;
    --sime-text: #0f172a;
    --sime-text-muted: #64748b;
    --sime-primary: #0f172a;
    --sime-accent: #0a4fb5;
    /* Marca Distribuidora SIME (tomados del logo): azul marino, azul y oro. */
    --sime-marca-navy: #01163c;
    --sime-marca-azul: #013e94;
    --sime-marca-oro: #e0a117;
    --sime-emerald: #10b981;
    --sime-amber: #f59e0b;
    --sime-rose: #ef4444;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--sime-bg);
    color: var(--sime-text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Tipografía auxiliar */
.fs-7 {
    font-size: 0.8125rem !important;
}

.tracking-wider {
    letter-spacing: 0.06em !important;
}

/* Tarjetas SIME */
.sime-card {
    background-color: var(--sime-card-bg);
    border: 1px solid var(--sime-border) !important;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
}

.sime-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    background-color: #f1f5f9;
    color: #0f172a;
}

/* Sidebar y navegación */
.sidebar {
    background-color: #0f172a;
    color: #f8fafc;
}

.sidebar .nav-link {
    color: #94a3b8;
    border-radius: 8px;
    margin: 4px 12px;
    padding: 10px 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link.active {
    color: #ffffff;
    background-color: #1e293b;
    font-weight: 600;
    box-shadow: inset 3px 0 0 0 #3b82f6;
}

/* Header superior */
.top-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--sime-border);
    height: 64px;
}

/* Tablas minimalistas */
.table-sime {
    margin-bottom: 0;
}

.table-sime th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sime-text-muted);
    border-bottom: 1px solid var(--sime-border);
    padding: 12px 16px;
    background-color: #f8fafc;
}

.table-sime td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.table-sime tr:last-child td {
    border-bottom: none;
}

.table-sime tbody tr:hover {
    background-color: #f8fafc;
}

/* Botones minimalistas */
.btn-sime-primary {
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
    transition: background-color 0.15s ease;
}

.btn-sime-primary:hover {
    background-color: #1e293b;
    color: #ffffff;
}

.btn-sime-outline {
    background-color: transparent;
    color: #0f172a;
    border: 1px solid var(--sime-border);
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 14px;
}

.btn-sime-outline:hover {
    background-color: #f1f5f9;
}

/* Indicador de estado de Pod */
.pod-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.pod-status-dot.online {
    background-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.pod-status-dot.offline {
    background-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Mensajes de error */
#blazor-error-ui {
    background: #ef4444;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Semáforo FEFO de lotes */
.semaforo {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.semaforo-rojo { background-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.semaforo-naranja { background-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2); }
.semaforo-amarillo { background-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.semaforo-verde { background-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

/* Sobrante de arqueo (ámbar legible sobre blanco) */
.text-sobrante { color: #b45309 !important; }

/* ============================================================
   SaaS CONTROL PLANE — SISTEMA DE DISEÑO EMPRESARIAL
   Inspiración: Stripe Dashboard, Datadog & Linear
   ============================================================ */

/* Badges de Roles RBAC */
.badge-role-superadmin {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.25);
}

.badge-role-soporte {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.badge-role-finanzas {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

/* Badges de Estado de Inquilinos */
.badge-estado-activo {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-estado-activo::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
}

.badge-estado-periodo_gracia {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-estado-periodo_gracia::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #f59e0b;
}

.badge-estado-suspendido {
    background-color: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-estado-suspendido::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #f43f5e;
}

.badge-estado-baja {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-estado-baja::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #94a3b8;
}

/* Tarjetas KPI Modernas */
.kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.kpi-card:hover::after {
    opacity: 1;
}

.kpi-card.kpi-mrr::after { background: linear-gradient(90deg, #3b82f6, #6366f1); opacity: 1; }
.kpi-card.kpi-arr::after { background: linear-gradient(90deg, #10b981, #059669); opacity: 1; }
.kpi-card.kpi-churn::after { background: linear-gradient(90deg, #f59e0b, #ef4444); opacity: 1; }
.kpi-card.kpi-arpu::after { background: linear-gradient(90deg, #8b5cf6, #ec4899); opacity: 1; }

.kpi-icon-pill {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Semáforo de Capacidad Celular de Pods */
.pod-progress-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.pod-fill-verde {
    background: linear-gradient(90deg, #10b981, #059669);
}

.pod-fill-amarillo {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.pod-fill-rojo {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Toast Container Flotante */
.saas-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 440px;
    pointer-events: none;
}

.saas-toast {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #3b82f6;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.saas-toast.toast-exito {
    border-left-color: #10b981;
}

.saas-toast.toast-error {
    border-left-color: #ef4444;
}

.saas-toast.toast-advertencia {
    border-left-color: #f59e0b;
}

.saas-toast.toast-info {
    border-left-color: #3b82f6;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modales Personalizados */
.saas-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.18s ease-out;
}

.saas-modal-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Visor JSON para Auditoría */
.json-viewer-box {
    background-color: #0f172a;
    color: #f8fafc;
    border-radius: 10px;
    padding: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow-x: auto;
    border: 1px solid #1e293b;
}

/* Switch toggles modernos */
.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Tooltip elegante */
.has-tooltip {
    position: relative;
    cursor: help;
}

.has-tooltip .tooltip-text {
    visibility: hidden;
    width: 240px;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.75rem;
    font-weight: 400;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.has-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Skeleton Loading */
.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Diseñador de la cuadrícula de atajos de la caja (tarjetas de 80x80 como en la terminal) */
.cuadricula-ccg {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.tarjeta-ccg {
    min-height: 96px;
    border-radius: 10px;
    padding: 8px;
    color: #fff;
    font-size: 0.8125rem;
    cursor: grab;
    user-select: none;
}

.tarjeta-ccg.arrastrando { opacity: 0.5; }

/* ═══════════════════════════ Terminal POS (/pos y /tienda) · estilo Square + Odoo ═══════════════════════════ */
:root {
    --pos-bg: #f8fafc;
    --pos-surface: #ffffff;
    --pos-line: #e2e8f0;
    --pos-text: #0f172a;
    --pos-muted: #64748b;
    --pos-primary: #0a4fb5;
    --pos-primary-hover: #013e94;
    --pos-teal: #0d9488;
    --pos-teal-hover: #0f766e;
    --pos-topbar-h: 60px;
}

.pos-num { font-variant-numeric: tabular-nums; }
.min-w-0 { min-width: 0; }

.pos-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--pos-bg); }
.pos-topbar {
    height: var(--pos-topbar-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0 1rem; background: var(--pos-surface); border-bottom: 1px solid var(--pos-line); position: sticky; top: 0; z-index: 30;
}
.pos-brand { display: flex; align-items: center; gap: .6rem; color: var(--pos-text); }
.pos-brand-logo { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.sime-logo-mark { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.sime-logo-full { max-width: 220px; height: auto; }
.sime-powered { font-size: .72rem; color: var(--sime-text-muted); }
.sime-powered strong { color: var(--sime-marca-navy); }
.pos-brand-name { display: block; font-weight: 700; font-size: .95rem; line-height: 1.1; }
.pos-brand-store { display: block; font-size: .72rem; color: var(--pos-muted); }
/* El menú se desplaza en lugar de encimarse con el reloj y el usuario (Bootstrap 5.1 no trae overflow-x-auto). */
.pos-nav { gap: .25rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pos-nav-link { white-space: nowrap; }
.pos-nav-link {
    padding: .4rem .75rem; border-radius: 999px; color: var(--pos-muted); font-size: .85rem; font-weight: 500; text-decoration: none;
}
.pos-nav-link:hover { background: #f1f5f9; color: var(--pos-text); }
.pos-nav-link.active { background: #eff6ff; color: var(--pos-primary); font-weight: 600; }
.pos-pill { padding: .3rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pos-pill-ok { background: #dcfce7; color: #166534; }
.pos-pill-warn { background: #fef3c7; color: #92400e; }
.pos-pill-neutral { background: #f1f5f9; color: var(--pos-muted); }
.pos-conn { align-items: center; gap: .4rem; font-size: .8rem; color: var(--pos-muted); }
.pos-conn-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pos-conn-dot.ok { background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.pos-conn-dot.off { background: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; animation: pos-parpadeo 1s infinite; }
@keyframes pos-parpadeo { 50% { opacity: .35; } }
.pos-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--pos-text); font-size: .9rem; }
.pos-user {
    display: flex; align-items: center; gap: .5rem; background: none; border: 1px solid transparent; border-radius: 12px;
    padding: .25rem .5rem; font-size: .82rem; color: var(--pos-text);
}
.pos-user:hover { background: #f1f5f9; }
.pos-user-rol { font-size: .7rem; color: var(--pos-muted); }
.pos-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.pos-menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.pos-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 41; width: 240px; background: var(--pos-surface);
    border: 1px solid var(--pos-line); border-radius: 12px; padding: .4rem;
}
.pos-menu-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pos-muted); padding: .4rem .6rem .2rem; }
.pos-menu-item {
    display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: .5rem .6rem;
    font-size: .88rem; color: var(--pos-text); text-decoration: none;
}
.pos-menu-item:hover:not(:disabled) { background: #f1f5f9; }
.pos-menu-item:disabled { color: #cbd5e1; }
.pos-menu-sep { height: 1px; background: var(--pos-line); margin: .3rem 0; }
.pos-main { flex: 1; min-height: 0; }
.pos-main-admin { padding: 1.5rem; }

/* Terminal: catálogo (izquierda) + ticket (derecha) */
.pos-terminal { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 36vw, 460px); height: calc(100vh - var(--pos-topbar-h)); }
.pos-catalogo { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 1rem 1rem 0; }
.pos-banner { border-radius: 12px; padding: .6rem .9rem; font-size: .85rem; margin-bottom: .75rem; }
.pos-banner-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.pos-banner-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.pos-toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: .75rem; }
.pos-search {
    flex: 1; display: flex; align-items: center; gap: .5rem; background: var(--pos-surface); border: 1px solid var(--pos-line);
    border-radius: 12px; padding: 0 .75rem; height: 48px;
}
.pos-search:focus-within { border-color: var(--pos-primary); box-shadow: 0 0 0 3px #dbeafe; }
.pos-search-icon { color: var(--pos-muted); font-size: 1.2rem; }
.pos-search-input { flex: 1; border: 0; outline: 0; font-size: 1rem; background: transparent; min-width: 0; }
.pos-btn-soft { background: var(--pos-surface); border: 1px solid var(--pos-line); border-radius: 12px; height: 48px; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.pos-btn-soft:hover { background: #f1f5f9; }
.pos-icon-btn { background: none; border: 0; border-radius: 8px; padding: .25rem .45rem; color: var(--pos-muted); line-height: 1; }
.pos-icon-btn:hover:not(:disabled) { background: #f1f5f9; color: var(--pos-text); }
.pos-icon-btn:disabled { opacity: .35; }

.pos-pills { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .6rem; margin-bottom: .25rem; scrollbar-width: thin; }
.pos-pill-cat {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--pos-line); background: var(--pos-surface);
    border-radius: 999px; padding: .45rem 1rem; font-size: .88rem; font-weight: 500; color: var(--pos-text); white-space: nowrap;
}
.pos-pill-cat:hover { background: #f1f5f9; }
.pos-pill-cat.activo { background: var(--pos-primary); border-color: var(--pos-primary); color: #fff; }
.pos-pill-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pos-pill-cat.activo .pos-pill-dot { background: #fff !important; }

.pos-grid-wrap { flex: 1; overflow-y: auto; padding-bottom: 1rem; min-height: 0; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.pos-card {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; text-align: left; min-height: 132px;
    background: var(--pos-surface); border: 1px solid var(--pos-line); border-top: 4px solid var(--pos-card-color, var(--pos-primary));
    border-radius: 14px; padding: .75rem; box-shadow: 0 1px 2px rgb(15 23 42 / .05); transition: transform .08s ease, box-shadow .12s ease;
}
.pos-card:hover { box-shadow: 0 4px 12px rgb(15 23 42 / .08); }
.pos-card:active { transform: scale(.95); }
.pos-card-avatar {
    width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
    color: #fff; background: var(--pos-card-color, var(--pos-primary)); font-size: .9rem;
}
.pos-card-name {
    font-weight: 600; font-size: .88rem; line-height: 1.2; color: var(--pos-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pos-card-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem; width: 100%; }
.pos-card-price { font-weight: 700; font-size: 1rem; color: var(--pos-text); }
.pos-card-flag { position: absolute; top: .6rem; right: .6rem; font-size: .65rem; font-weight: 700; color: #7c3aed; background: #ede9fe; border-radius: 6px; padding: .1rem .35rem; }
.pos-badge { font-size: .68rem; font-weight: 600; border-radius: 6px; padding: .12rem .4rem; white-space: nowrap; }
.pos-badge-ok { background: #ecfdf5; color: #047857; }
.pos-badge-warn { background: #fffbeb; color: #b45309; }
.pos-badge-danger { background: #fef2f2; color: #b91c1c; }
.pos-badge-neutral { background: #f1f5f9; color: var(--pos-muted); }
.pos-vacio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: var(--pos-muted); padding: 3rem 1rem; text-align: center; }

/* Ticket en vivo */
.pos-ticket { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: var(--pos-surface); border-left: 1px solid var(--pos-line); }
.pos-ticket-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem .5rem; flex-shrink: 0; position: relative; z-index: 10; }

/* Multicarrito (ADR-0017): pestañas de la venta actual y las que esperan. */
.pos-carritos { display: flex; gap: .4rem; padding: .6rem .75rem 0; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--pos-line); flex-shrink: 0; position: relative; z-index: 10; }
.pos-carrito {
    display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; padding: .35rem .7rem; font-size: .8rem; white-space: nowrap;
    background: #f1f5f9; color: var(--pos-muted); border: 1px solid var(--pos-line); border-bottom: 0; border-radius: 10px 10px 0 0;
}
.pos-carrito:hover:not(:disabled):not(.activo) { background: #e2e8f0; color: var(--pos-text); }
.pos-carrito.activo { background: var(--pos-surface); color: var(--pos-text); border-color: var(--pos-primary); box-shadow: inset 0 3px 0 var(--sime-marca-oro); }
.pos-carrito-total { font-size: .72rem; opacity: .85; }
.pos-carrito-nuevo {
    align-self: center; margin-left: auto; padding: .3rem .6rem; font-size: .78rem; font-weight: 600; white-space: nowrap;
    height: 34px; line-height: 1; display: inline-flex; align-items: center; flex-shrink: 0;
    background: none; border: 1px dashed var(--pos-primary); color: var(--pos-primary); border-radius: 8px;
}
.pos-carrito-nuevo:disabled { opacity: .4; }
.pos-kbd { font-size: .65rem; padding: .05rem .3rem; border-radius: 4px; background: #e2e8f0; color: var(--pos-muted); border: 1px solid #cbd5e1; }

/* Tablero BI del dueño (ADR-0017) */
.bi-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.bi-filtros { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.bi-filtro { border: 1px solid var(--sime-border); background: #fff; color: var(--sime-text-muted); border-radius: 999px; padding: .3rem .8rem; font-size: .82rem; font-weight: 500; }
.bi-filtro.activo { background: var(--sime-marca-navy); border-color: var(--sime-marca-navy); color: #fff; }
.bi-fecha { width: auto; }
.bi-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.bi-kpi { background: #fff; border: 1px solid var(--sime-border); border-radius: 12px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / .04); border-top: 3px solid var(--sime-marca-azul); }
.bi-kpi-dona { flex-direction: row; align-items: center; gap: .8rem; border-top-color: var(--sime-marca-oro); }
.bi-kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sime-text-muted); font-weight: 600; }
.bi-kpi-valor { font-size: 1.55rem; font-weight: 800; color: var(--sime-marca-navy); font-variant-numeric: tabular-nums; }
.bi-kpi-sub { font-size: .76rem; color: var(--sime-text-muted); }
.bi-positivo { color: #047857; }
.bi-dona { width: 64px; height: 64px; transform: rotate(0deg); flex-shrink: 0; }
.bi-dona-texto { font-size: .5rem; font-weight: 800; fill: var(--sime-marca-navy); }
.bi-barras { display: flex; align-items: flex-end; gap: 4px; height: 220px; padding-top: .5rem; border-bottom: 1px solid var(--sime-border); }
.bi-barra { flex: 1 1 0; min-width: 6px; max-width: 56px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; }
.bi-barra-pila { background: var(--sime-marca-azul); border-radius: 4px 4px 0 0; display: flex; flex-direction: column-reverse; overflow: hidden; min-height: 2px; }
.bi-barra-utilidad { background: var(--sime-marca-oro); }
.bi-barra-etiqueta { position: absolute; bottom: -1.3rem; left: 50%; transform: translateX(-50%); font-size: .62rem; color: var(--sime-text-muted); white-space: nowrap; }
.bi-barras + div { margin-top: 1.6rem !important; }
.bi-leyenda { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
.bi-renglon { display: flex; justify-content: space-between; align-items: baseline; padding: .3rem 0; border-bottom: 1px solid #f1f5f9; font-size: .88rem; }
.bi-ranking { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.bi-ranking li { font-size: .86rem; }
.bi-ranking-barra { height: 6px; background: #f1f5f9; border-radius: 999px; overflow: hidden; margin: .2rem 0; }
.bi-ranking-barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--sime-marca-azul), var(--sime-marca-oro)); border-radius: 999px; }
.bi-semaforo { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.bi-luz { border-radius: 10px; padding: .5rem; text-align: center; display: flex; flex-direction: column; font-size: .72rem; }
.bi-luz strong { font-size: 1.3rem; }
.bi-rojo { background: #fef2f2; color: #b91c1c; }
.bi-amarillo { background: #fffbeb; color: #b45309; }
.bi-verde { background: #ecfdf5; color: #047857; }

/* Verificador de precios (F3) */
.pos-verificador { border: 1px solid var(--pos-line); border-radius: 12px; padding: .9rem 1rem; background: #f8fafc; }
.pos-verificador-precio { font-size: 2rem; font-weight: 800; color: var(--sime-marca-navy); margin: .25rem 0; }
.pos-ticket-title { font-weight: 700; font-size: 1.05rem; }
.pos-ticket-sub { font-size: .72rem; color: var(--pos-muted); font-family: ui-monospace, monospace; }
.pos-cliente { position: relative; padding: 0 1rem .6rem; border-bottom: 1px solid var(--pos-line); }
.pos-cliente-btn {
    display: flex; align-items: center; gap: .4rem; width: 100%; background: #f8fafc; border: 1px solid var(--pos-line); border-radius: 10px;
    padding: .45rem .7rem; font-size: .85rem; text-align: left;
}
.pos-cliente-pop {
    position: absolute; left: 1rem; right: 1rem; top: calc(100% - .2rem); z-index: 20; background: var(--pos-surface);
    border: 1px solid var(--pos-line); border-radius: 12px; padding: .6rem; max-height: 320px; overflow-y: auto;
}
.pos-cliente-item { display: flex; flex-direction: column; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: .4rem .5rem; }
.pos-cliente-item:hover { background: #f1f5f9; }
.pos-lineas { flex: 1; overflow-y: auto; min-height: 140px; padding: .25rem .5rem; }
.pos-vacio-ticket { height: 100%; }
.pos-linea {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: .65rem; align-items: start; padding: .6rem .5rem;
    border-radius: 12px; cursor: pointer; border: 1px solid transparent;
}
.pos-linea:hover { background: #f8fafc; }
.pos-linea.activa { background: #eff6ff; border-color: #bfdbfe; }
.pos-linea-avatar { width: 40px; height: 40px; border-radius: 10px; color: #fff; font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.pos-linea-nombre { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.pos-linea-detalle { font-size: .75rem; color: var(--pos-muted); margin: .1rem 0 .35rem; }
.pos-linea-importe { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.pos-linea-borrar { font-size: .85rem; }
.pos-stepper { display: inline-flex; align-items: center; border: 1px solid var(--pos-line); border-radius: 999px; overflow: hidden; background: #fff; }
.pos-stepper button { width: 34px; height: 30px; border: 0; background: #fff; font-size: 1.1rem; font-weight: 600; color: var(--pos-text); }
.pos-stepper button:hover { background: #f1f5f9; }
.pos-stepper span { min-width: 38px; text-align: center; font-weight: 600; font-size: .9rem; }
.pos-totales { border-top: 1px solid var(--pos-line); padding: .7rem 1rem; font-size: .9rem; display: flex; flex-direction: column; gap: .2rem; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 1.6rem; margin-top: .3rem; letter-spacing: -.01em; }
.pos-total span:first-child { font-size: .8rem; font-weight: 700; color: var(--pos-muted); letter-spacing: .04em; }
.pos-acciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: 0 1rem .6rem; }
.pos-accion { border: 1px solid var(--pos-line); background: #fff; border-radius: 10px; padding: .5rem .25rem; font-size: .8rem; font-weight: 600; }
.pos-accion:hover:not(:disabled) { background: #f1f5f9; }
.pos-accion.activo { background: #0f172a; color: #fff; border-color: #0f172a; }
.pos-accion:disabled { opacity: .45; }
.pos-numpad { margin: 0 1rem .6rem; border: 1px solid var(--pos-line); border-radius: 14px; padding: .6rem; background: #f8fafc; }
.pos-numpad-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.pos-numpad-valor { font-size: 1.3rem; font-weight: 700; }
.pos-numpad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.pos-numpad-keys button { height: 40px; border: 1px solid var(--pos-line); border-radius: 10px; background: #fff; font-size: 1.15rem; font-weight: 600; }
.pos-numpad-keys button:active { transform: scale(.96); background: #f1f5f9; }
.pos-cta {
    margin: 0 1rem 1rem; height: 56px; border: 0; border-radius: 14px; background: var(--pos-primary); color: #fff; font-weight: 800;
    font-size: 1.1rem; letter-spacing: .02em; display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem;
    box-shadow: 0 6px 16px rgb(37 99 235 / .25);
}
.pos-cta:hover:not(:disabled) { background: var(--pos-primary-hover); }
.pos-cta:disabled { background: #94a3b8; box-shadow: none; }
.pos-btn-primary { background: var(--pos-primary); color: #fff; font-weight: 600; border-radius: 10px; }
.pos-btn-primary:hover:not(:disabled) { background: var(--pos-primary-hover); color: #fff; }
.pos-btn-cta { background: var(--pos-teal); color: #fff; font-weight: 700; border-radius: 10px; height: 48px; }
.pos-btn-cta:hover:not(:disabled) { background: var(--pos-teal-hover); color: #fff; }

/* Modales de la terminal */
.pos-modal-backdrop { position: fixed; inset: 0; background: rgb(15 23 42 / .45); z-index: 1050; }
.pos-modal {
    position: fixed; z-index: 1051; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem); display: flex; flex-direction: column; background: var(--pos-surface); border-radius: 18px;
    box-shadow: 0 24px 48px rgb(15 23 42 / .25);
}
.pos-modal-lg { width: min(820px, calc(100vw - 2rem)); }
.pos-modal-sm { width: min(420px, calc(100vw - 2rem)); }
.pos-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem .5rem; }
.pos-modal-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.pos-modal-body { padding: .5rem 1.25rem 1rem; overflow-y: auto; }
.pos-modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem 1.1rem; border-top: 1px solid var(--pos-line); }
.pos-pin { letter-spacing: .4em; font-weight: 700; }
.pos-metodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pos-metodo { border: 1px solid var(--pos-line); background: #fff; border-radius: 12px; padding: .8rem .5rem; font-weight: 600; }
.pos-metodo.activo { border-color: var(--pos-primary); background: #eff6ff; color: var(--pos-primary); box-shadow: 0 0 0 2px #bfdbfe; }
.pos-billetes { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; }
.pos-billete { height: 52px; border: 1px solid var(--pos-line); border-radius: 12px; background: #f0fdf4; font-weight: 700; font-size: 1.05rem; color: #166534; }
.pos-billete:active { transform: scale(.96); }
.pos-billete-exacto { background: #eff6ff; color: var(--pos-primary); }
.pos-resumen-cobro { background: #f8fafc; border: 1px solid var(--pos-line); border-radius: 14px; padding: 1rem; }
.pos-cambio { font-size: 1.6rem; font-weight: 800; color: var(--pos-teal); }
.pos-cambio-grande { font-size: 2.6rem; font-weight: 800; color: var(--pos-teal); line-height: 1.1; }
.pos-exito-icono {
    width: 56px; height: 56px; border-radius: 50%; background: #dcfce7; color: #16a34a; font-size: 1.8rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.pos-denominaciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.pos-denominacion { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; font-weight: 600; }
.pos-print-ticket { display: none; }

@media (max-width: 900px) {
    .pos-terminal { grid-template-columns: 1fr; height: auto; }
    .pos-ticket { border-left: 0; border-top: 1px solid var(--pos-line); }
    .pos-grid-wrap { max-height: 55vh; }
}

@media print {
    body * { visibility: hidden; }
    .pos-print-ticket, .pos-print-ticket * { visibility: visible; }
    .pos-print-ticket { display: block; position: absolute; left: 0; top: 0; width: 72mm; font-size: 11px; font-family: ui-monospace, monospace; }
}
