﻿/* ================================================================
   MONTSERRAT — Variable Font (local)
   ================================================================ */
@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat/Montserrat-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

:root {
    /* ── SCHEME MANAGER: Light Mode defaults ────────────────────────
       Estas variables son el preset por defecto. El módulo Scheme
       Manager las sobreescribe desde la BD inyectando un <style>
       con id="pos-scheme-vars" que tiene mayor especificidad.
    ─────────────────────────────────────────────────────────────── */
    --pos-bg:            #f0faf5;   /* fondo general del área POS       */
    --pos-surface:       #ffffff;   /* fondo de cards, tablas, modales  */
    --pos-primary:       #1aacb1;   /* color primario                   */
    --pos-primary-dark:  #148a8e;   /* primario oscuro: hover/gradient  */
    --pos-primary-light: #22c9ce;   /* primario claro                   */
    --pos-primary-muted: #d4f4f5;   /* primario muy suave: chips/badges */
    --pos-text:          #3A4656;   /* texto principal                  */
    --pos-text-muted:    #64748b;   /* texto secundario / gris          */
    --pos-border:        #e2e8f0;   /* bordes de inputs, tablas, divs   */
    --pos-success:       #4CAF50;   /* verde: activo, confirmado        */
    --pos-success-dark:  #3d8b40;   /* verde oscuro: hover de éxito     */
    --pos-warning:       #f59e0b;   /* amarillo: alerta, pendiente      */
    --pos-danger:        #ef4444;   /* rojo: error, inactivo            */

    /* ── backward-compat aliases (todo el CSS existente sigue OK) ── */
    --primary:       var(--pos-primary);
    --primary-dark:  var(--pos-primary-dark);
    --primary-light: var(--pos-primary-light);
    --primary-muted: var(--pos-primary-muted);
    --success:       var(--pos-success);
    --success-dark:  var(--pos-success-dark);
    --bg:            var(--pos-bg);
    --ink:           var(--pos-text);

    /* ── Scheme-aware semantic aliases (usadas por componentes nuevos) ── */
    --surface:        var(--pos-surface);
    --card-bg:        var(--pos-surface);
    --text-primary:   var(--pos-text);
    --text-secondary: var(--pos-text-muted);
    --text-muted:     var(--pos-text-muted);
    --border-color:   var(--pos-border);
    --danger:         var(--pos-danger);
    --warning:        var(--pos-warning);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    font-size: 1rem;
}

.pos-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    background: var(--bg);
}

/* ─── HEADER ─────────────────────────────────────── */
.pos-header {
    background: linear-gradient(135deg, var(--ink) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: white;
    padding: 0.45rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
    flex-shrink: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.15rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .5px;
}

.brand-sub {
    font-size: 1rem;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.header-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #7dd8db;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.header-user {
    text-align: right;
}

.header-user .label {
    font-size: 1rem;
    color: #7dd8db;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.header-user .name {
    font-size: 1rem;
    font-weight: 600;
}

/* ─── NAV ────────────────────────────────────────── */
.pos-nav {
    background: var(--primary);
    display: flex;
    align-items: stretch;
    padding: 0 .25rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    overflow-x: auto;
}

.pos-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .3rem;
    color: rgba(255,255,255,.8);
    padding: .5rem .85rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 500;
    transition: all .15s;
    text-decoration: none;
    user-select: none;
}

button.nav-item,
button.nav-notepad {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,.1);
    border-bottom-color: var(--pos-primary-light);
}

.nav-item.active {
    color: white;
    background: rgba(255,255,255,.15);
    border-bottom-color: white;
    font-weight: 700;
}

.nav-item .kbdx {
    font-size: 1rem;
    background: rgba(255,255,255,.18);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: monospace;
}

.nav-spacer {
    flex: 1;
}

.nav-guide {
    color: #ffffff !important;
}

.nav-guide:hover {
    background: rgba(96,165,250,.2) !important;
    border-bottom-color: #60a5fa !important;
    color: white !important;
}

.nav-exit {
    color: #fca5a5 !important;
}

.nav-exit:hover {
    background: rgba(239,68,68,.25) !important;
    border-bottom-color: #ef4444 !important;
    color: white !important;
}

.nav-theme-toggle {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
}
.nav-theme-toggle:hover {
    background: rgba(255,255,255,.12) !important;
    border-bottom-color: rgba(255,255,255,.45) !important;
    color: white !important;
}

/* Zoom controls */
.nav-zoom {
    display: flex;
    align-items: center;
    padding: 0 .1rem;
    border-right: 1px solid rgba(255,255,255,.15);
    margin-right: .15rem;
}
.nav-zoom-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255,255,255,.75);
    font-size: 1rem;
    padding: .5rem .45rem;
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 1;
}
.nav-zoom-btn:hover:not(:disabled) {
    background: rgba(255,255,255,.12);
    color: white;
    border-bottom-color: rgba(255,255,255,.4);
}
.nav-zoom-btn:disabled { opacity: .3; cursor: default; }
.nav-zoom-pct {
    font-size: 1rem;
    color: rgba(255,255,255,.85);
    min-width: 33px;
    text-align: center;
    font-weight: 600;
    user-select: none;
}

/* ─── CONTENT ────────────────────────────────────── */
.pos-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: .6rem .75rem;
    gap: .45rem;
    zoom: var(--pos-zoom, 1);
}

/* ─── SYSTEM DOWN (bloqueo de pantalla) ──────────── */
.pos-system-down {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-align: center;
    padding: 2rem;
    background: var(--ink, #0f172a);
    color: #f1f5f9;
}
.pos-system-down-icon {
    font-size: 3.2rem;
    color: var(--pos-danger, #f87171);
    margin-bottom: .5rem;
}
.pos-system-down h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: .02em;
}
.pos-system-down p {
    font-size: 1rem;
    color: rgba(241,245,249,.75);
    margin: 0;
}
.pos-system-down-sub {
    margin-top: .75rem !important;
    font-size: .9rem !important;
    color: rgba(241,245,249,.5) !important;
}

/* ─── DASHBOARD (selector de sistemas Fiyi) ──────── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    padding: 1rem 1.5rem;
}
.dash-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 2.5rem 1.5rem;
    background: var(--pos-surface, #fff);
    border: 1.5px solid var(--pos-border, #e2e8f0);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dash-card:hover {
    border-color: var(--pos-primary, #1aacb1);
    box-shadow: 0 8px 24px rgba(26,172,177,.18);
    transform: translateY(-2px);
}
.dash-card-icon {
    font-size: 2.6rem;
    color: var(--pos-primary, #1aacb1);
    margin-bottom: .35rem;
}
.dash-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--pos-text, #0f172a);
}
.dash-card-desc {
    font-size: .9rem;
    color: var(--pos-text-muted, #64748b);
}

/* ─── DASHBOARD PAGE (/panel-de-control, hub de sistemas Fiyi) ──────
   Mismo degradé + brillos radiales que el hero de Home (.lp-hero). */
.dashp {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f4c5c 100%);
    position: relative;
    overflow: hidden;
}
.dashp::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 60%, rgba(26,172,177,.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 80% 30%, rgba(99,102,241,.12) 0%, transparent 70%);
    pointer-events: none;
}
.dashp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    position: relative;
}
.dashp-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: #e2e8f0;
}
.dashp-brand i { color: #1aacb1; }
.dashp-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.dashp-user-name  { color: #e2e8f0; font-weight: 600; font-size: .85rem; }
.dashp-user-store { color: #94a3b8; font-size: .78rem; margin-top: 2px; }

.dashp-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 4rem;
    position: relative;
}
.dashp-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    text-align: center;
    line-height: 1.15;
    margin-bottom: 2.5rem;
}
.dashp-title span {
    background: linear-gradient(90deg, #1aacb1, #5eead4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.dashp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    width: 100%;
    max-width: 1040px;
}
.dashp-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 2.75rem 1.5rem;
    background: rgba(255,255,255,.05);
    border: 1.5px solid rgba(255,255,255,.14);
    border-radius: 16px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.dashp-card:hover {
    background: rgba(26,172,177,.12);
    border-color: #1aacb1;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26,172,177,.25);
}
.dashp-card-icon {
    font-size: 2.6rem;
    color: #5eead4;
    margin-bottom: .4rem;
}
.dashp-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}
.dashp-card-desc {
    font-size: .88rem;
    color: #94a3b8;
}

/* ─── FIYI PLACEHOLDER (/online, /resto, /canchas) ── */
.fiyi-placeholder {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .6rem;
    padding: 2rem 1.5rem;
    background: #f4f6f8;
}
.fiyi-placeholder-icon {
    font-size: 3.5rem;
    color: #1aacb1;
}
.fiyi-placeholder h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.fiyi-placeholder-badge {
    display: inline-flex;
    align-items: center;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
    font-size: .8rem;
    padding: .3rem .9rem;
    border-radius: 99px;
}
.fiyi-placeholder p {
    color: #64748b;
    max-width: 420px;
    font-size: .95rem;
    line-height: 1.5;
    margin: 0 0 .75rem;
}

/* ─── TICKET BANNER ──────────────────────────────── */
.ticket-banner {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
    color: white;
    padding: .45rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .5px;
    box-shadow: 0 3px 10px rgba(26,172,177,.3);
    flex-shrink: 0;
}

/* ─── INPUT ROW ──────────────────────────────────── */
.input-row {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.code-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--pos-surface);
    border: 2px solid var(--pos-border);
    border-radius: 10px;
    padding: 0 .85rem;
    transition: border-color .15s, box-shadow .15s;
}

.code-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,172,177,.15);
}

.code-input-wrap label {
    color: var(--pos-text-muted);
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.code-input-wrap input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    padding: .6rem 0;
    background: transparent;
    color: var(--pos-text);
}

.btn-add {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    border: none;
    border-radius: 10px;
    padding: .55rem 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(76,175,80,.35);
    transition: all .15s;
    white-space: nowrap;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(76,175,80,.45);
}

.kbdx-inline {
    background: rgba(255,255,255,.22);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 1rem;
    font-family: monospace;
}

/* ─── ACTION BUTTONS ─────────────────────────────── */
.action-row {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.abtn {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .5rem .8rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
    white-space: nowrap;
    user-select: none;
}

.abtn .k {
    font-size: 1rem;
    opacity: .7;
    font-family: monospace;
    background: rgba(0,0,0,.08);
    border-radius: 3px;
    padding: 1px 4px;
}

.abtn-purple {
    background: #ede9fe;
    color: #6d28d9;
}

.abtn-purple:hover {
    background: #ddd6fe;
}

.abtn-blue {
    background: var(--pos-primary-muted);
    color: var(--pos-primary);
}

.abtn-blue:hover {
    background: var(--pos-primary);
    color: #fff;
}

.abtn-primary {
    background: var(--pos-primary-muted);
    color: var(--pos-primary);
}

.abtn-primary:hover {
    background: var(--pos-primary);
    color: #fff;
}

.abtn-amber {
    background: #fef3c7;
    color: #b45309;
}

.abtn-amber:hover {
    background: #fde68a;
}

.abtn-teal {
    background: #ccfbf1;
    color: #0f766e;
}

.abtn-teal:hover {
    background: #99f6e4;
}

.abtn-green {
    background: color-mix(in srgb, var(--pos-success) 14%, white);
    color: var(--pos-success-dark);
}

.abtn-green:hover {
    background: var(--pos-success);
    color: #fff;
}

.abtn-success {
    background: color-mix(in srgb, var(--pos-success) 14%, white);
    color: var(--pos-success-dark);
}

.abtn-success:hover {
    background: var(--pos-success);
    color: #fff;
}

.abtn-rose {
    background: color-mix(in srgb, var(--pos-danger) 12%, white);
    color: var(--pos-danger);
}

.abtn-rose:hover {
    background: var(--pos-danger);
    color: #fff;
}

.abtn-red {
    background: #fce7f3;
    color: #9d174d;
}

.abtn-red:hover {
    background: #fbcfe8;
}

.abtn-gray {
    background: var(--pos-bg);
    color: var(--pos-text-muted);
    border: 1px solid var(--pos-border);
}
.abtn-gray:hover {
    background: var(--pos-border);
    color: var(--pos-text);
}

/* ================================================================
   SCHEME MANAGER MODULE — scm-*
   ================================================================ */

/* Two-column wrapper */
.scm-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
}

.scm-sections {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.scm-sidebar {
    width: 256px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

/* Shared sidebar panel */
.scm-panel {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    overflow: hidden;
}

.scm-panel-title {
    font-size: 1rem;
    font-weight: 700;
    padding: .55rem .85rem;
    border-bottom: 1px solid var(--pos-border);
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
}

.scm-section {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.scm-section-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pos-primary);
    margin-bottom: .15rem;
}

.scm-section-desc {
    font-size: 1rem;
    color: var(--pos-text-muted);
    margin-bottom: .85rem;
}

.scm-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem 0;
    border-bottom: 1px solid #f8fafc;
}

.scm-row:last-child { border-bottom: none; }

.scm-row-label {
    flex: 1;
    font-size: 1rem;
    color: var(--pos-text);
}

.scm-color-swatch {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--pos-border);
    cursor: pointer;
    padding: 2px;
    background: transparent;
    flex-shrink: 0;
}

.scm-hex-input {
    width: 86px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    padding: .28rem .5rem;
    color: var(--pos-text);
    background: #f9fafb;
    text-transform: uppercase;
    outline: none;
    flex-shrink: 0;
    transition: border-color .15s;
}

.scm-hex-input:focus { border-color: var(--pos-primary); background: #fff; }

/* === LIVE PREVIEW === */
.scm-preview-frame {
    margin: .65rem;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    overflow: hidden;
}

.scm-pv-nav {
    background: var(--pos-primary);
    padding: .32rem .55rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.scm-pv-nav-brand {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .04em;
}
.scm-pv-nav-chip {
    font-size: 1rem;
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.18);
    padding: .04rem .35rem;
    border-radius: 999px;
}
.scm-pv-body {
    background: var(--pos-bg);
    padding: .55rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.scm-pv-stats { display: flex; gap: .35rem; }
.scm-pv-stat {
    flex: 1;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 5px;
    padding: .3rem .4rem;
}
.scm-pv-stat-lbl { font-size: 1rem; color: var(--pos-text-muted); margin-bottom: .07rem; }
.scm-pv-stat-val { font-size: 1rem; font-weight: 700; }
.scm-pv-stat-val.v-primary { color: var(--pos-primary); }
.scm-pv-stat-val.v-success  { color: var(--pos-success); }
.scm-pv-stat-val.v-danger   { color: var(--pos-danger); }

.scm-pv-card {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 5px;
    overflow: hidden;
}
.scm-pv-card-hdr {
    padding: .27rem .45rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--pos-text);
    border-bottom: 1px solid var(--pos-border);
}
.scm-pv-row {
    padding: .25rem .45rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--pos-border);
    font-size: 1rem;
    color: var(--pos-text);
}
.scm-pv-row:last-child { border-bottom: none; }
.scm-pv-pill {
    padding: .04rem .28rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}
.scm-pv-pill.ok  { background: var(--pos-success); }
.scm-pv-pill.err { background: var(--pos-danger); }

.scm-pv-actions { display: flex; gap: .3rem; }
.scm-pv-btn {
    flex: 1;
    padding: .24rem 0;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: default;
    text-align: center;
    border: none;
}
.scm-pv-btn.primary { background: var(--pos-primary); color: #fff; }
.scm-pv-btn.outline {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    color: var(--pos-text-muted);
}

/* === QUICK PRESETS === */
.scm-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    padding: .75rem .85rem;
}
.scm-preset-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    outline: none;
    transition: transform .15s, box-shadow .15s;
}
.scm-preset-dot:hover { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.scm-preset-dot-active {
    border-color: var(--pos-text);
    box-shadow: 0 0 0 2px var(--pos-bg), 0 0 0 4px var(--pos-text);
}

.scm-theme-select {
    padding: .35rem .75rem;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--pos-text);
    background: var(--pos-surface);
    cursor: pointer;
    outline: none;
    align-self: center;
}
.scm-theme-select:focus { border-color: var(--pos-primary); }

.abtn-sky {
    background: var(--pos-bg);
    color: var(--pos-text-muted);
    border: 1px solid var(--pos-border);
}

.abtn-sky:hover {
    background: var(--pos-border);
    color: var(--pos-text);
}

.abtn-danger {
    background: var(--pos-bg);
    color: var(--pos-danger);
    border: 1px solid var(--pos-border);
}

.abtn-danger:hover {
    background: var(--pos-danger);
    color: #FFFFFF;
}

/* ─── TABS + ACTION ROW ──────────────────────────── */
.tabs-action-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem;
    flex-shrink: 0;
}

.ticket-tabs {
    display: flex;
    align-items: flex-end;
    gap: .2rem;
    flex-shrink: 0;
}

.ttab {
    background: #e0e7ff;
    color: var(--primary);
    padding: .3rem .9rem;
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.ttab.active {
    background: white;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.tab-add {
    background: transparent;
    border: 1.5px solid var(--pos-primary-light);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .7rem;
    cursor: pointer;
    color: var(--primary);
    font-size: 1rem;
    align-self: flex-end;
    transition: background .13s, color .13s;
}

.tab-add:hover {
    background: #e0e7ff;
    color: var(--pos-primary-dark);
}

.ttab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.ttab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    opacity: .55;
    transition: opacity .12s, background .12s;
    cursor: pointer;
    margin-left: .1rem;
}
.ttab-close:hover {
    opacity: 1;
    background: rgba(239,68,68,.18);
    color: #ef4444;
}

/* ─── BUSCAR MODAL (F10) ────────────────────────── */
.buscar-search-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .75rem;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    background: var(--pos-bg);
}
.buscar-search-wrap i { color: var(--pos-primary); font-size: 1rem; flex-shrink: 0; }
.buscar-search-wrap input {
    flex: 1;
    font-size: 1rem;
    border: none;
    outline: none;
    background: transparent;
    color: var(--pos-text);
}
.buscar-num { text-align: right !important; }
.buscar-table tr:hover td { background: transparent !important; }
.buscar-row-selected td { background: var(--pos-primary-light) !important; }
.buscar-stock-low { color: var(--pos-danger) !important; font-weight: 600; }

/* ─── VARIOS MODAL ──────────────────────────────── */
.varios-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    min-width: 480px;
    max-width: 560px;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.varios-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.varios-close {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.varios-close:hover { background: #dc2626; }

.varios-body {
    display: flex;
    gap: 0;
}

.varios-form {
    flex: 1;
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    border-right: 1px solid var(--border-color);
}

.varios-section-header {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .06em;
    color: white;
    background: linear-gradient(90deg, #0891b2, #06b6d4);
    padding: .45rem 1rem;
    border-radius: 6px;
    margin-bottom: .15rem;
}

.varios-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.varios-field label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.varios-input-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.varios-input-wrap i { color: #6366f1; flex-shrink: 0; }
.varios-input-wrap input { flex: 1; }

.varios-qty-input {
    width: 140px;
    text-align: right;
    font-size: 1.05rem;
    font-weight: 600;
}

.varios-error {
    font-size: 1rem;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: .4rem .7rem;
}

.varios-actions {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1rem 1.25rem;
    justify-content: flex-start;
    min-width: 130px;
}

.varios-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border: none;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.varios-btn:disabled { opacity: .55; cursor: not-allowed; }
.varios-btn-accept {
    background: #10b981;
    color: white;
}
.varios-btn-accept:hover:not(:disabled) { background: #059669; }
.varios-btn-cancel {
    background: #ef4444;
    color: white;
}
.varios-btn-cancel:hover { background: #dc2626; }

/* ─── SWITCH TICKET MODAL ────────────────────────── */
.ventas-switch-modal {
    background: white;
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.25rem;
    min-width: 320px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vsm-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.vsm-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.vsm-item:hover {
    border-color: var(--primary);
    background: rgba(99,102,241,.04);
}
.vsm-item.vsm-active {
    border-color: var(--primary);
    background: rgba(99,102,241,.08);
}

.vsm-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #e0e7ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.vsm-item-info {
    flex: 1;
    min-width: 0;
}
.vsm-item-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.vsm-item-meta {
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vsm-badge {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
}

/* ─── TABLE AREA ─────────────────────────────────── */
.table-card {
    flex: 1;
    background: var(--pos-surface);
    border-radius: 0 10px 10px 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos-table {
    width: 100%;
    border-collapse: collapse;
}

.pos-table thead th {
    background: var(--pos-bg);
    color: var(--pos-text);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .55rem .75rem;
    border-bottom: 2px solid var(--pos-border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pos-table tbody td {
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--pos-border);
    font-size: 1rem;
    color: var(--pos-text);
}

.pos-table tbody tr:hover {
    background: var(--pos-primary-muted);
}

.col-barcode {
    width: 130px;
}

.col-price, .col-amount {
    width: 105px;
    text-align: right;
}

.col-qty {
    width: 70px;
    text-align: center;
}

.col-stock {
    width: 85px;
    text-align: center;
}

.amt-cell {
    background: rgba(76,175,80,.12);
    color: var(--pos-success-dark);
    font-weight: 700;
}

.tbody-scroll {
    overflow-y: auto;
    flex: 1;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    gap: .5rem;
    padding: 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

.empty-state .hint {
    font-size: 1rem;
}

/* ─── BOTTOM BAR ─────────────────────────────────── */
.pos-bottom {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
    background: var(--pos-surface);
    border-radius: 12px;
    padding: .5rem .75rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,.07);
}

.count-badge {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.count-text {
    color: #6b7280;
    font-size: 1rem;
    flex: 1;
    white-space: nowrap;
}

.bottom-btns {
    display: flex;
    gap: .3rem;
}

.bbtn {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .38rem .7rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
    white-space: nowrap;
    user-select: none;
}

.bbtn-amber {
    background: #fef3c7;
    color: #92400e;
}

.bbtn-amber:hover {
    background: #fde68a;
}

.bbtn-sky {
    background: #e0f2fe;
    color: #0369a1;
}

.bbtn-sky:hover {
    background: #bae6fd;
}

.bbtn-rose {
    background: #fee2e2;
    color: #dc2626;
}

.bbtn-rose:hover {
    background: #fecaca;
}

.bbtn-green {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.bbtn-green:hover {
    background: #dcfce7;
}

.totals-area {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
}

.side-btn {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .38rem .65rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--pos-border);
    background: var(--pos-bg);
    color: var(--pos-text);
    transition: all .15s;
    white-space: nowrap;
}

.side-btn:hover {
    background: var(--pos-primary-muted);
    border-color: var(--pos-primary);
    color: var(--pos-primary-dark);
}

.total-display {
    background: linear-gradient(135deg, var(--ink), #0e6568);
    color: white;
    border-radius: 12px;
    padding: .45rem 1rem;
    text-align: right;
    min-width: 120px;
}

.total-display .amount {
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1;
    color: #7dd8db;
}

.total-display .sublabel {
    font-size: 1rem;
    color: rgba(255,255,255,.55);
}

.checkout-btn {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: .55rem 1.4rem;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(20,138,142,.4);
    transition: all .15s;
}

.checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(20,138,142,.55);
}

.checkout-btn .kbdx-inline {
    background: rgba(255,255,255,.22);
}

/* ─── SECTION PLACEHOLDER ────────────────────────── */
.section-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: .75rem;
    text-align: center;
}

.section-placeholder i {
    font-size: 3.5rem;
    color: #b5e8ea;
}

.section-placeholder h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #6b7280;
}

.section-placeholder p {
    margin: 0;
    font-size: 1rem;
    color: #d1d5db;
}

/* ─── CLIENTES MODULE ────────────────────────────── */
.clientes-header {
    flex-shrink: 0;
}

.clientes-header-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .1rem;
}

.clientes-header-sub {
    font-size: 1rem;
    color: #6b7280;
}

.clientes-body {
    flex: 1;
    display: flex;
    gap: .5rem;
    min-height: 0;
}

.clientes-list-panel {
    width: 300px;
    flex-shrink: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.clientes-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .6rem;
    border-bottom: 1px solid #e5e7eb;
}

.clientes-search i { color: #9ca3af; font-size: 1rem; }

.clientes-search input {
    border: none;
    outline: none;
    font-size: 1rem;
    flex: 1;
    background: transparent;
}

.clientes-list-head {
    display: grid;
    grid-template-columns: 44px 44px 1fr;
    padding: .3rem .6rem;
    background: #f8faff;
    border-bottom: 2px solid #e5e7eb;
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.clientes-list {
    flex: 1;
    overflow-y: auto;
}

.clientes-row {
    display: grid;
    grid-template-columns: 44px 44px 1fr;
    align-items: center;
    padding: .4rem .6rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
    color: #374151;
}

.clientes-row:hover { background: #e8f8f9; }

.clientes-row.active {
    background: #3d5166;
    color: white;
}

.clientes-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.clientes-folio {
    font-size: 1rem;
    font-weight: 500;
}

.clientes-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.clientes-name {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clientes-sub {
    font-size: 1rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clientes-row.active .clientes-sub { color: rgba(255,255,255,.65); }

.clientes-list-footer {
    padding: .4rem .6rem;
    border-top: 1px solid #e5e7eb;
}

.clientes-form-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.clientes-toolbar {
    display: flex;
    gap: .4rem;
    padding: .45rem .75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.clientes-form-header {
    padding: .7rem 1.5rem .3rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.clientes-form-body {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 1.5rem;
}

.clientes-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 .65rem;
}

.clientes-field-hint {
    font-size: 1rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: .25rem;
}

.cr-balance-owed {
    color: #dc2626;
    font-weight: 700;
}

.clientes-field {
    display: grid;
    grid-template-columns: 165px 1fr;
    align-items: center;
    gap: .4rem;
    margin-bottom: .38rem;
}

.clientes-field label {
    font-size: 1rem;
    color: #374151;
    text-align: right;
    font-weight: 500;
}

.clientes-field input,
.clientes-field select,
.clientes-field textarea {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: .28rem .5rem;
    font-size: 1rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    background: white;
}

.clientes-field input:focus,
.clientes-field select:focus,
.clientes-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.12);
}

.clientes-field textarea { resize: vertical; min-height: 64px; }

.clientes-field-row {
    display: flex;
    gap: .35rem;
}

.clientes-field-row select { flex: 1; }

.clientes-input-short { max-width: 120px !important; }

.clientes-field-textarea { align-items: flex-start; }
.clientes-field-textarea label { padding-top: .3rem; }

.clientes-section {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: .2rem;
    margin: .65rem 0 .45rem;
}

.clientes-check-row {
    display: grid;
    grid-template-columns: 165px 1fr;
    margin-bottom: .45rem;
}

.clientes-check-row label {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: 1rem;
    color: #374151;
    cursor: pointer;
}

.clientes-check-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ─── MODAL DE CONFIRMACIÓN ─────────────────────── */
.clientes-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.clientes-modal {
    background: white;
    border-radius: 14px;
    padding: 2rem 2.25rem;
    width: 380px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    text-align: center;
}

.clientes-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    font-size: 1.4rem;
}

.clientes-modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
}

.clientes-modal-body {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.5;
}

.clientes-modal-actions {
    display: flex;
    gap: .6rem;
    margin-top: .25rem;
}

/* ─── READ-ONLY FIELDS ───────────────────────────── */
.clientes-readonly-value {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 .6rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: .35rem;
    font-size: 1rem;
    color: #475569;
    font-weight: 600;
}

/* ─── VALIDATION ────────────────────────────────── */
.required-star {
    color: var(--pos-danger);
    font-weight: 700;
}

.input-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220,38,38,.12) !important;
}

.clientes-info-card {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: .45rem;
    padding: .55rem .85rem;
    font-size: 1rem;
    margin-bottom: .75rem;
}

/* ─── PRODUCTOS MODULE ───────────────────────────── */
.productos-header {
    padding: .9rem 1.4rem .5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.productos-header-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--primary);
    text-transform: uppercase;
}

.productos-header-sub {
    font-size: 1rem;
    color: #64748b;
    margin-top: .15rem;
}

.productos-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.productos-list-panel {
    width: 310px;
    min-width: 310px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.productos-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.productos-search i { color: #94a3b8; font-size: 1rem; }

.productos-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--ink);
}

.productos-list-head {
    display: grid;
    grid-template-columns: 2rem 2.5rem 1fr auto;
    gap: .4rem;
    padding: .35rem .8rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #94a3b8;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.productos-list {
    flex: 1;
    overflow-y: auto;
}

.productos-row {
    display: grid;
    grid-template-columns: 2rem 2.5rem 1fr auto;
    align-items: center;
    gap: .4rem;
    padding: .5rem .8rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.productos-row:hover { background: #f0f4ff; }
.productos-row.active { background: #e0e7ff; }

.productos-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.productos-folio {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 600;
}

.productos-info { min-width: 0; }

.productos-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productos-sub {
    display: block;
    font-size: 1rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productos-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.productos-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.productos-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.productos-toolbar {
    display: flex;
    gap: .5rem;
    padding: .6rem .9rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.productos-form-header {
    padding: .7rem 1rem .3rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

.productos-form-body {
    flex: 1;
    overflow-y: auto;
    padding: .8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.productos-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.productos-section {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    border-bottom: 1px solid #e0e7ff;
    padding-bottom: .25rem;
    margin-top: .35rem;
}

.productos-field {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
}

.productos-field label {
    color: #475569;
    font-weight: 500;
    font-size: 1rem;
}

.productos-field input,
.productos-field select,
.productos-field textarea {
    width: 100%;
    padding: .32rem .55rem;
    border: 1px solid #cbd5e1;
    border-radius: .35rem;
    font-size: 1rem;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}

.productos-field input:focus,
.productos-field select:focus,
.productos-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.1);
}

.productos-field-textarea {
    align-items: flex-start;
}

.productos-field-textarea textarea {
    min-height: 4.5rem;
    resize: vertical;
}

.productos-check-row {
    font-size: 1rem;
    color: #475569;
    padding-left: 134px;
}

.productos-check-row label {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
}

/* ─── STATUS BAR ─────────────────────────────────── */
.pos-statusbar {
    background: #1e1b4b;
    color: rgba(255,255,255,.45);
    font-size: 1rem;
    padding: .22rem 1rem;
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
}
.pos-statusbar-right {
    display: flex;
    align-items: center;
    gap: .85rem;
}
.pos-statusbar-support {
    display: inline-flex;
    align-items: center;
    color: #25d366;
    text-decoration: none;
    font-weight: 600;
    opacity: .85;
    transition: opacity .15s;
}
.pos-statusbar-support:hover {
    color: #25d366;
    opacity: 1;
    text-decoration: underline;
}

/* ─── VENTAS MODULE ──────────────────────────────── */

/* Selected row in cart table */
.pos-table tbody tr.row-selected td {
    background: #e0f5f5;
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

/* Inline quantity input */
.qty-input {
    width: 62px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: .2rem .3rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.qty-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.12);
}

/* Hide number spinners on qty-input */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-input { -moz-appearance: textfield; }

/* Multi-line totals panel */
.total-lines {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: 10px;
    padding: .45rem 1rem;
    min-width: 148px;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
}

.total-line-label {
    font-size: 1rem;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.total-line-value {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255,255,255,.9);
}

.total-line-main {
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: .15rem;
    padding-top: .15rem;
}

.total-line-main .total-line-label {
    font-size: 1rem;
    color: rgba(255,255,255,.7);
}

.total-line-main .total-line-value {
    font-size: 1.22rem;
    font-weight: 900;
    color: white;
}

/* Disabled states */
.checkout-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.bbtn:disabled,
.abtn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── Checkout modal ── */
.ventas-checkout-modal {
    background: white;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    width: 440px;
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
    text-align: center;
}

.ventas-checkout-total {
    width: 100%;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: .5rem 1rem;
    font-size: 1rem;
    color: #166534;
}

.ventas-pm-label {
    align-self: flex-start;
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ventas-pm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    width: 100%;
    justify-content: center;
}

.pm-btn {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .95rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.pm-btn:hover {
    border-color: #7dd8db;
    background: #e8f8f9;
    color: var(--primary);
}

.pm-btn.active {
    border-color: var(--primary);
    background: #e0f5f5;
    color: var(--primary);
    font-weight: 700;
}

.ventas-field-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
}

.ventas-field-row label {
    font-size: 1rem;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
    min-width: 70px;
    text-align: right;
}

.ventas-amount-input {
    flex: 1;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    padding: .35rem .6rem;
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}

.ventas-amount-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,172,177,.12);
}

.ventas-change-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .4rem .85rem;
    font-size: 1rem;
    color: #92400e;
}

.ventas-change-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: #b45309;
}

/* ── Client modal ── */
.ventas-client-modal {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    width: 480px;
    max-width: 92vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
}

.ventas-client-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: .35rem .7rem;
    width: 100%;
    transition: border-color .15s;
}

.ventas-client-search:focus-within {
    border-color: var(--primary);
}

.ventas-client-search i { color: #9ca3af; font-size: 1rem; }

.ventas-client-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    background: transparent;
    font-family: inherit;
}

.ventas-client-list {
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.ventas-client-row {
    display: flex;
    flex-direction: column;
    padding: .5rem .75rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background .12s;
}

.ventas-client-row:hover { background: #e8f8f9; }
.ventas-client-row:last-child { border-bottom: none; }

.ventas-client-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.ventas-client-email {
    font-size: 1rem;
    color: #9ca3af;
}

.ventas-client-empty {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: 1rem;
}

/* ─── CORTE MODULE ───────────────────────────────── */
.corte-header {
    flex-shrink: 0;
}

.corte-header-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .1rem;
}

.corte-header-sub {
    font-size: 1rem;
    color: #6b7280;
}

.corte-body {
    flex: 1;
    display: flex;
    gap: .5rem;
    min-height: 0;
}

/* ── Left: history list ── */
.corte-list-panel {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.corte-list-head {
    display: grid;
    grid-template-columns: 1fr 48px 80px;
    padding: .35rem .7rem;
    background: #f8faff;
    border-bottom: 2px solid #e5e7eb;
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.corte-list {
    flex: 1;
    overflow-y: auto;
}

.corte-row {
    display: grid;
    grid-template-columns: 1fr 48px 80px;
    align-items: center;
    padding: .45rem .7rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}

.corte-row:hover { background: #e8f8f9; }
.corte-row.active { background: #e0f5f5; }

.corte-date { font-size: 1rem; font-weight: 500; color: #374151; }

.corte-sales-count {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
}

.corte-diff-badge {
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
}

.corte-diff-badge.neg { color: #dc2626; }
.corte-diff-badge.pos { color: #059669; }

/* ── Right: main panel ── */
.corte-main-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    min-width: 0;
}

.corte-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: #9ca3af;
    font-size: 1rem;
}

/* ── Historic cut detail ── */
.corte-detail-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.corte-detail-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: .45rem;
}

.corte-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.corte-kpi {
    background: #f8faff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .5rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 130px;
}

.corte-kpi-neg { background: #fff1f2; border-color: #fecaca; }
.corte-kpi-pos { background: #f0fdf4; border-color: #bbf7d0; }
.corte-kpi-ok  { background: #f0fdf4; border-color: #bbf7d0; }

.corte-kpi-label {
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.corte-kpi-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.corte-kpi-val.small { font-size: 1rem; font-weight: 500; }

.corte-kpi-neg .corte-kpi-val { color: #dc2626; }
.corte-kpi-pos .corte-kpi-val { color: #059669; }

.corte-notes-display {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: .4rem .75rem;
    font-size: 1rem;
    color: #92400e;
}

/* ── New cut card ── */
.corte-new-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.corte-period-banner {
    background: linear-gradient(90deg, #e0f5f5, #e8f8f9);
    border: 1px solid #b5e8ea;
    border-radius: 8px;
    padding: .55rem .9rem;
    font-size: 1rem;
    color: #148a8e;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
}

.corte-section-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #e0e7ff;
    padding-bottom: .2rem;
}

.corte-pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.corte-pm-table thead th {
    background: #f8faff;
    padding: .35rem .65rem;
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
}

.corte-pm-table tbody td {
    padding: .4rem .65rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.corte-pm-table tbody tr.row-cash {
    background: #f0fdf4;
    font-weight: 600;
}

.corte-pm-table tbody tr.row-cash td { color: #166534; }

.corte-empty-period {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: .5rem .85rem;
    font-size: 1rem;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ── Fields ── */
.corte-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem .9rem;
}

.corte-field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.corte-field label {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.corte-field-hint {
    font-size: 1rem;
    color: #9ca3af;
}

.corte-field-full {
    grid-column: 1 / -1;
}

.corte-field textarea {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: .35rem .55rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: border-color .15s;
}

.corte-field textarea:focus { border-color: var(--primary); }

.corte-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color .15s;
}

.corte-input-wrap:focus-within { border-color: var(--primary); }

.corte-currency {
    background: #f3f4f6;
    padding: .3rem .55rem;
    font-size: 1rem;
    color: #6b7280;
    font-weight: 600;
    border-right: 1px solid #e5e7eb;
}

.corte-input-wrap input {
    border: none;
    outline: none;
    padding: .3rem .55rem;
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
    background: white;
    text-align: right;
    font-family: inherit;
}

.corte-readonly-box {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: .35rem .65rem;
    background: #f8faff;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: .5rem;
}

.corte-diff-box {
    border-radius: 6px;
    padding: .35rem .75rem;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.corte-diff-box span { font-size: 1rem; font-weight: 500; }
.diff-ok  { background: #f0fdf4; color: #059669; border: 1px solid #bbf7d0; }
.diff-pos { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.diff-neg { background: #fff1f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Actions ── */
.corte-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding-top: .35rem;
    border-top: 1px solid #f3f4f6;
}

.corte-confirm-btn {
    background: linear-gradient(135deg, #1e1b4b, var(--primary));
    color: white;
    border: none;
    border-radius: 10px;
    padding: .55rem 1.4rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.35);
    transition: all .15s;
}

.corte-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.45);
}

.corte-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Options column in cart table */
.col-options {
    width: 44px;
    text-align: center;
}

.row-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    font-size: 1rem;
    padding: .2rem .35rem;
    border-radius: 4px;
    transition: color .15s, background .15s;
    line-height: 1;
}

.row-delete-btn:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* Credit payment button in checkout modal */
.pm-btn-credit {
    border-color: #d97706;
    color: #92400e;
}

.pm-btn-credit:hover {
    background: #fffbeb;
    border-color: #b45309;
}

.pm-btn-credit.active-credit {
    background: #fef3c7;
    border-color: #d97706;
    color: #78350f;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(217,119,6,.2);
}

.ventas-credit-banner {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .65rem .9rem;
    font-size: 1rem;
    color: #78350f;
    margin-top: .5rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.ventas-credit-banner-danger {
    background: #fff1f2;
    border-color: #fecaca;
    color: #991b1b;
}

.vcb-limits {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
    flex-wrap: wrap;
}

.vcb-ok   { color: #16a34a; font-weight: 600; }
.vcb-over { color: #dc2626; font-weight: 700; }

.vcb-warning {
    font-size: 1rem;
    font-weight: 600;
    color: #dc2626;
}

/* ================================================================
   INVENTARIO MODULE
   ================================================================ */

.inventario-header {
    padding: .9rem 1.2rem .5rem;
    border-bottom: 1px solid #e5e7eb;
}

.inventario-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .04em;
}

.inventario-header-sub {
    font-size: 1rem;
    color: #6b7280;
    margin-top: .15rem;
}

.inventario-body {
    display: flex;
    gap: 0;
    height: calc(100% - 60px);
    overflow: hidden;
}

/* ── Left panel: history ── */
.inventario-list-panel {
    width: 420px;
    min-width: 340px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inv-history-search-wrap {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .8rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.inv-history-search-wrap i.fa-search {
    color: #9ca3af;
    font-size: 1rem;
    flex-shrink: 0;
}

.inv-history-search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #1e293b;
    background: transparent;
}

.inv-history-search-wrap input::placeholder {
    color: #9ca3af;
}

.inv-history-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1rem;
    padding: .15rem .3rem;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s;
}

.inv-history-clear-btn:hover {
    color: #6b7280;
}

.inventario-list-head {
    display: grid;
    grid-template-columns: 90px 1fr 72px 80px;
    padding: .45rem .9rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.inventario-list {
    overflow-y: auto;
    flex: 1;
}

.inventario-row {
    display: grid;
    grid-template-columns: 90px 1fr 72px 80px;
    padding: .5rem .9rem;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    font-size: 1rem;
    transition: background .12s;
}

.inventario-row:hover {
    background: #f8fafc;
}

.mv-date {
    color: #6b7280;
    font-size: 1rem;
}

.mv-product {
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: .5rem;
}

.mv-stock-after {
    color: #374151;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Movement type badges */
.mv-type-badge {
    display: inline-block;
    font-size: 1rem;
    font-weight: 700;
    padding: .15rem .4rem;
    border-radius: 4px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.mv-in {
    background: #dcfce7;
    color: #16a34a;
}

.mv-out {
    background: #fee2e2;
    color: #dc2626;
}

.mv-adjust {
    background: #fef9c3;
    color: #854d0e;
}

/* ── Right panel: form ── */
.inventario-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inventario-form-header {
    padding: .65rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.inventario-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
}

.inventario-form-body {
    padding: .9rem 1.1rem;
    overflow-y: auto;
    flex: 1;
}

.inventario-section {
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .45rem;
}

/* Product search */
.inv-search-row {
    margin-bottom: .4rem;
}

.inv-search-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: .45rem .7rem;
    transition: border-color .15s;
}

.inv-search-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.inv-search-wrap i {
    color: #9ca3af;
    font-size: 1rem;
}

.inv-search-wrap input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    color: #1e293b;
    background: transparent;
}

.inv-search-results {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    margin-top: .25rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.inv-search-result-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .8rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.inv-search-result-row:last-child {
    border-bottom: none;
}

.inv-search-result-row:hover {
    background: #f0f9ff;
}

.inv-res-name {
    flex: 1;
    font-size: 1rem;
    color: #1e293b;
    font-weight: 500;
}

.inv-res-barcode {
    font-size: 1rem;
    color: #9ca3af;
    font-family: monospace;
}

.inv-res-stock {
    font-size: 1rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Selected product card */
.inv-product-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: .7rem .9rem;
    margin-bottom: .6rem;
}

.inv-product-name {
    font-size: 1rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: .3rem;
}

.inv-product-meta {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
    color: #15803d;
    flex-wrap: wrap;
}

.inv-clear-btn {
    margin-top: .5rem;
    background: none;
    border: 1px solid #86efac;
    color: #16a34a;
    border-radius: 5px;
    padding: .25rem .6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
}

.inv-clear-btn:hover {
    background: #dcfce7;
}

/* Movement type selector */
.mv-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: .6rem;
}

.mv-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .6rem .4rem;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #6b7280;
    transition: all .15s;
}

.mv-type-btn i {
    font-size: 1.1rem;
}

.mv-type-btn small {
    font-size: 1rem;
    color: #9ca3af;
}

.mv-type-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.mv-type-btn.active-in {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}

.mv-type-btn.active-in i {
    color: #16a34a;
}

.mv-type-btn.active-out {
    border-color: #dc2626;
    background: #fff1f2;
    color: #991b1b;
}

.mv-type-btn.active-out i {
    color: #dc2626;
}

.mv-type-btn.active-adj {
    border-color: #d97706;
    background: #fffbeb;
    color: #92400e;
}

.mv-type-btn.active-adj i {
    color: #d97706;
}

/* Quantity row */
.inv-qty-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .6rem;
}

.inv-qty-wrap {
    flex: 0 0 160px;
}

.inv-qty-wrap input {
    width: 100%;
    padding: .45rem .7rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.inv-qty-wrap input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Adjust delta preview */
.inv-adjust-preview {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1rem;
    font-weight: 700;
    padding: .35rem .7rem;
    border-radius: 6px;
}

.inv-adjust-preview span {
    font-size: 1rem;
    font-weight: 400;
}

.adj-pos {
    background: #dcfce7;
    color: #16a34a;
}

.adj-neg {
    background: #fee2e2;
    color: #dc2626;
}

.adj-ok {
    background: #f1f5f9;
    color: #6b7280;
}

/* Reason + Reference row */
.inv-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: .7rem;
}

.inv-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.inv-field label {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.inv-field input {
    padding: .42rem .65rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.inv-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Actions */
.inv-actions {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin-top: .4rem;
}

.inv-confirm-btn {
    flex: 1;
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.35);
    transition: all .15s;
}

.inv-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.45);
}

.inv-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ================================================================
   CONFIGURACION MODULE
   ================================================================ */

.config-header {
    padding: .9rem 1.2rem .5rem;
    border-bottom: 1px solid #e5e7eb;
}

.config-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .04em;
}

.config-header-sub {
    font-size: 1rem;
    color: #6b7280;
    margin-top: .15rem;
}

/* ── Cash Movement badges ── */
.mov-badge-in {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: rgba(5,150,105,.12);
    color: #059669;
}

.mov-badge-out {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: rgba(220,38,38,.12);
    color: #dc2626;
}

/* ── Movimientos: paginación ── */
.mov-pag-row {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .75rem .5rem .25rem;
    flex-wrap: wrap;
}

.config-body {
    padding: 1rem 1.2rem;
    overflow-y: auto;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.config-card-title {
    padding: .6rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.config-rows {
    display: flex;
    flex-direction: column;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 280px;
    align-items: center;
    padding: .65rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 1rem;
    transition: background .12s;
}

.config-row:last-child { border-bottom: none; }
.config-row:hover { background: #fafafa; }

.config-row-dirty {
    background: #fffbeb !important;
    border-left: 3px solid #f59e0b;
}

.config-row-label {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.config-key-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.config-key-desc {
    font-size: 1rem;
    color: #9ca3af;
}

.config-row-input {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.config-input {
    width: 100%;
    padding: .42rem .65rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.config-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Toggle switch */
.config-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.config-toggle input { opacity: 0; width: 0; height: 0; }

.config-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s;
}

.config-toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.config-toggle input:checked + .config-toggle-slider {
    background: #1aacb1;
}

.config-toggle input:checked + .config-toggle-slider::before {
    transform: translateX(18px);
}

.config-toggle-label {
    font-size: 1rem;
    color: #6b7280;
    min-width: 70px;
}

/* Actions bar */
.config-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: flex-end;
    padding-top: .25rem;
}

.config-dirty-hint {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1rem;
    color: #92400e;
    margin-right: auto;
}

.config-save-btn {
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.3);
    transition: all .15s;
}

.config-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.4);
}

.config-save-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ================================================================
   CREDITOS MODULE
   ================================================================ */

.creditos-header {
    padding: .9rem 1.2rem .5rem;
    border-bottom: 1px solid #e5e7eb;
}

.creditos-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .04em;
}

.creditos-header-sub {
    font-size: 1rem;
    color: #6b7280;
    margin-top: .15rem;
}

.creditos-body {
    display: flex;
    height: calc(100% - 60px);
    overflow: hidden;
}

/* ── Left panel ── */
.creditos-list-panel {
    width: 380px;
    min-width: 300px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.creditos-list-toolbar {
    padding: .5rem .7rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.creditos-search-wrap {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: .38rem .65rem;
}

.creditos-search-wrap i {
    color: #9ca3af;
    font-size: 1rem;
}

.creditos-search-wrap input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    background: transparent;
    color: #1e293b;
}

.creditos-tabs {
    display: flex;
    gap: .35rem;
}

.ctab {
    flex: 1;
    padding: .28rem 0;
    font-size: 1rem;
    font-weight: 600;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    cursor: pointer;
    color: #6b7280;
    transition: all .15s;
}

.ctab-active {
    background: #1aacb1;
    color: #fff;
    border-color: #1aacb1;
}

.creditos-list {
    flex: 1;
    overflow-y: auto;
}

.creditos-row {
    padding: .65rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s;
}

.creditos-row:hover { background: #f8fafc; }

.creditos-row-active {
    background: #e0f5f5 !important;
    border-left: 3px solid #1aacb1;
}

.creditos-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .2rem;
}

.cr-client {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.cr-badge {
    font-size: 1rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cr-overdue { background: #fee2e2; color: #dc2626; }
.cr-paid    { background: #dcfce7; color: #16a34a; }

.creditos-row-amounts {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-bottom: .25rem;
}

.cr-balance {
    font-size: 1rem;
    color: #1e293b;
}

.cr-original {
    font-size: 1rem;
    color: #9ca3af;
}

.cr-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: .2rem;
}

.cr-progress-fill {
    height: 100%;
    background: #1aacb1;
    border-radius: 2px;
    transition: width .3s;
}

.cr-fill-overdue { background: #dc2626; }

.cr-duedate {
    font-size: 1rem;
    color: #9ca3af;
}

.cr-duedate-overdue { color: #dc2626; font-weight: 600; }

.creditos-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

/* ── Right panel ── */
.creditos-detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cr-empty-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: .6rem;
    text-align: center;
}

.cr-empty-detail i {
    font-size: 2.5rem;
    opacity: .4;
}

.cr-empty-detail p {
    font-size: 1rem;
    line-height: 1.5;
}

.creditos-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.creditos-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.cr-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1rem;
    padding: .25rem .4rem;
    border-radius: 4px;
    transition: color .15s;
}

.cr-cancel-btn:hover { color: #dc2626; }

.creditos-form-body {
    padding: .9rem 1.1rem;
    overflow-y: auto;
    flex: 1;
}

.creditos-section {
    font-size: 1rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .45rem;
}

/* New credit: client search */
.cr-client-search-wrap {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: .42rem .7rem;
    margin-bottom: .3rem;
    transition: border-color .15s;
}

.cr-client-search-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.cr-client-search-wrap i { color: #9ca3af; }

.cr-client-search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: #1e293b;
}

.cr-client-results {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    margin-bottom: .4rem;
}

.cr-client-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem .8rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.cr-client-result-row:last-child { border-bottom: none; }
.cr-client-result-row:hover { background: #f0f9ff; }

.cr-res-name { font-size: 1rem; font-weight: 500; color: #1e293b; }
.cr-res-phone { font-size: 1rem; color: #6b7280; }

.cr-selected-client-card {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #e0f5f5;
    border: 1px solid #b5e8ea;
    border-radius: 7px;
    padding: .45rem .8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #148a8e;
    margin-bottom: .4rem;
}

.cr-clear-client {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #818cf8;
    font-size: 1rem;
    transition: color .15s;
}

.cr-clear-client:hover { color: #dc2626; }

/* Fields */
.cr-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.cr-field {
    display: flex;
    flex-direction: column;
    gap: .28rem;
}

.cr-field label {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cr-field input, .cr-field select {
    padding: .42rem .65rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
}

.cr-field input:focus, .cr-field select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* KPI cards */
.cr-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: .7rem;
}

.cr-kpi {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .55rem .7rem;
    text-align: center;
}

.cr-kpi-highlight {
    background: #e0f5f5;
    border-color: #b5e8ea;
}

.cr-kpi-overdue-hl {
    background: #fff1f2;
    border-color: #fecaca;
}

.cr-kpi-label {
    font-size: 1rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .2rem;
}

.cr-kpi-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.cr-kpi-paid { color: #16a34a; }

/* Due date banner */
.cr-duedate-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    padding: .45rem .8rem;
    font-size: 1rem;
    color: #15803d;
    margin-bottom: .5rem;
}

.cr-duedate-banner-overdue {
    background: #fff1f2;
    border-color: #fecaca;
    color: #dc2626;
}

.cr-notes-box {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: .4rem .7rem;
    font-size: 1rem;
    color: #78350f;
    margin-bottom: .5rem;
}

/* Payment history */
.cr-empty-payments {
    font-size: 1rem;
    color: #9ca3af;
    padding: .4rem 0;
    margin-bottom: .5rem;
}

.cr-payments-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: .8rem;
}

.cr-payment-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    padding: .45rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1rem;
    gap: .5rem;
}

.cr-payment-row:last-child { border-bottom: none; }

.cr-pay-date   { color: #6b7280; }
.cr-pay-method { color: #374151; }
.cr-pay-amount { font-weight: 700; color: #16a34a; text-align: right; }
.cr-pay-notes  { grid-column: 1 / -1; font-size: 1rem; color: #9ca3af; }

/* Payment form */
.cr-payment-form { background: #f8fafc; border-radius: 10px; padding: .8rem; }

.cr-pm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .7rem;
}

.cr-pm-btn {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    color: #374151;
    transition: all .15s;
}

.cr-pm-active {
    border-color: #1aacb1;
    background: #e0f5f5;
    color: #148a8e;
    font-weight: 600;
}

.cr-pay-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: .7rem;
}

.cr-amount-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    transition: border-color .15s;
}

.cr-amount-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.cr-currency {
    padding: 0 .5rem;
    color: #6b7280;
    font-size: 1rem;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.cr-amount-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: .42rem .5rem;
    font-size: 1rem;
    color: #1e293b;
    min-width: 0;
}

.cr-full-btn {
    background: none;
    border: none;
    border-left: 1px solid #e5e7eb;
    padding: 0 .6rem;
    font-size: 1rem;
    cursor: pointer;
    color: #6366f1;
    font-weight: 600;
    align-self: stretch;
    transition: background .15s;
    white-space: nowrap;
}

.cr-full-btn:hover { background: #e0f5f5; }

/* Confirm button (shared by both forms) */
.cr-form-actions {
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    margin-top: .4rem;
}

.cr-confirm-btn {
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26,172,177,.3);
    transition: all .15s;
}

.cr-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26,172,177,.4);
}

.cr-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── PROVEEDORES MODULE ─────────────────────────── */
.prov-header { flex-shrink: 0; }

.prov-header-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #1e293b;
    text-transform: uppercase;
}

.prov-header-sub {
    font-size: 1rem;
    color: #64748b;
    margin-top: .15rem;
}

.prov-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Left panel */
.prov-list-panel {
    width: 320px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
}

.prov-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.prov-search i { color: #94a3b8; font-size: 1rem; }

.prov-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: #1e293b;
}

.prov-list-head {
    display: grid;
    grid-template-columns: 36px 48px 1fr;
    padding: .4rem .8rem;
    font-size: 1rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.prov-list {
    flex: 1;
    overflow-y: auto;
}

.prov-row {
    display: grid;
    grid-template-columns: 36px 48px 1fr;
    align-items: center;
    gap: .5rem;
    padding: .55rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s;
}

.prov-row:hover { background: #f8fafc; }

.prov-row.active {
    background: #e0f5f5;
    border-left: 3px solid #1aacb1;
}

.prov-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.prov-folio {
    font-size: 1rem;
    color: #64748b;
    font-weight: 600;
}

.prov-info { overflow: hidden; }

.prov-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prov-sub {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: 1rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prov-inactive-badge {
    font-size: 1rem;
    font-weight: 700;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    padding: 0 .35rem;
}

.prov-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
}

/* Right panel */
.prov-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #fff;
}

.prov-toolbar {
    display: flex;
    gap: .5rem;
    padding: .7rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.prov-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.prov-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.prov-info-card {
    font-size: 1rem;
    color: #64748b;
}

.prov-form-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.prov-field {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: .5rem;
}

.prov-field label {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    text-align: right;
}

.prov-field input,
.prov-field select {
    padding: .38rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s;
    background: #fff;
}

.prov-field input:focus,
.prov-field select:focus { border-color: #1aacb1; }

.prov-field-textarea {
    align-items: flex-start;
}

.prov-field-textarea label { padding-top: .35rem; }

.prov-field textarea {
    width: 100%;
    min-height: 80px;
    padding: .38rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    color: #1e293b;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.prov-field textarea:focus { border-color: #1aacb1; }

.prov-check-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-left: 210px;
}

.prov-check-row label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1rem;
    color: #475569;
    cursor: pointer;
}

/* Modal */
.prov-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.prov-modal {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    width: 360px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.prov-modal-icon {
    font-size: 2rem;
    color: #ef4444;
    margin-bottom: .75rem;
}

.prov-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .5rem;
}

.prov-modal-body {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.prov-modal-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
}

/* ─── COMPRAS MODULE ─────────────────────────────── */
.compras-header { flex-shrink: 0; }

.compras-header-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #1e293b;
    text-transform: uppercase;
}

.compras-header-sub {
    font-size: 1rem;
    color: #64748b;
    margin-top: .15rem;
}

.compras-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left panel */
.compras-list-panel {
    width: 300px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
}

.compras-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.compras-list {
    flex: 1;
    overflow-y: auto;
}

.compras-row {
    padding: .6rem .8rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .12s;
}

.compras-row:hover { background: #f8fafc; }

.compras-row.active {
    background: #e0f5f5;
    border-left: 3px solid #1aacb1;
}

.compras-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .25rem;
}

.compras-row-supplier {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.compras-row-bot {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: 1rem;
    color: #64748b;
}

.compras-row-total {
    margin-left: auto;
    font-weight: 700;
    color: #1e293b;
}

.compras-row-inv { color: #94a3b8; }

.compras-status-badge {
    font-size: 1rem;
    font-weight: 700;
    border-radius: 4px;
    padding: .15rem .45rem;
    white-space: nowrap;
}

.badge-pending {
    background: #fef9c3;
    color: #92400e;
}

.badge-confirmed {
    background: #dcfce7;
    color: #15803d;
}

.compras-list-footer {
    padding: .6rem .8rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Right panel */
.compras-detail-panel {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.compras-form-wrap {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.compras-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.compras-section-label {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    padding-bottom: .25rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Form grid */
.compras-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem .9rem;
}

.compras-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.compras-field label {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
}

.compras-field input,
.compras-field select,
.compras-field textarea {
    padding: .38rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    font-family: inherit;
}

.compras-field input:focus,
.compras-field select:focus,
.compras-field textarea:focus { border-color: #1aacb1; }

.compras-field-full { grid-column: 1 / -1; }

/* Product search */
.compras-product-search-wrap {
    position: relative;
}

.compras-product-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .7rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.compras-product-search i { color: #94a3b8; font-size: 1rem; }

.compras-product-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: #1e293b;
}

.compras-product-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 100;
    overflow: hidden;
}

.compras-product-option {
    display: flex;
    flex-direction: column;
    padding: .5rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}

.compras-product-option:last-child { border-bottom: none; }
.compras-product-option:hover { background: #f1f5f9; }

.cpd-name { font-size: 1rem; font-weight: 600; color: #1e293b; }
.cpd-meta { font-size: 1rem; color: #64748b; }

/* Lines table */
.compras-lines-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.compras-lines-head {
    display: grid;
    grid-template-columns: 1fr 100px 110px 100px 36px;
    background: #f8fafc;
    padding: .4rem .6rem;
    font-size: 1rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e2e8f0;
}

.compras-line-row {
    display: grid;
    grid-template-columns: 1fr 100px 110px 100px 36px;
    align-items: center;
    padding: .45rem .6rem;
    border-bottom: 1px solid #f1f5f9;
    gap: .4rem;
}

.compras-line-row:last-child { border-bottom: none; }

.compras-line-readonly { background: #fafafa; }

.compras-line-name {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    overflow: hidden;
}

.compras-line-name span:first-child {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compras-line-barcode {
    font-size: 1rem;
    color: #94a3b8;
}

.compras-line-input {
    width: 100%;
    padding: .25rem .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    text-align: right;
    outline: none;
}

.compras-line-input:focus { border-color: #1aacb1; }

.compras-line-val {
    font-size: 1rem;
    color: #1e293b;
    text-align: right;
}

.compras-line-subtotal {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.compras-line-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
    padding: .2rem;
    border-radius: 4px;
    transition: background .1s;
}

.compras-line-remove:hover { background: #fee2e2; }

.compras-lines-empty {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    color: #94a3b8;
    font-size: 1rem;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
}

/* Totals */
.compras-totals {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .6rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-self: flex-end;
    min-width: 280px;
}

.compras-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: #475569;
}

.compras-total-final {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    border-top: 1px solid #e2e8f0;
    padding-top: .35rem;
    margin-top: .1rem;
}

.compras-tax-input-wrap {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: 1rem;
    color: #475569;
}

.compras-tax-input-wrap input {
    width: 90px;
    padding: .2rem .4rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    text-align: right;
    outline: none;
}

.compras-tax-input-wrap input:focus { border-color: #1aacb1; }

/* Actions */
.compras-form-actions {
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    padding-top: .4rem;
}

.compras-save-btn {
    background: #1aacb1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .5rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.compras-save-btn:hover { background: #4338ca; }

.compras-save-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* View mode */
.compras-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compras-view-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem .9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .75rem 1rem;
}

.compras-view-meta > div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.compras-view-meta > div > span:first-child {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
}

.compras-view-meta > div > strong {
    font-size: 1rem;
    color: #1e293b;
}

.compras-view-notes { grid-column: 1 / -1; }

.compras-view-notes span:last-child {
    font-size: 1rem;
    color: #475569;
    white-space: pre-wrap;
}

/* Confirm / confirmed banners */
.compras-confirm-banner {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: 1rem;
    color: #92400e;
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    line-height: 1.5;
}

.compras-confirmed-banner {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: 1rem;
    color: #15803d;
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    line-height: 1.5;
}

.compras-confirm-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.4rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22,163,74,.3);
    transition: all .15s;
}

.compras-confirm-btn:hover {
    background: #15803d;
    box-shadow: 0 6px 16px rgba(22,163,74,.4);
}

.compras-confirm-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── VentasModule: stock error banner ── */
.ventas-stock-error-banner {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    text-align: left;
}

.vseb-title {
    font-weight: 600;
    color: #dc2626;
    margin-bottom: .4rem;
    font-size: 1rem;
}

.vseb-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 1rem;
    color: #991b1b;
    line-height: 1.6;
}

/* ── Acceso denegado ── */
.acceso-denegado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: .75rem;
    color: #94a3b8;
}

.acceso-denegado i {
    font-size: 3rem;
    color: #cbd5e1;
}

.acceso-denegado p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
}

.acceso-denegado span {
    font-size: 1rem;
    color: #94a3b8;
}

/* ── Header store dropdown ── */
.store-dropdown-wrapper {
    position: relative;
}

.store-dropdown-trigger {
    background: none;
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: 8px;
    color: #7dd8db;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: .3rem .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: background .15s, border-color .15s;
}

.store-dropdown-trigger:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.6);
}

.store-dropdown-chevron {
    font-size: 1rem;
    transition: transform .2s;
}

.store-dropdown-chevron.open {
    transform: rotate(180deg);
}

.store-dropdown-menu {
    position: absolute;
    top: calc(100% + .4rem);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    min-width: 200px;
    z-index: 1100;
    overflow: hidden;
    padding: .3rem 0;
}

.store-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: .55rem 1rem;
    background: none;
    border: none;
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}

.store-dropdown-item:hover {
    background: var(--primary-muted);
    color: var(--primary-dark);
}

.store-dropdown-item.active {
    color: var(--primary-dark);
    font-weight: 700;
    background: var(--primary-muted);
}

.store-dropdown-item i {
    color: var(--primary);
    font-size: 1rem;
}

.store-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 1099;
}

/* ── Login store picker ── */
.login-store-picker {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .5rem 0;
}

.login-store-picker-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .25rem;
    text-align: center;
}

.login-store-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: .7rem 1rem;
    background: var(--primary-muted);
    border: 1.5px solid transparent;
    border-radius: 8px;
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.login-store-btn:hover {
    background: #b2ecee;
    border-color: var(--primary);
}

.login-store-btn i {
    color: var(--primary);
}

.login-store-back {
    margin-top: .25rem;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    padding: .3rem;
    transition: color .15s;
}

.login-store-back:hover {
    color: var(--ink);
}

/* ================================================================
   OPERADORES MODULE
   ================================================================ */

.header {
    padding: 1.25rem 1.5rem .75rem;
}
.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--pos-primary);
    text-transform: uppercase;
}
.header-sub {
    font-size: 1rem;
    color: var(--pos-text-muted);
    margin-top: .2rem;
}

/* toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.5rem;
    flex-wrap: wrap;
}
.search-bar {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    padding: .35rem .7rem;
    flex: 1;
    min-width: 200px;
}
.search-bar i { color: var(--pos-text-muted); font-size: 1rem; }
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    width: 100%;
    color: var(--pos-text);
}

/* list container */
.list-container {
    padding: .5rem 1rem 1rem;
    overflow-x: auto;
    margin: 0 1.5rem 1.5rem;
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-surface);
}

/* ─── PAGINATION BAR ─────────────────────────────── */
.pg-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .25rem;
    padding: .6rem 1.5rem .9rem;
    flex-wrap: wrap;
}

.pg-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 .5rem;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    background: var(--pos-surface);
    color: var(--pos-text);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s, color .12s;
    user-select: none;
}

.pg-btn:hover:not(:disabled) {
    background: var(--pos-primary-muted);
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

.pg-btn:disabled {
    opacity: .4;
    cursor: default;
}

.pg-btn.pg-active {
    background: var(--pos-primary);
    border-color: var(--pos-primary);
    color: #fff;
    font-weight: 700;
}

.pg-ellipsis {
    min-width: 22px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pos-text-muted);
    font-size: 1rem;
    user-select: none;
}

/* table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}
.data-table th {
    text-align: left;
    padding: .6rem .85rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--pos-text-muted);
    background: var(--pos-bg);
    border-bottom: 2px solid var(--pos-border);
}
.data-table td {
    padding: .7rem .85rem;
    border-bottom: 1px solid color-mix(in srgb, var(--pos-border) 50%, transparent);
    vertical-align: middle;
    color: var(--pos-text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--pos-bg); }
.row-inactive td { opacity: .55; }

/* name cell */
.name-cell {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 500;
}
.name-stack {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.row-email { color: var(--pos-text-muted); font-size: 1rem; }

/* role badge */
.role-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
}
.role-admin      { background: #fef3c7; color: #92400e; }
.role-supervisor { background: #dbeafe; color: #1e40af; }
.role-cashier    { background: #dcfce7; color: #166534; }

/* status badge */
.status-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
}
.status-active   { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }

/* actions cell */
.actions-cell {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}
.abtn-sm {
    padding: .25rem .6rem !important;
    font-size: 1rem !important;
}

/* ─── ACTION MENU (···) ─────────────────────────────────── */
.menu-wrap { position: relative; display: inline-flex; }
.menu-btn {
    background: transparent;
    border: none;
    color: var(--pos-text-muted);
    padding: .3rem .55rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background .15s, color .15s;
}
.menu-btn:hover { background: #f1f5f9; color: var(--pos-text); }
.menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    min-width: 150px;
    z-index: 50;
    overflow: hidden;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .95rem;
    font-size: 1rem;
    color: var(--pos-text);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background .1s;
}
.menu-item:hover { background: #f8fafc; }
.menu-item.danger { color: var(--pos-danger); }
.menu-item.danger:hover { background: #fef2f2; }
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
}

/* ─── ENTITY LINK ────────────────────────────────────────── */
.entity-link {
    color: var(--pos-primary);
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    font-size: 1rem;
}
.entity-link:hover { opacity: .75; text-decoration: underline; }
.entity-sub {
    font-size: 1rem;
    color: var(--pos-text-muted);
    margin-top: .05rem;
}

/* modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.dialog {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
}
.dialog-header {
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, var(--pos-primary), var(--pos-primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.dialog-body {
    padding: 1.25rem 1.5rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    font-size: 1rem;
}
.field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.field label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.field input,
.field select,
.field textarea {
    padding: .45rem .7rem;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--pos-text);
    background: var(--pos-bg);
    outline: none;
    transition: border-color .15s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--primary); }
.field input:disabled { background: var(--pos-bg); color: var(--pos-text-muted); cursor: not-allowed; opacity: .6; }
.field textarea { resize: vertical; }
.field-hint {
    font-size: 1rem;
    font-weight: 400;
    color: #94a3b8;
    margin-left: .3rem;
}
.input-invalid { border-color: #ef4444 !important; }

/* ─── Imagen de producto (grilla) ────────────────── */
.prod-thumb {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--pos-bg);
}
.prod-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.prod-thumb .fa-stack {
    width: 100%;
    height: 100%;
    line-height: 38px;
    font-size: .8rem;
    color: var(--pos-text-muted);
}
.prod-thumb .fa-stack .fa-stack-1x {
    width: 100%;
    height: 100%;
    line-height: inherit;
}

/* ─── Imagen de producto (modal nuevo/editar) ────── */
.prod-img-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}
.prod-img-preview {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    border: 1px dashed var(--pos-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%, transparent 75%, #e2e8f0 75%),
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
}
.prod-img-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.prod-img-preview i {
    font-size: 1.6rem;
    color: var(--pos-text-muted);
}
.prod-img-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.prod-img-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    align-self: flex-start;
    font-size: .8rem;
    color: var(--pos-text-muted);
    background: var(--pos-bg);
    border: 1px solid var(--pos-border);
    border-radius: 999px;
    padding: .25rem .6rem;
}

.dialog-error {
    margin: .5rem 1.5rem 0;
    background: color-mix(in srgb, var(--pos-danger) 10%, white);
    color: var(--pos-danger);
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: 1rem 1.5rem 1.25rem;
}

/* ================================================================
   SUCURSALES MODULE
   ================================================================ */

.suc-header { padding: 1.25rem 1.5rem .75rem; border-bottom: 1px solid #e2e8f0; }
.suc-header-title {
    font-size: 1rem; font-weight: 700; letter-spacing: .1em;
    color: var(--primary); text-transform: uppercase;
}
.suc-header-sub { font-size: 1rem; color: #64748b; margin-top: .2rem; }

.suc-toolbar {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1.5rem; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap;
}
.suc-search {
    display: flex; align-items: center; gap: .4rem;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: .35rem .7rem; flex: 1; min-width: 200px;
}
.suc-search i { color: #94a3b8; font-size: 1rem; }
.suc-search input {
    border: none; background: transparent; outline: none;
    font-size: 1rem; width: 100%; color: var(--ink);
}

.suc-list-container { padding: 1rem 1.5rem; overflow-x: auto; }

.suc-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.suc-table th {
    text-align: left; padding: .55rem .75rem;
    font-size: 1rem; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: #64748b;
    background: #f8fafc; border-bottom: 2px solid #e2e8f0;
}
.suc-table td {
    padding: .65rem .75rem; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle; color: var(--ink);
}
.suc-table tr:last-child td { border-bottom: none; }
.suc-table tr:hover td { background: #f8fafc; }
.suc-row-inactive td { opacity: .55; }
.suc-muted { color: #64748b; font-size: 1rem; }

.suc-name-cell { display: flex; align-items: center; gap: .6rem; }
.suc-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.suc-name { font-weight: 500; }
.suc-current-badge {
    display: inline-block; font-size: 1rem; font-weight: 600;
    background: #dbeafe; color: #1e40af;
    border-radius: 999px; padding: .1rem .45rem; margin-top: .15rem;
}

.suc-status-badge {
    display: inline-block; padding: .2rem .55rem;
    border-radius: 999px; font-size: 1rem; font-weight: 600;
}
.suc-status-active   { background: #dcfce7; color: #166534; }
.suc-status-inactive { background: #fee2e2; color: #991b1b; }

.suc-actions-cell { display: flex; gap: .4rem; flex-wrap: wrap; }

/* modal */
.suc-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.suc-modal {
    background: #fff; border-radius: 10px; width: 100%; max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden;
}
.suc-modal-header {
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; gap: .6rem;
}
.suc-modal-body {
    padding: 1.25rem 1.5rem .5rem;
    display: flex; flex-direction: column; gap: .9rem;
}
.suc-field { display: flex; flex-direction: column; gap: .3rem; }
.suc-field label { font-size: 1rem; font-weight: 600; color: #475569; }
.suc-field input {
    padding: .45rem .7rem; border: 1px solid #cbd5e1; border-radius: 6px;
    font-size: 1rem; color: var(--ink); outline: none; transition: border-color .15s;
}
.suc-field input:focus { border-color: var(--primary); }
.suc-field-row { display: flex; gap: .75rem; }
.suc-field-row .suc-field { flex: 1; }

.suc-field-check { border-top: 1px solid #e5e7eb; padding-top: .75rem; margin-top: .25rem; }
.suc-check-label { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: #374151; cursor: pointer; font-size: 1rem; }
.suc-check-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.suc-check-label-disabled { opacity: .5; cursor: not-allowed; }
.suc-check-label-disabled input[type="checkbox"] { cursor: not-allowed; }
.suc-check-warn { margin: .4rem 0 0; font-size: 1rem; color: #b45309; display: flex; align-items: center; gap: .35rem; }

.suc-modal-error {
    margin: .5rem 1.5rem 0; background: #fee2e2; color: #991b1b;
    border-radius: 6px; padding: .5rem .75rem; font-size: 1rem;
    display: flex; align-items: center; gap: .4rem;
}
.suc-modal-actions {
    display: flex; justify-content: flex-end;
    gap: .6rem; padding: 1rem 1.5rem 1.25rem;
}

/* ─── REPORTES MODULE ────────────────────────────────── */
.rep-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
    flex-shrink: 0;
}
.rep-filter-group {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.rep-filter-group label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.rep-date-input {
    padding: .38rem .6rem;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--pos-text);
    background: var(--pos-bg);
    outline: none;
}
.rep-date-input:focus { border-color: var(--primary); }
.rep-filter-shortcuts {
    display: flex;
    gap: .35rem;
    align-items: flex-end;
    padding-bottom: .02rem;
}
.rep-shortcut {
    padding: .35rem .65rem;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    background: var(--pos-bg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--pos-text-muted);
    cursor: pointer;
    transition: all .15s;
}
.rep-shortcut:hover { background: var(--primary-muted); border-color: var(--primary); color: var(--primary-dark); }

.rep-tabs {
    display: flex;
    gap: 0;
    background: var(--pos-bg);
    border-bottom: 1px solid var(--pos-border);
    flex-shrink: 0;
    padding: .5rem .75rem 0;
}
.rep-tab {
    padding: .5rem 1.1rem;
    border: none;
    border-radius: 7px 7px 0 0;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--pos-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    border-bottom: 2px solid transparent;
    transition: color .15s, background .15s;
}
.rep-tab:hover { color: var(--primary); background: rgba(26,172,177,.07); }
.rep-tab.active { color: var(--primary-dark); background: var(--pos-surface); border-bottom-color: var(--primary); }

.rep-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.25rem;
}
.rep-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 700px) { .rep-kpi-row { grid-template-columns: 1fr; } }
.rep-kpi {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.rep-kpi-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.rep-kpi-label { font-size: 1rem; color: var(--pos-text-muted); font-weight: 500; }
.rep-kpi-value { font-size: 1.3rem; font-weight: 800; color: var(--pos-text); margin-top: .1rem; }

.rep-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pos-text-muted);
    margin-bottom: .75rem;
}
.rep-empty {
    text-align: center;
    color: var(--pos-text-muted);
    padding: 2.5rem;
    font-size: 1rem;
}
.rep-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--pos-surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--pos-border);
    font-size: 1rem;
}
.rep-table thead tr { background: var(--pos-bg); }
.rep-table th {
    padding: .65rem .9rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    border-bottom: 1px solid var(--pos-border);
}
.rep-table td {
    padding: .6rem .9rem;
    color: var(--pos-text);
    border-bottom: 1px solid var(--pos-border);
}
.rep-table tbody tr:last-child td { border-bottom: none; }
.rep-table tbody tr:hover { background: var(--pos-primary-muted); }
.rep-num { text-align: right !important; }
.rep-bold { font-weight: 700; }

.rep-pct-bar-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: flex-end;
}
.rep-pct-bar {
    height: 6px;
    border-radius: 3px;
    background: #6366f1;
    min-width: 2px;
    transition: width .3s;
}
.rep-pct-bar-green  { background: #22c55e; }
.rep-pct-bar-purple { background: #a855f7; }

.rep-rank { width: 40px; }
.rep-medal { font-size: 1.1rem; }
.rep-medal.gold   { color: #f59e0b; }
.rep-medal.silver { color: var(--pos-text-muted); }
.rep-medal.bronze { color: #b45309; }
.rep-rank-num { font-size: 1rem; color: var(--pos-text-muted); font-weight: 600; padding-left: .25rem; }

.rep-op-name {
    display: flex; align-items: center; gap: .6rem;
}
.rep-op-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ─── BILLING ALERT BANNER ──────────────────────────── */
.billing-alert {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .45rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    flex-shrink: 0;
    z-index: 9;
}
.billing-alert-warning {
    background: rgba(245,158,11,.12);
    color: var(--pos-warning);
    border-bottom: 1px solid rgba(245,158,11,.25);
}
.billing-alert-danger {
    background: rgba(239,68,68,.12);
    color: var(--pos-danger);
    border-bottom: 1px solid rgba(239,68,68,.25);
}
.billing-alert .fa-exclamation-triangle {
    flex-shrink: 0;
    font-size: 1rem;
}
.billing-alert-btn {
    margin-left: auto;
    padding: .25rem .75rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(0,0,0,.1);
    color: inherit;
    transition: background .15s;
}
.billing-alert-btn:hover {
    background: rgba(0,0,0,.2);
    color: inherit;
}

/* ─── PÁGINA /PAGAR ──────────────────────────────────── */
.pagar-price-box {
    text-align: center;
    padding: 1rem 0 .5rem;
}
.pagar-price-label {
    font-size: 1rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.pagar-price-amount {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary-dark, #148a8e);
    line-height: 1.1;
    margin: .15rem 0;
}
.pagar-price-currency {
    font-size: 1rem;
    color: #9ca3af;
}
.pagar-divider {
    border: none;
    border-top: 1px dashed #e5e7eb;
    margin: 1rem 0;
}
.pagar-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .6rem;
}
.pagar-data-grid {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.pagar-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: 1rem;
}
.pagar-data-label {
    color: #6b7280;
    font-weight: 500;
}
.pagar-data-value {
    font-weight: 600;
    color: #111827;
}
.pagar-highlight {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--primary-dark, #148a8e);
    letter-spacing: .04em;
}
.pagar-hint {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: .25rem;
}
.pagar-wsp-btn {
    font-size: 1rem;
    font-weight: 600;
    padding: .65rem 1.25rem;
}

/* ─── TICKET DIGITAL MODAL (VentasModule) ───────────── */
.tr-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
}
.tr-modal {
    background: #fff;
    width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 6px;
    padding: 1.25rem 1.5rem 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: .80rem;
    color: #111;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.tr-store {
    text-align: center;
    font-size: .80rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: .2rem;
}
.tr-meta {
    display: flex;
    justify-content: space-between;
    font-size: .80rem;
    color: #555;
    margin-bottom: .2rem;
}
.tr-folio {
    font-weight: 700;
    color: var(--primary-dark);
}
.tr-client {
    font-size: .80rem;
    color: #444;
    margin-bottom: .25rem;
}
.tr-divider {
    border-top: 1px dashed #999;
    margin: .5rem 0;
}
.tr-items {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: .80rem;
}
.tr-items th {
    border-bottom: 1px solid #ccc;
    padding: .15rem .25rem;
    text-align: left;
    font-weight: 600;
}
.tr-items td {
    padding: .15rem .25rem;
    vertical-align: top;
}
.tr-items th:first-child,
.tr-items td:first-child {
    width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tr-num {
    text-align: right !important;
    white-space: nowrap;
    width: 19%;
}
.tr-totals {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.tr-total-row {
    display: flex;
    justify-content: space-between;
    font-size: .80rem;
}
.tr-total-main {
    font-size: .80rem;
    font-weight: 700;
    border-top: 1px solid #111;
    padding-top: .2rem;
    margin-top: .1rem;
}
.tr-credit-badge {
    text-align: center;
    margin-top: .35rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 4px;
    padding: .25rem .5rem;
    font-size: .80rem;
    font-weight: 600;
}
.tr-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    margin: .5rem 0;
}
.tr-qr img {
    width: 100%;
    height: auto;
    display: block;
}
.tr-footer-text {
    text-align: center;
    font-size: .80rem;
    color: #555;
    margin-top: .1rem;
}
.tr-actions {
    display: flex;
    gap: .6rem;
    justify-content: center;
    margin-top: 1rem;
}

@media print {
    /* 1. Fondo blanco absoluto: evita que el tema oscuro gaste tinta. */
    html, body { background: white !important; background-color: white !important; }
    .pos-root  { background: white !important; background-color: white !important;
                 overflow: visible !important; }

    /* 2. Bootstrap d-none oculta el wrapper de escritorio en print (sin viewport).
          Forzar display para que el modal esté en el árbol de render. */
    .d-md-block { display: block !important; }

    /* 3. Ocultar todo excepto el ticket. */
    body * { visibility: hidden; }
    .tr-overlay, .tr-modal, .tr-modal * { visibility: visible; }

    /* 4. Overlay fijo arriba-izquierda, alineación flex-start para que el ticket
          arranque desde la esquina superior izquierda (no centrado ni abajo). */
    .tr-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        background: transparent !important;
        background-color: transparent !important;
    }

    /* 5. Modal: 72 mm, sin decoración, fondo blanco, texto negro. */
    .tr-modal {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 72mm !important;
        max-height: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 4mm !important;
        overflow: visible !important;
        background: white !important;
        background-color: white !important;
        color: black !important;
        margin: 0 !important;
    }

    .no-print { display: none !important; }
}

/* ─── FONDO COMPARTIDO (Login / Crear cuenta) ────────── */
.lp-page-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f4c5c 100%) !important;
    position: relative;
}
.lp-page-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 60%, rgba(26,172,177,.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 80% 30%, rgba(99,102,241,.12) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── LANDING PAGE ───────────────────────────────────── */

/* Hero */
.lp-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f4c5c 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    position: relative;
    overflow: hidden;
}
.lp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 20% 60%, rgba(26,172,177,.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 80% 30%, rgba(99,102,241,.12) 0%, transparent 70%);
    pointer-events: none;
}
.lp-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(26,172,177,.15);
    border: 1px solid rgba(26,172,177,.35);
    color: #5eead4;
    border-radius: 999px;
    padding: .3rem .9rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 1.5rem;
}
.lp-hero-title {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.12;
    margin-bottom: 1.2rem;
    position: relative;
}
.lp-hero-title span {
    background: linear-gradient(90deg, #1aacb1, #5eead4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.lp-hero-sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}
.lp-hero-actions {
    display: flex;
    gap: .9rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}
.lp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(135deg, #1aacb1, #148a8e);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .75rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(26,172,177,.4);
    transition: transform .15s, box-shadow .15s;
}
.lp-btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26,172,177,.55);
}
.lp-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.07);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    padding: .75rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, transform .15s;
}
.lp-btn-ghost:hover {
    color: #fff;
    background: rgba(255,255,255,.13);
    transform: translateY(-2px);
}
.lp-hero-stats {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3.5rem;
    position: relative;
}
.lp-stat {
    text-align: center;
}
.lp-stat-num {
    font-size: 1.9rem;
    font-weight: 800;
    color: #1aacb1;
    line-height: 1;
}
.lp-stat-label {
    font-size: 1rem;
    color: #64748b;
    margin-top: .25rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Features */
.lp-section {
    padding: 5rem 1.5rem;
}
.lp-section-dark {
    background: #f8fafc;
}
.lp-section-title {
    text-align: center;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .6rem;
}
.lp-section-sub {
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}
.lp-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.lp-feature-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    transition: box-shadow .2s, transform .2s;
}
.lp-feature-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.09);
    transform: translateY(-3px);
}
.lp-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}
.lp-feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .4rem;
}
.lp-feature-desc {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Why */
.lp-why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}
.lp-why-item {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}
.lp-why-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #d1fae5;
    color: #065f46;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.lp-why-text strong {
    display: block;
    font-size: 1rem;
    color: #1e293b;
    font-weight: 700;
}
.lp-why-text span {
    font-size: 1rem;
    color: #64748b;
}

/* Pricing */
.lp-pricing-card {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    overflow: hidden;
}
.lp-pricing-header {
    background: linear-gradient(135deg, #1aacb1, #148a8e);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    color: #fff;
}
.lp-pricing-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .85;
    margin-bottom: .5rem;
}
.lp-pricing-amount {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}
.lp-pricing-period {
    font-size: 1rem;
    opacity: .8;
    margin-top: .3rem;
}
.lp-pricing-body {
    padding: 1.75rem 2rem 2rem;
}
.lp-pricing-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem 0;
    font-size: 1rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}
.lp-pricing-item:last-child { border-bottom: none; }
.lp-pricing-item i { color: #1aacb1; font-size: 1rem; }
.lp-trial-badge {
    text-align: center;
    background: #ecfdf5;
    color: #065f46;
    border-radius: 8px;
    padding: .55rem .75rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.25rem;
}

/* CTA bottom */
.lp-cta {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 5rem 1.5rem;
    text-align: center;
}
.lp-cta-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: .75rem;
}
.lp-cta-sub {
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .lp-hero-stats { gap: 1.5rem; }
    .lp-pricing-amount { font-size: 2.4rem; }
}

/* ─── FOOTER ─────────────────────────────────────────── */
.lp-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 3.5rem 1.5rem 0;
    font-size: 1rem;
}
.lp-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 3rem;
}
@media (max-width: 768px) {
    .lp-footer-grid { grid-template-columns: 1fr 1fr; }
    .lp-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .lp-footer-grid { grid-template-columns: 1fr; }
}
.lp-footer-logo {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .85rem;
    text-decoration: none;
}
.lp-footer-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1aacb1, #148a8e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}
.lp-footer-logo-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -.01em;
}
.lp-footer-tagline {
    color: #64748b;
    line-height: 1.65;
    max-width: 280px;
    margin-bottom: 1.25rem;
}
.lp-footer-social {
    display: flex;
    gap: .6rem;
}
.lp-footer-social-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    font-size: 1rem;
    transition: background .15s, color .15s;
}
.lp-footer-social-btn:hover {
    background: rgba(26,172,177,.2);
    color: #5eead4;
    border-color: rgba(26,172,177,.3);
}
.lp-footer-col-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 1rem;
}
.lp-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.lp-footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color .15s;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.lp-footer-links a:hover { color: #5eead4; }
.lp-footer-links a i { font-size: 1rem; color: #475569; }
.lp-footer-contact-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .7rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color .15s;
}
.lp-footer-contact-item:hover { color: #5eead4; }
.lp-footer-contact-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.lp-footer-bar {
    border-top: 1px solid rgba(255,255,255,.07);
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: 1rem;
    color: #475569;
}
.lp-footer-bar a {
    color: #475569;
    text-decoration: none;
    transition: color .15s;
}

/* ══════════════════════════════════════════════════
   DEVOLUCIONES MODULE  (dev-*)
══════════════════════════════════════════════════ */
.dev-layout {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 160px);
    overflow: hidden;
}

/* ── Left panel (history) ── */
.dev-left {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    overflow-y: auto;
    gap: .5rem;
}
.dev-left-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .25rem;
}
.dev-history-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.dev-history-card {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: .6rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.dev-hcard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dev-ticket-tag {
    font-size: 1rem;
    font-weight: 700;
    background: rgba(99,102,241,.12);
    color: #6366f1;
    padding: .12rem .4rem;
    border-radius: 4px;
}
.dev-hcard-date {
    font-size: 1rem;
    color: var(--text-muted);
}
.dev-hcard-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dev-hcard-items {
    font-size: 1rem;
    color: var(--text-secondary);
}
.dev-hcard-total {
    font-size: 1rem;
    font-weight: 700;
    color: #ef4444;
}
.dev-hcard-reason {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Right panel (form) ── */
.dev-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    overflow-y: auto;
    gap: 1rem;
}
.dev-search-header {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.dev-search-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.dev-search-bar {
    display: flex;
    gap: .5rem;
}
.dev-ticket-input {
    flex: 1;
}
.dev-search-error {
    color: #ef4444;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* ── Found sale info ── */
.dev-sale-info {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: .75rem 1rem;
    display: flex;
    gap: 1.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* ── Items selection ── */
.dev-items-header {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}
.dev-items-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    overflow-y: auto;
    max-height: 300px;
}
.dev-item-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    transition: border-color .15s, background .15s;
}
.dev-item-row.selected {
    border-color: #6366f1;
    background: rgba(99,102,241,.05);
}
.dev-item-check {
    width: 1rem;
    height: 1rem;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}
.dev-item-name {
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
}
.dev-item-qty-wrap {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.dev-item-qty-input {
    width: 64px;
    text-align: center;
}
.dev-item-max {
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.dev-item-subtotal {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 72px;
    text-align: right;
}

/* ── Reason & confirm ── */
.dev-reason-row {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.dev-reason-row label {
    font-size: 1rem;
    color: var(--text-secondary);
}
.dev-reason-input {
    width: 100%;
}
.dev-confirm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--sidebar-bg);
    border-radius: 8px;
    margin-top: auto;
}
.dev-return-total {
    font-size: 1rem;
    color: var(--text-primary);
}
.dev-return-count {
    font-size: 1rem;
    color: var(--text-muted);
    margin-left: .4rem;
}
.lp-footer-bar a:hover { color: #94a3b8; }

/* ─── REPORTES — TICKETS TAB ─────────────────────── */
.rep-tickets-table tbody tr { cursor: pointer; }
.rep-ticket-row:hover { background: #f0f4ff !important; }

.rep-ticket-num {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99,102,241,.08);
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}

.rep-credit-badge {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: .4rem;
}

/* ── Promo modal ── */
.promo-modal {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 14px;
    width: 720px;
    max-width: 96vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.30);
}

.promo-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--pos-border);
    background: var(--pos-surface);
}

.promo-search-bar i {
    color: var(--pos-text-muted);
    font-size: .95rem;
    flex-shrink: 0;
}

.promo-search-bar input {
    flex: 1;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .9rem;
    background: var(--pos-bg);
    color: var(--pos-text);
    outline: none;
    transition: border-color .15s;
}

.promo-search-bar input:focus {
    border-color: var(--pos-primary);
}

.promo-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: var(--pos-surface);
}

.promo-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--pos-text-muted);
    font-size: 1rem;
}

.promo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.promo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    padding: 14px 16px;
    background: var(--pos-bg);
    transition: border-color .15s, box-shadow .15s;
}

.promo-row:hover {
    border-color: var(--pos-primary);
    box-shadow: 0 3px 10px var(--pos-primary-muted);
}

.promo-row-icon {
    font-size: 1.3rem;
    color: var(--pos-primary);
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.promo-row-info {
    flex: 1;
    min-width: 0;
}

.promo-row-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--pos-text);
}

.promo-row-desc {
    font-size: 1rem;
    color: var(--pos-text-muted);
    margin-top: 1px;
}

.promo-row-components {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.promo-row-components span {
    display: inline-block;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 1rem;
    color: var(--pos-text-muted);
}

.promo-row-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.promo-row-price {
    background: var(--pos-primary-light);
    color: var(--pos-primary-dark);
    font-weight: 800;
    font-size: 1rem;
    border-radius: 6px;
    padding: 3px 12px;
    white-space: nowrap;
}

.promo-row-btn {
    background: var(--pos-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.promo-row-btn:hover { background: var(--pos-primary-dark); }

/* ── Combo rows in cart ── */
.combo-row td { background: var(--pos-primary-muted) !important; }
.combo-row:hover td { background: var(--pos-primary-light) !important; }

.combo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #7c3aed;
    color: #fff;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.combo-components-line {
    font-size: 1rem;
    color: #7c3aed;
    margin-top: 3px;
    opacity: .85;
    line-height: 1.5;
}

/* ── PromocionesModule ── */
.promo-add-component-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .75rem;
}

.promo-comp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 100;
    overflow: hidden;
}

.promo-comp-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--pos-border);
    transition: background .12s;
}

.promo-comp-option:last-child { border-bottom: none; }
.promo-comp-option:hover { background: var(--pos-primary-muted); }

.promo-comp-name {
    font-size: 1rem;
    color: var(--ink);
    font-weight: 500;
}

.promo-comp-price {
    font-size: 1rem;
    color: var(--pos-text-muted);
    font-family: monospace;
}

.promo-comp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: .5rem;
}

.promo-comp-table th {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--pos-text-muted);
    padding: .35rem .5rem;
    border-bottom: 2px solid var(--pos-border);
    text-align: left;
}

.promo-comp-table td {
    padding: .4rem .5rem;
    border-bottom: 1px solid var(--pos-border);
    font-size: 1rem;
    color: var(--ink);
}

.promo-comp-qty-col {
    width: 90px;
    text-align: right;
}

.promo-no-components {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--pos-text-muted);
    font-size: 1rem;
    padding: .75rem 0;
    border: 2px dashed var(--pos-border);
    border-radius: 8px;
    justify-content: center;
    margin-bottom: .75rem;
}

/* ── Nav dropdown groups ─────────────────────────── */
.nav-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.nav-group-trigger {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .9rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, background .15s, border-color .15s;
    user-select: none;
}

.nav-group-trigger:hover,
.nav-group.open .nav-group-trigger {
    color: #fff;
    background: rgba(255,255,255,.1);
    border-bottom-color: var(--pos-primary-light);
}

.nav-group-trigger.has-active {
    color: #fff;
    background: rgba(255,255,255,.15);
    border-bottom-color: #fff;
    font-weight: 700;
}

.nav-chevron {
    font-size: 1rem;
    margin-left: 1px;
    transition: transform .2s ease;
}

.nav-group.open .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: fixed;
    min-width: 196px;
    background: var(--pos-primary-dark);
    border-radius: 0 4px 8px 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,.35);
    z-index: 1050;
    padding: 5px 0;
    animation: nav-drop-in .13s ease;
}

@keyframes nav-drop-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,.78);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background .12s, color .12s, border-color .12s;
}

.nav-dropdown-item:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-left-color: var(--pos-primary-light);
}

.nav-dropdown-item.active {
    background: rgba(255,255,255,.15);
    border-left-color: var(--pos-primary-light);
    color: #fff;
    font-weight: 700;
}

.nav-drop-icon {
    width: 15px;
    text-align: center;
    font-size: 1rem;
    opacity: .72;
    flex-shrink: 0;
}

.nav-dropdown-item:hover .nav-drop-icon,
.nav-dropdown-item.active .nav-drop-icon {
    opacity: 1;
}

.nav-drop-kbd {
    margin-left: auto;
    font-size: 1rem;
    font-family: monospace;
    background: rgba(255,255,255,.18);
    border-radius: 3px;
    padding: 1px 5px;
    color: rgba(255,255,255,.85);
}

.nav-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
}

/* ══════════════════════════════════════════════
   CLIENTES MODULE — cli-*
══════════════════════════════════════════════ */

/* Stats row */
.stats-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem 0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.stat-card {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    padding: .75rem 1.25rem;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.stat-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pos-text);
    line-height: 1;
}
.stat-card.c-primary .stat-value { color: var(--pos-primary); }
.stat-card.c-success .stat-value { color: var(--pos-success); }
.stat-card.c-warning .stat-value { color: var(--pos-warning); }
.stat-card.c-danger  .stat-value { color: var(--pos-danger); }

/* Credit badge */
.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: 1rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border-radius: 99px;
}
.credit-yes {
    background: color-mix(in srgb, var(--pos-success) 14%, transparent);
    color: var(--pos-success-dark);
    border: 1px solid color-mix(in srgb, var(--pos-success) 30%, transparent);
}
.credit-no {
    background: color-mix(in srgb, var(--pos-text-muted) 10%, transparent);
    color: var(--pos-text-muted);
    border: 1px solid color-mix(in srgb, var(--pos-text-muted) 25%, transparent);
}

/* Panel container */
.panel {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--pos-border);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pos-text);
}
.panel-close {
    background: none;
    border: none;
    color: var(--pos-text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
    transition: color .15s;
}
.panel-close:hover { color: var(--pos-danger); }

.panel-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Two-column grid inside panel */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem 1rem;
}
@media (max-width: 520px) {
    .panel-grid { grid-template-columns: 1fr; }
}

/* Section divider label */
.panel-section {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--pos-text-muted);
    padding-top: .5rem;
    border-top: 1px solid var(--pos-border);
}

/* Check label */
.check-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: .5rem;
    font-size: 1rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--pos-text) !important;
    cursor: pointer;
    margin-top: .75rem;
}
.check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--pos-primary);
    cursor: pointer;
}
.check-label-disabled { opacity: .5; cursor: not-allowed; }
.check-label-disabled input[type="checkbox"] { cursor: not-allowed; }
.check-warn { margin: .4rem 0 0; font-size: 1rem; color: #b45309; display: flex; align-items: center; gap: .35rem; }

/* Current store badge (Sucursales) */
.current-badge {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary-muted);
    color: var(--primary);
    border-radius: 999px;
    padding: .1rem .45rem;
    margin-top: .15rem;
}

/* Read-only balance display */
.readonly-val {
    display: inline-block;
    padding: .4rem .75rem;
    background: var(--pos-bg);
    border: 1px solid var(--pos-border);
    border-radius: 7px;
    font-size: 1rem;
    color: var(--pos-text-muted);
}
.readonly-val.balance-owed { color: var(--pos-danger); border-color: color-mix(in srgb, var(--pos-danger) 35%, transparent); }

/* Hint text */
.hint {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Panel footer */
.panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--pos-border);
}

/* Required star */
.required-star { color: var(--pos-danger); margin-left: .1rem; }


/* Toolbar left column (search + chips stacked) */
.toolbar-left {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    flex: 1;
    min-width: 0;
}

/* Filter chips row */
.filter-chips {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-left: 1.5rem !important;
    margin-bottom: .75rem;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .32rem .85rem;
    border-radius: 99px;
    border: 1px solid var(--pos-border);
    background: var(--pos-bg);
    color: var(--pos-text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.filter-chip:hover {
    border-color: var(--pos-primary);
    background: color-mix(in srgb, var(--pos-primary) 8%, transparent);
    color: var(--pos-primary);
}
.filter-chip.active {
    background: color-mix(in srgb, var(--pos-danger) 10%, transparent);
    border-color: color-mix(in srgb, var(--pos-danger) 40%, transparent);
    color: var(--pos-danger);
}

/* Full-width field */
.field-full {
    grid-column: 1 / -1;
}

/* Debt cell */
.debt-cell {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 4px;
}
.debt-owed {
    background: color-mix(in srgb, var(--pos-danger) 10%, transparent);
    color: var(--pos-danger);
}
.debt-clear {
    color: var(--pos-text-muted);
}

/* Balance owed */
.balance-owed {
    color: var(--pos-danger);
}

/* Inventory date range filter */
.inv-date-separator {
    width: 1px;
    background: #e5e7eb;
    margin: 0 .25rem;
    align-self: stretch;
}
.inv-date-label {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    align-self: center;
    white-space: nowrap;
}
.inv-date-input {
    padding: .26rem .5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}
.inv-date-input:focus {
    border-color: var(--primary);
    background: #fff;
}

/* ══════════════════════════════════════════════
   INPUTS
══════════════════════════════════════════════ */

input[type="text"] {
    font-size: 1rem;
}

/* Debt cell in table — renamed to .debt-cell / .debt-owed / .debt-clear (see above) */

/* ══════════════════════════════════════════════
   BLOC DE NOTAS
══════════════════════════════════════════════ */

.notepad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 11rem);
    box-sizing: border-box;
}

.notepad-quadrant {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pos-border, #e5e7eb);
    border-radius: var(--pos-radius, .5rem);
    background: var(--pos-surface, #fff);
    overflow: hidden;
}

.notepad-qheader {
    padding: .5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--pos-border, #e5e7eb);
    background: var(--pos-surface-2, #f9fafb);
    color: var(--pos-text-muted, #6b7280);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.notepad-textarea {
    flex: 1;
    resize: none;
    border: none;
    outline: none;
    padding: .75rem 1rem;
    background: var(--pos-surface, #fff);
    color: var(--pos-text, #111827);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.notepad-qfooter {
    padding: .5rem 1rem;
    border-top: 1px solid var(--pos-border, #e5e7eb);
    background: var(--pos-surface-2, #f9fafb);
    display: flex;
    justify-content: flex-end;
}

/* nav standalone item — Bloc de notas */
button.nav-notepad {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
button.nav-notepad.active {
    background: var(--pos-primary-light, rgba(99,102,241,.12));
    color: var(--pos-primary, #6366f1);
}

/* ============================================================
   TOAST / TOASTR — scheme-aware overrides
   ============================================================ */
#toast-container > div {
    width: 900px;
    border-radius: 12px;
    padding: 18px 20px 18px 64px;
    box-shadow: 0 8px 32px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.16);
    opacity: 1 !important;
    font-size: 1rem;
    border-left: 5px solid rgba(255,255,255,.35);
    backdrop-filter: blur(4px);
}

#toast-container > div:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
    opacity: 1 !important;
    cursor: default;
}

.toast-success {
    background-color: var(--pos-success, #16a34a) !important;
}

.toast-error {
    background-color: var(--pos-danger, #dc2626) !important;
}

.toast-info {
    background-color: var(--pos-primary, #4f46e5) !important;
}

.toast-warning {
    background-color: var(--pos-warning, #d97706) !important;
}

.toast-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
    margin-bottom: 3px;
}

.toast-message {
    font-size: 1rem;
    opacity: .92;
    line-height: 1.45;
}

.toast-progress {
    background-color: rgba(255,255,255,.45) !important;
    opacity: 1 !important;
    height: 3px;
}

.toast-close-button {
    color: rgba(255,255,255,.85) !important;
    text-shadow: none !important;
    font-size: 48px !important;
    line-height: 1 !important;
}

.toast-close-button:hover {
    color: #fff !important;
    opacity: 1 !important;
}

/* ─── COMIDA MODULE ────────────────────────────────── */
.comida-badge-pendiente  { background: color-mix(in srgb, var(--pos-warning) 18%, transparent); color: var(--pos-warning); border: 1px solid var(--pos-warning); }
.comida-badge-preparando { background: color-mix(in srgb, var(--pos-primary) 15%, transparent); color: var(--pos-primary-dark); border: 1px solid var(--pos-primary); }

/* ─── AI CHAT MODULE ──────────────────────────────────────────────── */

/* ── Root layout ── */
.ai-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--pos-bg);
}

/* ── Top tab bar ── */
.ai-top-bar {
    display: flex;
    align-items: center;
    padding: .6rem 1rem;
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
    flex-shrink: 0;
}

.ai-top-tabs { display: flex; gap: .45rem; flex-wrap: wrap; }

.ai-top-tab {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .38rem .85rem;
    border: 1px solid var(--pos-border);
    border-radius: 20px;
    background: transparent;
    color: var(--pos-text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

.ai-top-tab:hover:not(:disabled),
.ai-top-tab.active {
    background: var(--pos-primary-muted);
    color: var(--pos-primary);
    border-color: var(--pos-primary);
}

.ai-top-tab:disabled { opacity: .45; cursor: not-allowed; }

/* ── Body: chat + sidebar ── */
.ai-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Chat panel ── */
.ai-chat-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    border-right: 1px solid var(--pos-border);
}

/* Chat header */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1.2rem;
    border-bottom: 1px solid var(--pos-border);
    background: var(--pos-surface);
    flex-shrink: 0;
}

.ai-chat-hl { display: flex; align-items: center; gap: .7rem; }

.ai-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--pos-primary), var(--pos-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.ai-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pos-text);
    line-height: 1.2;
}

.ai-status-line {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--pos-text-muted);
    font-size: 1rem;
    margin-top: .1rem;
}

.ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ai-dot-green { background: var(--pos-success); box-shadow: 0 0 5px var(--pos-success); }
.ai-dot-red   { background: var(--pos-danger); }

.ai-chat-hr { display: flex; gap: .45rem; }

.ai-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    background: transparent;
    color: var(--pos-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all .15s;
}

.ai-icon-btn:hover {
    background: var(--pos-primary-muted);
    color: var(--pos-primary);
    border-color: var(--pos-primary);
}

/* Messages area */
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

/* Welcome state */
.ai-welcome-msg {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
}

/* Message rows */
.ai-msg { display: flex; gap: .55rem; }

.ai-msg-user {
    flex-direction: row-reverse;
    align-self: flex-end;
    max-width: 72%;
}

.ai-msg-bot {
    align-items: flex-start;
    max-width: 86%;
}

.ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pos-primary), var(--pos-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Bubbles */
.ai-bubble {
    padding: .72rem 1rem;
    border-radius: 14px;
    font-size: 1rem;
    line-height: 1.55;
}

.ai-bubble-user {
    background: var(--pos-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-bubble-bot {
    background: var(--pos-surface);
    color: var(--pos-text);
    border: 1px solid var(--pos-border);
    border-bottom-left-radius: 4px;
}

.ai-bubble-bot p { margin: 0 0 .45rem; }
.ai-bubble-bot p:last-child { margin-bottom: 0; }

/* Welcome chips */
.ai-welcome-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .7rem;
}

.ai-welcome-chip {
    padding: .38rem .8rem;
    border: 1px solid var(--pos-border);
    border-radius: 18px;
    background: transparent;
    color: var(--pos-text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all .15s;
}

.ai-welcome-chip:hover {
    background: var(--pos-primary-muted);
    color: var(--pos-primary);
    border-color: var(--pos-primary);
}

/* API key warning */
.ai-key-warning {
    margin-top: .6rem;
    padding: .6rem .9rem;
    background: color-mix(in srgb, var(--pos-warning) 12%, transparent);
    border: 1px solid var(--pos-warning);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--pos-warning);
}

.ai-key-warning code {
    font-size: 1rem;
    background: rgba(0,0,0,.12);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Thinking animation */
.ai-thinking {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: .1rem 0;
}

.ai-thinking span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pos-primary);
    animation: ai-bounce .9s ease-in-out infinite;
}

.ai-thinking span:nth-child(2) { animation-delay: .15s; }
.ai-thinking span:nth-child(3) { animation-delay: .30s; }

@keyframes ai-bounce {
    0%, 80%, 100% { transform: scale(.65); opacity: .45; }
    40%           { transform: scale(1);   opacity: 1;   }
}

/* ── Chips bar ── */
.ai-chips-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .38rem;
    padding: .55rem 1.2rem;
    border-top: 1px solid var(--pos-border);
    background: var(--pos-surface);
    flex-shrink: 0;
}

.ai-chip {
    padding: .28rem .65rem;
    border: 1px solid var(--pos-border);
    border-radius: 14px;
    background: transparent;
    color: var(--pos-text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.ai-chip:hover:not(:disabled) {
    background: var(--pos-primary-muted);
    color: var(--pos-primary);
    border-color: var(--pos-primary);
}

.ai-chip:disabled { opacity: .4; cursor: not-allowed; }

/* ── Input bar ── */
.ai-input-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .8rem 1.2rem;
    background: var(--pos-surface);
    border-top: 1px solid var(--pos-border);
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    padding: .62rem 1rem;
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-bg);
    color: var(--pos-text);
    font-size: 1rem;
    outline: none;
    transition: border-color .15s;
}

.ai-input:focus         { border-color: var(--pos-primary); }
.ai-input:disabled      { opacity: .5; }
.ai-input::placeholder  { color: var(--pos-text-muted); }

.ai-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--pos-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}

.ai-send-btn:hover:not(:disabled) { background: var(--pos-primary-dark); }
.ai-send-btn:disabled              { opacity: .4; cursor: not-allowed; }
.ai-send-btn.ai-send-busy          { background: var(--pos-primary-muted); color: var(--pos-primary); }

/* ── Sidebar ── */
.ai-sidebar {
    width: 280px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--pos-surface);
    padding: 1rem;
    gap: .7rem;
    border-left: 1px solid var(--pos-border);
}

.ai-sidebar-section {
    background: var(--pos-bg);
    border: 1px solid var(--pos-border);
    border-radius: 12px;
    padding: .85rem 1rem;
}

.ai-sidebar-heading {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .07em;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    margin-bottom: .55rem;
}

/* Quick action buttons */
.ai-action-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .5rem .6rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--pos-text);
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
    margin-bottom: .2rem;
}

.ai-action-btn:last-child { margin-bottom: 0; }

.ai-action-btn:hover:not(:disabled) {
    background: var(--pos-primary-muted);
    color: var(--pos-primary);
}

.ai-action-btn:disabled { opacity: .4; cursor: not-allowed; }

.ai-action-icon {
    width: 18px;
    font-size: 1rem;
    color: var(--pos-primary);
    text-align: center;
    flex-shrink: 0;
}

/* Context rows */
.ai-ctx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .32rem 0;
    border-bottom: 1px solid var(--pos-border);
    font-size: 1rem;
    gap: .5rem;
}

.ai-ctx-row:last-child { border-bottom: none; }

.ai-ctx-label { color: var(--pos-text-muted); white-space: nowrap; }

.ai-ctx-value {
    font-weight: 600;
    color: var(--pos-text);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 55%;
    font-size: 1rem;
}

.ai-ctx-ok  { color: var(--pos-success) !important; }
.ai-ctx-err { color: var(--pos-danger)  !important; }

/* Support box */
.ai-support-box {
    background: color-mix(in srgb, var(--pos-primary) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--pos-primary) 28%, transparent);
    border-radius: 12px;
    padding: .9rem 1rem;
    margin-top: auto;
}

.ai-support-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pos-primary);
    margin-bottom: .3rem;
}

.ai-support-text {
    font-size: 1rem;
    color: var(--pos-text-muted);
    margin-bottom: .6rem;
    line-height: 1.45;
}

.ai-support-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .52rem 1rem;
    background: var(--pos-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}

.ai-support-btn:hover { background: var(--pos-primary-dark); color: #fff; }

/* Responsive: hide sidebar on small screens */
@media (max-width: 860px) {
    .ai-sidebar { display: none; }
    .ai-msg-user, .ai-msg-bot { max-width: 95%; }
}

/* ══════════════════════════════════════════════
   CIRCUIT LOADING OVERLAY — pci-*
══════════════════════════════════════════════ */

#pos-circuit-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #f0f4f8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    transition: opacity .25s ease, visibility .25s ease;
}

#pos-circuit-loading.pci-fade-out {
    opacity: 0;
    visibility: hidden;
}

.pci-logo {
    font-size: 3rem;
    color: #1565C0;
    opacity: .8;
}

.pci-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(21, 101, 192, .18);
    border-top-color: #1565C0;
    border-radius: 50%;
    animation: pci-spin .75s linear infinite;
}

@keyframes pci-spin {
    to { transform: rotate(360deg); }
}

.pci-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: .04em;
    margin: 0;
}

/* Ensure Blazor reconnect modal appears above the loading overlay */
#components-reconnect-modal {
    z-index: 99999 !important;
}

/* ══════════════════════════════════════════════
   ASISTENCIAS MODULE — att-*
══════════════════════════════════════════════ */

.att-date-filter {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.att-date-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pos-text-muted);
    white-space: nowrap;
}

.att-date-input {
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    padding: .35rem .6rem;
    font-size: 1rem;
    background: var(--pos-surface);
    color: var(--pos-text);
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
}
.att-date-input:focus { border-color: var(--pos-primary); }

.att-store-select {
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    padding: .35rem .7rem;
    font-size: 1rem;
    background: var(--pos-surface);
    color: var(--pos-text);
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
}
.att-store-select:focus { border-color: var(--pos-primary); }

.att-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
}
.att-badge-active {
    background: color-mix(in srgb, var(--pos-success) 15%, transparent);
    color: var(--pos-success-dark, #166534);
    border: 1px solid color-mix(in srgb, var(--pos-success) 35%, transparent);
}
.att-dot {
    font-size: .55rem;
    animation: att-pulse 1.4s ease-in-out infinite;
}
@keyframes att-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}
.att-badge-done {
    background: color-mix(in srgb, var(--pos-text-muted) 12%, transparent);
    color: var(--pos-text-muted);
    border: 1px solid color-mix(in srgb, var(--pos-text-muted) 25%, transparent);
}

.att-duration {
    font-variant-numeric: tabular-nums;
    font-family: monospace;
    font-size: 1rem;
}

/* ── Reportes: desglose por categoría ─────────────────────────── */
.rep-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: color-mix(in srgb, var(--pos-primary) 12%, transparent);
    color: var(--pos-primary);
    font-weight: 700;
    padding: .45rem .8rem;
    border-radius: 5px;
    margin-top: 1rem;
    margin-bottom: .3rem;
}
.rep-cat-total {
    font-size: .95rem;
    font-weight: 700;
}
.rep-cat-table {
    margin-bottom: .4rem;
}
.rep-cat-grand-total {
    text-align: right;
    font-weight: 700;
    padding: .5rem .8rem;
    background: var(--pos-surface-alt, #1e293b);
    border-radius: 5px;
    margin-top: .4rem;
    color: var(--pos-text);
}

/* ── Special message banner ─────────────────────────────────── */
.special-msg-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.25rem;
    background: linear-gradient(90deg, #1aacb1 0%, #0e7490 100%);
    color: #fff;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .01em;
    animation: smb-slide-in .35s ease;
}
.special-msg-banner i {
    flex-shrink: 0;
    font-size: 1rem;
    opacity: .9;
}
/* ── Consumo Interno: buscador de producto ─────────────────────── */
.ci-search-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}
.ci-search-results {
    margin-top: .4rem;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.ci-search-result-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background .15s;
}
.ci-search-result-row:last-child { border-bottom: none; }
.ci-search-result-row:hover { background: rgba(99,102,241,.06); }
.ci-search-result-name {
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
}
.ci-search-result-barcode {
    margin-left: .5rem;
    font-family: monospace;
    font-size: .85rem;
    color: var(--text-muted);
}
.ci-search-result-cost,
.ci-search-result-stock {
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.ci-remove-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(220,38,38,.1);
    color: var(--pos-danger);
    cursor: pointer;
    transition: background .15s;
}
.ci-remove-btn:hover { background: rgba(220,38,38,.2); }

@keyframes smb-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════
   SIDEBAR — sb-*  (Components/Shared/ComponentsForFiyiPOS/SideBar.razor)

   Uso: dentro de un contenedor display:flex en fila,
   el sidebar va a la izquierda y el contenido en un
   wrapper flex:1 a la derecha. Se contrae a un rail
   de solo iconos con la clase .sb-collapsed (hamburguesa
   propia o binding externo @bind-Collapsed).
══════════════════════════════════════════════ */

.pos-sidebar {
    position: relative;
    width: 252px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, var(--ink) 0%, var(--primary-dark) 130%);
    color: rgba(255,255,255,.85);
    box-shadow: 2px 0 10px rgba(0,0,0,.25);
    overflow: hidden;
    transition: width .2s ease;
    z-index: 20;
}

.pos-sidebar.sb-collapsed {
    width: 64px;
}

/* ── Marca + hamburguesa ── */
.sb-top {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem .75rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex: 1;
    min-width: 0;
}

.sb-brand-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    flex-shrink: 0;
}

.sb-brand-text {
    min-width: 0;
}

.sb-brand-name {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .5px;
    color: #fff;
    white-space: nowrap;
}

.sb-brand-sub {
    font-size: .78rem;
    color: #7dd8db;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Selector de sucursal ── */
.sb-store-trigger {
    display: flex;
    align-items: center;
    gap: .35rem;
    max-width: 100%;
    background: none;
    border: none;
    padding: 0;
    color: #7dd8db;
    font-family: inherit;
    font-size: .78rem;
    cursor: pointer;
    transition: color .15s;
}

.sb-store-trigger:hover {
    color: #fff;
}

.sb-store-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-store-chevron {
    font-size: .62rem;
    flex-shrink: 0;
    transition: transform .18s ease;
}

.sb-store-chevron.open {
    transform: rotate(180deg);
}

.sb-store-menu {
    position: absolute;
    top: 60px;
    left: .5rem;
    right: .5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    z-index: 1100;
    overflow: hidden;
    padding: .3rem 0;
}

.sb-hamburger {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 1.05rem;
    padding: .45rem .55rem;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}

.sb-hamburger:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

/* ── Operador ── */
.sb-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .75rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.sb-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sb-user-text {
    min-width: 0;
}

.sb-user-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #7dd8db;
}

.sb-user-name {
    font-size: .88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Navegación ── */
.sb-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .55rem .5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.sb-item,
.sb-group-trigger {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 8px;
    color: rgba(255,255,255,.82);
    font-family: inherit;
    font-size: .92rem;
    font-weight: 500;
    padding: .55rem .65rem;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition: background .15s, color .15s, border-color .15s;
}

.sb-item:hover,
.sb-group-trigger:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.sb-item-icon {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sb-item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Carpetas (grupos) ── */
.sb-group-trigger.has-active {
    color: #fff;
    border-left-color: var(--pos-primary-light);
    background: rgba(255,255,255,.07);
    font-weight: 700;
}

.sb-chevron {
    font-size: .7rem;
    flex-shrink: 0;
    transition: transform .18s ease;
}

.sb-group.open .sb-chevron {
    transform: rotate(180deg);
}

.sb-group-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0 4px;
    animation: sb-drop .18s ease;
}

@keyframes sb-drop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sb-subitem {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 8px;
    color: rgba(255,255,255,.68);
    font-family: inherit;
    font-size: .88rem;
    padding: .42rem .65rem .42rem 1.35rem;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    user-select: none;
    transition: background .15s, color .15s, border-color .15s;
}

.sb-subitem:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.sb-subitem.active {
    background: rgba(255,255,255,.15);
    border-left-color: #fff;
    color: #fff;
    font-weight: 700;
}

.sb-subitem-icon {
    width: 20px;
    text-align: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.sb-kbd {
    font-size: .72rem;
    background: rgba(255,255,255,.18);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: monospace;
    flex-shrink: 0;
}

/* ── Guía y salir ── */
.sb-guide {
    color: #fff;
}

.sb-guide:hover {
    background: rgba(96,165,250,.2);
}

/* ── Herramientas: zoom + tema ── */
.sb-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: .4rem .5rem;
    border-top: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.sb-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,.75);
    font-size: .9rem;
    padding: .45rem .55rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.sb-tool-btn:hover:not(:disabled) {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.sb-tool-btn:disabled { opacity: .3; cursor: default; }

.sb-zoom-pct {
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    min-width: 38px;
    text-align: center;
    user-select: none;
}

.sb-tools-sep {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,.18);
    margin: 0 .35rem;
}

.sb-footer {
    padding: .5rem;
    border-top: 1px solid rgba(255,255,255,.12);
    flex-shrink: 0;
}

.sb-exit {
    color: #fca5a5;
}

.sb-exit:hover {
    background: rgba(239,68,68,.25);
    color: #fff;
}

/* ── Modo contraído (rail de iconos) ── */
.pos-sidebar.sb-collapsed .sb-brand-text,
.pos-sidebar.sb-collapsed .sb-user-text,
.pos-sidebar.sb-collapsed .sb-item-label,
.pos-sidebar.sb-collapsed .sb-chevron,
.pos-sidebar.sb-collapsed .sb-kbd,
.pos-sidebar.sb-collapsed .sb-brand-icon,
.pos-sidebar.sb-collapsed .sb-tools {
    display: none;
}

.pos-sidebar.sb-collapsed .sb-top {
    justify-content: center;
    padding: .7rem .4rem;
}

.pos-sidebar.sb-collapsed .sb-user {
    justify-content: center;
    padding: .65rem .4rem;
}

.pos-sidebar.sb-collapsed .sb-nav {
    padding: .55rem .35rem;
}

.pos-sidebar.sb-collapsed .sb-item,
.pos-sidebar.sb-collapsed .sb-group-trigger,
.pos-sidebar.sb-collapsed .sb-subitem {
    justify-content: center;
    padding: .55rem .4rem;
}
