/* ============================================================
   SAUNA POS — Estilos principales
   Tema: oscuro profesional · Fuente: system-ui
   ============================================================ */

/* ── Variables: estructura constante ──────────────────── */
:root {
    --radius:      10px;
    --radius-sm:   6px;
    --radius-lg:   14px;
    --transition:  .18s cubic-bezier(.4,0,.2,1);
    --font:        system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    /* Empresa color (inyectado desde main.php por --primary) */
    --primary:      #4f8ef7;
    --primary-dk:   #3a72d8;
    --primary-text: #ffffff;  /* color de texto legible sobre --primary (auto en main.php) */
    --success:     #2dbe6c;
    --success-dk:  #22a05b;
    --danger:      #e05353;
    --danger-dk:   #c43f3f;
    --warning:     #f5a623;
    --info:        #38a3ff;
}

/* ── TEMA OSCURO (por defecto) ────────────────────────── */
:root,
[data-theme="dark"] {
    --bg:           #0f1117;
    --bg2:          #1a1d27;
    --bg3:          #242736;
    --bg-elevated:  #2a2e44;
    --border:       #2e3146;
    --border-soft:  #232636;
    --text:         #e8eaf0;
    --text2:        #9297b0;
    --text3:        #6b7090;
    --shadow:       0 4px 20px rgba(0,0,0,.45);
    --shadow-sm:    0 1px 4px rgba(0,0,0,.35);
    --shadow-hover: 0 8px 26px rgba(0,0,0,.55);
    --overlay:      rgba(0,0,0,.72);
    --btn-shine:    rgba(255,255,255,.10);
    --input-bg:     rgba(255,255,255,.04);
    color-scheme:   dark;
}

/* ── TEMA CLARO ───────────────────────────────────────── */
[data-theme="light"] {
    --bg:           #f4f6fa;
    --bg2:          #ffffff;
    --bg3:          #eef1f7;
    --bg-elevated:  #ffffff;
    --border:       #d8dde8;
    --border-soft:  #e6e9f0;
    --text:         #1a1f2e;
    --text2:        #5a6580;
    --text3:        #8892a8;
    --success:      #16a34a;
    --success-dk:   #128a3f;
    --danger:       #dc2626;
    --danger-dk:    #b91c1c;
    --warning:      #ea580c;
    --shadow:       0 4px 18px rgba(20,30,60,.10);
    --shadow-sm:    0 1px 3px rgba(20,30,60,.08);
    --shadow-hover: 0 8px 24px rgba(20,30,60,.16);
    --overlay:      rgba(30,40,70,.45);
    --btn-shine:    rgba(255,255,255,.20);
    --input-bg:     #ffffff;
    color-scheme:   light;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* El atributo [hidden] SIEMPRE oculta, aunque la clase defina display:flex/grid */
[hidden] { display: none !important; }

html { font-size: 15px; }

body {
    font-family: var(--font);
    background:  var(--bg);
    color:       var(--text);
    min-height:  100vh;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; }

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
    display:          flex;
    align-items:      center;
    justify-content:  space-between;
    padding:          0 1.5rem;
    height:           58px;
    background:       var(--bg2);
    border-bottom:    1px solid var(--border);
    box-shadow:       var(--shadow-sm);
    position:         sticky;
    top:              0;
    z-index:          100;
    backdrop-filter:  blur(8px);
}

.navbar-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.nav-title    { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.nav-logo     { height: 40px; width: auto; max-width: 180px; object-fit: contain; }
@media (max-width: 600px) {
    .nav-logo { height: 32px; max-width: 120px; }
}

.navbar-links { display: flex; gap: .5rem; align-items: center; }
.navbar-links a {
    color: var(--text2);
    font-size: .88rem;
    font-weight: 600;
    padding: .4rem .9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg3);
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}
.navbar-links a:hover {
    color: var(--text);
    border-color: var(--text3);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}
.navbar-links a.active {
    color: var(--primary-text);
    background: var(--primary);
    border-color: var(--primary);
    text-decoration: none;
}

.navbar-user  { display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
.rol-badge    { padding: 2px 8px; border-radius: 20px; font-size: .75rem; font-weight: 600; background: var(--bg3); }
.rol-superadmin { color: var(--warning); }
.rol-gestor     { color: var(--primary); }
.rol-cliente    { color: var(--success); }

.btn-logout {
    padding: 4px 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text2);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-size: .85rem;
}
.btn-logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); text-decoration: none; }

/* ── Main ──────────────────────────────────────────────── */
.app-main { padding: 1.5rem; }

/* ── Botones modernizados ─────────────────────────────── */
.btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    gap:             .4rem;
    padding:         .55rem 1.1rem;
    border:          1px solid transparent;
    border-radius:   8px;
    cursor:          pointer;
    font-weight:     600;
    font-size:       .88rem;
    line-height:     1.2;
    transition:      transform var(--transition),
                     box-shadow var(--transition),
                     background var(--transition),
                     border-color var(--transition);
    white-space:     nowrap;
    text-decoration: none;
    user-select:     none;
    position:        relative;
    overflow:        hidden;
}
.btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, var(--btn-shine), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.btn:hover::before { opacity: 1; }
.btn:active        { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled,
.btn[disabled]     { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary {
    background: linear-gradient(180deg, var(--primary), var(--primary-dk));
    color: var(--primary-text);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.22), 0 2px 4px rgba(0,0,0,.14);
}

.btn-secondary {
    background: var(--bg3);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--text3);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(180deg, var(--success), var(--success-dk));
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(45,190,108,.32);
}

.btn-danger {
    background: linear-gradient(180deg, var(--danger), var(--danger-dk));
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(224,83,83,.32);
}

.btn-warning {
    background: linear-gradient(180deg, var(--warning), #d48a1a);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245,166,35,.32);
}

.btn-sm    { padding: .38rem .85rem;  font-size: .8rem; }
.btn-xs    { padding: .26rem .65rem;  font-size: .74rem; border-radius: 6px; }
.btn-lg    { padding: .75rem 1.4rem;  font-size: .98rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group {
    display:        flex;
    flex-direction: column;
    gap:            .35rem;
    margin-bottom:  1rem;
}
.form-group label { font-size: .85rem; color: var(--text2); font-weight: 600; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="time"],
select, textarea {
    background:    var(--input-bg);
    border:        1px solid var(--border);
    border-radius: 8px;
    color:         var(--text);
    padding:       .55rem .85rem;
    width:         100%;
    transition:    border-color var(--transition), box-shadow var(--transition), background var(--transition);
    font-size:     .92rem;
}
input::placeholder, textarea::placeholder { color: var(--text3); }
input:focus, select:focus, textarea:focus {
    outline:       none;
    border-color:  var(--primary);
    box-shadow:    0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea { background: #fff; }

.alert-error {
    background:    rgba(224,83,83,.15);
    border:        1px solid var(--danger);
    border-radius: var(--radius-sm);
    color:         #ff8a8a;
    padding:       .6rem .9rem;
    font-size:     .875rem;
    margin-bottom: .75rem;
}

/* ── Login ─────────────────────────────────────────────── */
.login-body {
    display:         flex;
    align-items:     center;
    justify-content: center;
    min-height:      100vh;
    background:      radial-gradient(ellipse at 50% 30%, #1a2040 0%, var(--bg) 70%);
}

.login-card {
    background:    var(--bg2);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       2.5rem 2rem;
    width:         100%;
    max-width:     400px;
    box-shadow:    var(--shadow);
}

.login-header   { text-align: center; margin-bottom: 2rem; }
.login-icon     { font-size: 3rem; margin-bottom: .5rem; }
.login-header h1{ font-size: 1.75rem; color: var(--primary); }
.login-header p { color: var(--text2); font-size: .9rem; margin-top: .25rem; }

/* ── Dashboard topbar ──────────────────────────────────── */
.dash-topbar {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    margin-bottom:   1.5rem;
}

.dash-stats   { display: flex; gap: 1rem; }
.stat-chip    { display: flex; align-items: baseline; gap: .4rem; padding: .4rem .9rem; background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; }
.stat-num     { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.stat-label   { font-size: .8rem; color: var(--text2); }

/* ── Sesiones grid ─────────────────────────────────────── */
.sesiones-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap:                   1.25rem;
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text2);
    font-size: 1.1rem;
}

.sesion-card {
    background:    var(--bg2);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       1rem;
    display:       flex;
    flex-direction: column;
    gap:           .75rem;
    transition:    border-color var(--transition);
}
.sesion-card:hover { border-color: var(--primary); }

.sesion-header {
    display:         flex;
    align-items:     flex-start;
    justify-content: space-between;
    gap:             .5rem;
}
.sesion-id-block { display: flex; flex-direction: column; gap: .15rem; }
.sesion-nombre   { font-weight: 700; font-size: 1rem; }
.sesion-dni      { font-size: .78rem; color: var(--text2); }

.sesion-metrics {
    display:      flex;
    gap:          .75rem;
    flex-wrap:    wrap;
}
.metric { display: flex; flex-direction: column; gap: .15rem; }
.metric label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); }

.timer-estadia {
    font-size:   1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color:       var(--success);
    letter-spacing: .03em;
}

.sesion-consumo-val { font-size: 1rem; font-weight: 700; color: var(--warning); }

/* ── Pedidos en card ───────────────────────────────────── */
.pedidos-list { display: flex; flex-direction: column; gap: .5rem; }

.pedido-row {
    display:         flex;
    align-items:     stretch;
    gap:             .5rem;
    background:      var(--bg3);
    border-radius:   var(--radius-sm);
    padding:         .5rem .7rem;
    border-left:     3px solid var(--warning);
}
.pedido-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    gap: .15rem;
    cursor: pointer;
    transition: background .12s;
    border-radius: 4px;
    padding: 2px 3px;
}
.pedido-info:hover { background: rgba(255,255,255,.04); }
.pedido-line1, .pedido-line2 {
    display: flex; align-items: center; gap: .55rem;
}
.pedido-num   { font-size: .78rem; color: var(--text2); font-weight: 700; }
.pedido-items {
    flex: 1; min-width: 0;
    font-size: .82rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pedido-nota {
    font-size: .75rem;
    color: var(--warning);
    background: rgba(245,166,35,.08);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.pedido-total { font-size: .85rem; font-weight: 700; color: var(--success); }
.pedido-timer {
    font-variant-numeric: tabular-nums;
    font-size:  .8rem;
    color:      var(--warning);
    font-weight: 700;
    margin-left: auto;
}
.pedido-actions { display: flex; gap: .3rem; align-items: center; }

/* ── Modal Pago (al cerrar sesión) ─────────────────────── */
.pago-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}
.pago-option {
    display: flex; flex-direction: column; align-items: center;
    gap: .4rem;
    padding: 1.1rem .6rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg3);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: all .15s;
}
.pago-option:hover {
    border-color: var(--primary);
    background: rgba(79,142,247,.10);
    transform: translateY(-2px);
}
.pago-icon  { font-size: 2.2rem; line-height: 1; }
.pago-label { font-size: .92rem; font-weight: 700; }

/* ── Modal Detalle de Pedido ──────────────────────────── */
.detalle-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; padding-bottom: .8rem;
    border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.detalle-header h3 { font-size: 1.05rem; margin: 0 0 .2rem 0; }
.detalle-meta { font-size: .82rem; color: var(--text2); }
.detalle-estado {
    padding: 4px 12px; border-radius: 20px;
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase;
}
.detalle-estado--preparando { background: rgba(245,166,35,.15); color: var(--warning); }
.detalle-estado--entregado  { background: rgba(45,190,108,.15); color: var(--success); }
.detalle-estado--cancelado  { background: rgba(224,83,83,.15);  color: var(--danger); }

.detalle-nota-block {
    background: rgba(245,166,35,.10);
    border-left: 3px solid var(--warning);
    padding: .65rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    margin-bottom: 1rem;
    line-height: 1.45;
}

.detalle-items {
    display: flex; flex-direction: column; gap: .35rem;
    margin-bottom: 1rem;
}
.detalle-item {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    gap: .55rem; align-items: center;
    padding: .55rem .7rem;
    background: var(--bg3);
    border-radius: var(--radius-sm);
}
.detalle-cant   { font-weight: 800; color: var(--primary); font-size: .95rem; }
.detalle-nombre { font-weight: 600; }
.detalle-sub    { font-weight: 700; color: var(--success); }
.detalle-cat-tag {
    font-size: .68rem; padding: 2px 8px;
    border-radius: 20px; font-weight: 700;
}
.detalle-cat-Cocina   { background: rgba(245,140,60,.18); color: #ffb375; }
.detalle-cat-Alquiler { background: rgba(79,142,247,.18); color: #7eb8f7; }
.detalle-cat-General  { background: rgba(136,145,176,.18); color: var(--text2); }

.detalle-total {
    display: flex; justify-content: space-between;
    padding: .85rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.1rem;
}
.detalle-total strong { color: var(--success); }

.detalle-actions {
    display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap;
}
.detalle-actions .btn { flex: 1; min-width: 140px; }

.badge-info {
    font-size: .72rem; padding: 2px 8px;
    background: rgba(79,142,247,.15); color: #7eb8f7;
    border-radius: 20px;
}

.sesion-footer { margin-top: auto; }

/* ── Modales ───────────────────────────────────────────── */
.modal {
    position:  fixed;
    inset:     0;
    z-index:   1000;
    display:   flex;
    align-items: center;
    justify-content: center;
    padding:   1rem;
}
.modal[hidden] { display: none; }

.modal-overlay {
    position:   absolute;
    inset:      0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(3px);
}

.modal-box {
    position:      relative;
    background:    var(--bg2);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    max-height:    90vh;
    overflow-y:    auto;
    z-index:       1;
    width:         100%;
}

.modal-sm     { max-width: 440px; padding: 1.5rem; }
.modal-pos-box{ max-width: 960px; }
.modal-img-box{ max-width: 600px; background: transparent; border: none; box-shadow: none; }
.modal-ticket-box { max-width: 380px; }

.modal-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         1rem 1.25rem;
    border-bottom:   1px solid var(--border);
    position:        sticky;
    top:             0;
    background:      var(--bg2);
    z-index:         2;
}
.modal-header h2 { font-size: 1.1rem; }
.modal-header-actions { display: flex; align-items: center; gap: .5rem; }

.btn-close {
    background: none;
    border:     none;
    color:      var(--text2);
    cursor:     pointer;
    font-size:  1.2rem;
    line-height: 1;
    padding:    .25rem .4rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}
.btn-close:hover    { color: var(--danger); }
.btn-close-float {
    position: absolute;
    top: .75rem; right: .75rem;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 1.1rem;
}

.img-zoom {
    width:         100%;
    border-radius: var(--radius);
    display:       block;
}

/* ── POS Layout ────────────────────────────────────────── */
.pos-layout {
    display:        grid;
    grid-template-columns: 1fr 300px;
    height:         calc(90vh - 70px);
    overflow:       hidden;
}

.pos-catalog {
    display:        flex;
    flex-direction: column;
    border-right:   1px solid var(--border);
    overflow:       hidden;
}

/* Pestañas de categoría */
.pos-categorias {
    display:        flex;
    flex-wrap:      wrap;
    gap:            .4rem;
    padding:        .75rem 1rem;
    border-bottom:  1px solid var(--border);
    background:     var(--bg3);
}
.cat-tab {
    padding:       .35rem .85rem;
    border:        1px solid var(--border);
    border-radius: 20px;
    background:    var(--bg2);
    color:         var(--text2);
    cursor:        pointer;
    font-size:     .85rem;
    transition:    all var(--transition);
}
.cat-tab.active,
.cat-tab:hover  { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* Grid de productos */
.pos-productos {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows:        max-content;   /* cada fila usa solo lo que necesita */
    align-content:         start;          /* NO estirar filas para llenar el alto */
    gap:                   .75rem;
    padding:               1rem;
    overflow-y:            auto;
    flex:                  1;
}
.prod-card { align-self: start; }          /* la tarjeta no se estira verticalmente */

.prod-card {
    background:    var(--bg3);
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor:        pointer;
    transition:    all var(--transition);
    user-select:   none;
    position:      relative;
}
.prod-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.4); }

.prod-img-wrap { position: relative; aspect-ratio: 1/1; overflow: hidden; }

.prod-thumb {
    width:      100%;
    height:     100%;
    object-fit: cover;
    transition: transform var(--transition);
}
.prod-card:hover .prod-thumb { transform: scale(1.05); }

.cart-badge {
    position:   absolute;
    top:        6px; right: 6px;
    background: var(--primary);
    color:      var(--primary-text);
    font-size:  .75rem;
    font-weight:700;
    width:      22px; height: 22px;
    border-radius: 50%;
    display:    flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.prod-info {
    padding:        .45rem .55rem;
    display:        flex;
    flex-direction: column;
    gap:            .15rem;
}
.prod-name  { font-size: .82rem; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prod-price { font-size: .85rem; color: var(--success); font-weight: 700; }

/* ── Carrito ───────────────────────────────────────────── */
.pos-cart-panel {
    display:        flex;
    flex-direction: column;
    overflow:       hidden;
}
.cart-title { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .95rem; }

.cart-items { flex: 1; overflow-y: auto; padding: .5rem; }

.cart-row {
    display:        grid;
    grid-template-columns: 1fr auto auto;
    align-items:    center;
    gap:            .4rem;
    padding:        .45rem .5rem;
    border-bottom:  1px solid var(--border);
    font-size:      .85rem;
}
.cart-row-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cart-row-controls { display: flex; align-items: center; gap: .25rem; }
.cart-row-sub { font-weight: 700; color: var(--success); text-align: right; min-width: 60px; }

.btn-qty {
    background:    var(--bg3);
    border:        1px solid var(--border);
    color:         var(--text);
    width:         24px; height: 24px;
    border-radius: 4px;
    cursor:        pointer;
    font-size:     1rem;
    line-height:   1;
    display:       flex;
    align-items:   center;
    justify-content: center;
    transition:    background var(--transition);
}
.btn-qty:hover { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.cart-qty { min-width: 20px; text-align: center; font-weight: 600; }

.cart-footer { padding: .75rem; border-top: 1px solid var(--border); background: var(--bg3); }

/* Caja de nota para cocina — destacada */
.pos-nota-box {
    background:     color-mix(in srgb, var(--warning) 12%, var(--bg2));
    border:         1px solid color-mix(in srgb, var(--warning) 45%, transparent);
    border-left:    4px solid var(--warning);
    border-radius:  10px;
    padding:        .65rem .75rem;
    margin-bottom:  .75rem;
}
.pos-nota-label {
    display:        flex;
    align-items:    center;
    gap:            .4rem;
    font-size:      .82rem;
    font-weight:    700;
    color:          var(--warning);
    margin-bottom:  .45rem;
}
.pos-nota-ico   { font-size: 1rem; }
.pos-nota-opt {
    font-size:      .68rem;
    font-weight:    600;
    color:          var(--text3);
    background:      var(--bg3);
    padding:        1px 7px;
    border-radius:  20px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.pos-nota-box textarea {
    width:          100%;
    resize:         vertical;
    min-height:     48px;
    background:      var(--bg2);
    border:         1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
    border-radius:  8px;
    font-size:      .88rem;
}
.pos-nota-box textarea:focus {
    border-color:   var(--warning);
    box-shadow:     0 0 0 3px color-mix(in srgb, var(--warning) 20%, transparent);
}

.cart-total-row {
    display:         flex;
    justify-content: space-between;
    align-items:     baseline;
    margin-bottom:   .75rem;
    font-size:       1rem;
}
.cart-total-row strong { font-size: 1.2rem; color: var(--success); }

/* ── Ticket térmico (pantalla) ─────────────────────────── */
.modal-ticket-box { padding: 0; }
.modal-ticket-box .modal-header { padding: .75rem 1rem; }

.ticket-thermal { padding: 1rem; }
.ticket-wrap    { font-family: 'Courier New', monospace; font-size: .82rem; color: #111; background: #fff; padding: .75rem; border-radius: 4px; }

.ticket-head    { text-align: center; margin-bottom: .5rem; }
.ticket-logo    { max-width: 120px; margin: 0 auto .5rem; }
.ticket-local   { font-size: 1.1rem; font-weight: 700; margin-bottom: .15rem; }
.ticket-fecha   { font-size: .75rem; color: #555; }

.ticket-sep     { text-align: center; color: #aaa; margin: .35rem 0; font-size: .8rem; }

.ticket-data    { width: 100%; font-size: .8rem; }
.ticket-data td { padding: .1rem .2rem; vertical-align: top; }
.ticket-data td:first-child { color: #555; width: 6.5rem; }

.ticket-items   { width: 100%; font-size: .78rem; border-collapse: collapse; }
.ticket-items th { text-align: left; border-bottom: 1px dashed #ccc; padding: .15rem .2rem; }
.ticket-items td { padding: .1rem .2rem; vertical-align: top; }
.td-desc        { width: auto; }
.td-pu, .td-sub { text-align: right; white-space: nowrap; }
.ticket-tr-total td { font-weight: 700; }

.ticket-total-block {
    display:         flex;
    justify-content: space-between;
    font-size:       1.1rem;
    font-weight:     700;
    padding:         .35rem 0;
}
.ticket-footer  { text-align: center; margin-top: .35rem; color: #555; font-size: .75rem; }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
    position:      fixed;
    bottom:        2rem;
    left:          50%;
    transform:     translateX(-50%);
    padding:       .65rem 1.5rem;
    border-radius: 20px;
    font-size:     .9rem;
    font-weight:   600;
    z-index:       9999;
    animation:     toastIn .25s ease, toastOut .25s ease 3.25s forwards;
    pointer-events: none;
    white-space:   nowrap;
}
.toast-ok { background: var(--success); color: #fff; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* ── Misc ──────────────────────────────────────────────── */
.text-muted   { color: var(--text2); font-size: .875rem; }
.text-center  { text-align: center; }

/* ── Alert success (para modales de admin) ─────────────── */
.alert-success {
    background:    rgba(45,190,108,.15);
    border:        1px solid var(--success);
    border-radius: var(--radius-sm);
    color:         #6fe6a0;
    padding:       .6rem .9rem;
    font-size:     .875rem;
    margin-bottom: .75rem;
}

/* ── Botón warning ─────────────────────────────────────── */
.btn-warning       { background: var(--warning); color: #111; }
.btn-warning:hover { background: #d48c1a; }

/* ── Admin panel ───────────────────────────────────────── */
.admin-page { max-width: 1000px; margin: 0 auto; }

.admin-header {
    display:         flex;
    align-items:     flex-start;
    justify-content: space-between;
    gap:             1rem;
    margin-bottom:   1.5rem;
}
.admin-title { font-size: 1.4rem; font-weight: 700; margin-bottom: .5rem; }
.admin-stats { display: flex; gap: .5rem; flex-wrap: wrap; }

.stat-pill {
    padding:       .25rem .75rem;
    border-radius: 20px;
    font-size:     .8rem;
    font-weight:   600;
    background:    var(--bg3);
    border:        1px solid var(--border);
}
.stat-pill.sa { color: var(--warning); border-color: var(--warning); }
.stat-pill.ge { color: var(--primary); border-color: var(--primary); }
.stat-pill.cl { color: var(--success); border-color: var(--success); }

.table-wrap { overflow-x: auto; }

.admin-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       .875rem;
}
.admin-table th {
    text-align:    left;
    padding:       .65rem .9rem;
    background:    var(--bg3);
    border-bottom: 2px solid var(--border);
    font-size:     .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color:         var(--text2);
    white-space:   nowrap;
}
.admin-table td {
    padding:       .6rem .9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td      { background: var(--bg3); }

.row-inactivo td      { opacity: .5; }
.row-inactivo:hover td{ opacity: .75; }

.td-username { font-weight: 600; font-family: monospace; font-size: .95rem; }
.td-fecha    { color: var(--text2); font-size: .8rem; white-space: nowrap; }
.th-actions, .td-actions { text-align: right; }
.td-actions  { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }

.estado-badge {
    display:       inline-block;
    padding:       .2rem .6rem;
    border-radius: 20px;
    font-size:     .75rem;
    font-weight:   600;
}
.estado-badge.activo   { background: rgba(45,190,108,.15); color: var(--success); }
.estado-badge.inactivo { background: rgba(224,83,83,.12);  color: var(--danger);  }

.form-hint { color: var(--text2); font-size: .875rem; margin-bottom: 1rem; }

/* ── Corrección: badge warning en el navbar ya existente ── */
.rol-gestor     { color: var(--primary);  border: 1px solid var(--primary);  }

/* ══════════════════════════════════════════════════════════
   TICKET TÉRMICO — estilos de pantalla
   ══════════════════════════════════════════════════════════ */
.ticket-thermal { padding: 0; }
.ticket-wrap {
    font-family: 'Courier New', monospace;
    font-size:   9pt;
    color:       inherit;
    background:  transparent;
    max-width:   76mm;
}
.ticket-local       { font-size: 11pt; font-weight: 700; text-align: center; margin-bottom: 2mm; }
.ticket-total-block { font-size: 11pt; font-weight: 700; display: flex; justify-content: space-between; margin: 2mm 0; }
.ticket-sep         { border-top: 1px dashed currentColor; margin: 2mm 0; }
.ticket-head        { text-align: center; margin-bottom: 2mm; }
.ticket-fecha       { font-size: .8em; color: var(--text2); }
.ticket-data        { width: 100%; border-collapse: collapse; font-size: .82em; margin-bottom: 2mm; }
.ticket-data td     { padding: 1px 3px; vertical-align: top; }
.ticket-data td:last-child { text-align: right; }
.ticket-items       { width: 100%; border-collapse: collapse; font-size: .82em; }
.ticket-items th, .ticket-items td { padding: 1px 3px; }
.td-desc { width: 55%; } .td-pu { width: 20%; text-align: right; } .td-sub { width: 25%; text-align: right; }
.ticket-tr-total td { font-weight: 700; }
.ticket-footer      { text-align: center; font-style: italic; margin-top: 3mm; }

/* ============================================================
   NUEVAS FUNCIONALIDADES v2
   ============================================================ */

/* ── Admin: navegación por tabs ──────────────────────────── */
.admin-tabs {
    display:         flex;
    gap:             .25rem;
    background:      var(--bg2);
    padding:         .5rem .5rem 0;
    border-radius:   10px 10px 0 0;
    margin-bottom:   1.5rem;
    overflow-x:      auto;
}
.admin-tab {
    padding:         .55rem 1.1rem;
    border-radius:   8px 8px 0 0;
    color:           var(--text-muted, #aaa);
    text-decoration: none;
    font-size:       .88rem;
    font-weight:     500;
    white-space:     nowrap;
    transition:      background .15s, color .15s;
}
.admin-tab:hover  { background: var(--bg3); color: var(--text); }
.admin-tab.active { background: var(--primary); color: var(--primary-text); }

/* ── Admin: subtítulo ────────────────────────────────────── */
.admin-subtitle { color: var(--text-muted, #aaa); font-size: .85rem; margin-top: .2rem; }

/* ── Admin: imagen pequeña en tabla ─────────────────────── */
.td-img { width: 52px; }
.prod-thumb-sm {
    width: 44px; height: 44px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg3);
}

/* ── Tipo de producto badge ──────────────────────────────── */
.tipo-badge {
    font-size: .72rem; padding: 2px 7px;
    border-radius: 20px; font-weight: 600;
    background: var(--bg3);
}
.tipo-venta    { background: #1e3a5f; color: #7eb8f7; }
.tipo-alquiler { background: #2d3a1e; color: #a3d977; }

/* ── Tarifas en modal ingreso ────────────────────────────── */
.tariff-section { margin: 1rem 0 .75rem; border-top: 1px solid var(--bg3); padding-top: .75rem; }
.tariff-row {
    display:     grid;
    grid-template-columns: 80px 60px auto auto;
    align-items: center;
    gap:         .4rem;
    margin-bottom: .4rem;
}
.tariff-lbl  { font-size: .85rem; font-weight: 500; }
.tariff-qty  { width: 56px; text-align: center; padding: .3rem .4rem; }
.tariff-rate { font-size: .8rem; color: var(--text-muted, #aaa); }
.tariff-sub  { font-size: .85rem; font-weight: 600; text-align: right; }
.tariff-total {
    display:        flex;
    justify-content:space-between;
    align-items:    center;
    padding:        .6rem .1rem;
    border-top:     1px solid var(--bg3);
    margin-top:     .5rem;
    font-size:      1rem;
}
.tariff-total strong { font-size: 1.1rem; color: var(--primary); }

/* ── Pago options (modal método de pago) ─────────────────── */
.pago-options {
    display: flex;
    gap:     .75rem;
    margin:  1rem 0;
}
.btn-pago {
    flex: 1;
    padding:         .8rem .5rem;
    font-size:       1rem;
    border-radius:   10px;
    border:          2px solid var(--bg3);
    background:      var(--bg2);
    color:           var(--text);
    cursor:          pointer;
    transition:      border-color .15s, background .15s;
}
.btn-pago:hover { border-color: var(--primary); background: var(--bg3); }

/* ── Configuración ───────────────────────────────────────── */
.config-grid { display: flex; flex-direction: column; gap: 1.5rem; max-width: 680px; }
.config-card {
    background: var(--bg2);
    border-radius: 12px;
    padding: 1.5rem;
}
.config-card-title {
    font-size: .95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--primary);
    margin: 0 0 1rem;
}

/* ── Reportes ────────────────────────────────────────────── */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.summary-card {
    background:    var(--bg2);
    border-radius: 10px;
    padding:       1.1rem;
    display:       flex;
    flex-direction:column;
    gap:           .4rem;
}
.summary-card--highlight { background: var(--primary); }
.summary-label { font-size: .78rem; color: var(--text-muted, #aaa); text-transform: uppercase; }
.summary-card--highlight .summary-label { color: var(--primary-text); opacity: .8; }
.summary-card--highlight .summary-val   { color: var(--primary-text); }
.summary-val   { font-size: 1.35rem; font-weight: 700; }

.report-filters {
    display:     flex;
    align-items: center;
    gap:         .5rem;
    margin-bottom: 1rem;
}
.filter-label { font-size: .85rem; color: var(--text-muted, #aaa); }

.report-table td, .report-table th { font-size: .82rem; }
.report-total-row td { font-weight: 700; background: var(--bg3); }

/* ── Vista del Cliente ───────────────────────────────────── */
.cliente-empty {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    justify-content:center;
    gap:            1rem;
    padding:        3rem 1rem;
    text-align:     center;
}
.cliente-empty-icon { font-size: 4rem; }

.cliente-header {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    margin-bottom:   1.5rem;
    gap:             1rem;
    flex-wrap:       wrap;
}
.cliente-nombre { font-size: 1.5rem; margin: 0; }
.cliente-dni    { color: var(--text-muted, #aaa); margin: .2rem 0 0; font-size: .9rem; }

.cliente-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.cli-metric {
    background:    var(--bg2);
    border-radius: 12px;
    padding:       1.2rem;
    display:       flex;
    flex-direction:column;
    gap:           .4rem;
}
.cli-metric label { font-size: .78rem; color: var(--text-muted, #aaa); text-transform: uppercase; }
.cli-timer { font-size: 2.2rem; font-weight: 700; letter-spacing: .06em; color: var(--primary); }
.cli-val   { font-size: 1.4rem; font-weight: 700; }
.cli-sub   { font-size: .78rem; color: var(--text-muted, #aaa); }
.cli-total { color: var(--success); font-size: 1.6rem; }
.cli-metric--time   { border: 2px solid var(--primary); }
.cli-metric--total  { border: 2px solid var(--success); }

/* Visitas badge en portal cliente */
.cli-visitas-badge {
    display:       inline-block;
    margin-top:    .3rem;
    font-size:     .82rem;
    font-weight:   600;
    color:         var(--warning, #f5a623);
    letter-spacing:.02em;
}

.cli-items-title { font-size: .95rem; margin: 0 0 .75rem; }
.cli-items-table { width: 100%; border-collapse: collapse; }
.cli-items-table th,
.cli-items-table td {
    padding:       .5rem .7rem;
    border-bottom: 1px solid var(--bg3);
    font-size:     .85rem;
    text-align:    left;
}
.cli-items-table th { background: var(--bg2); }

/* ── WhatsApp button ─────────────────────────────────────── */
.btn-whatsapp {
    display:         inline-flex;
    align-items:     center;
    gap:             .6rem;
    background:      #25d366;
    color:           #fff;
    padding:         .75rem 1.5rem;
    border-radius:   50px;
    font-weight:     600;
    text-decoration: none;
    font-size:       1rem;
    transition:      opacity .15s;
}
.btn-whatsapp:hover { opacity: .88; }
.wa-icon    { width: 24px; height: 24px; }

.btn-whatsapp--sm { padding: .5rem 1rem; font-size: .85rem; }
.wa-icon-sm { width: 18px; height: 18px; }

/* (.btn-secondary se define una sola vez arriba, con color var(--text) — compatible con tema claro) */

/* ── Cliente items section ───────────────────────────────── */
.cliente-items-section {
    background:    var(--bg2);
    border-radius: 12px;
    padding:       1.2rem;
}

/* ════════════════════════════════════════════════════════════
   V3 — Componentes nuevos
   ════════════════════════════════════════════════════════════ */

/* ── Dashboard topbar ────────────────────────────────────── */
.dash-topbar {
    display:     flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap:   wrap;
    gap:         .75rem;
    /* Cabecera fija: no se pierden los botones al hacer scroll con muchas sesiones */
    position:    sticky;
    top:         58px;            /* justo debajo de la navbar (height 58px) */
    z-index:     90;             /* debajo de la navbar (100) y de los modales */
    background:  var(--bg);
    padding:     .7rem 0;
    margin-bottom: 1rem;
    box-shadow:  0 6px 10px -8px rgba(0,0,0,.45);
}
.dash-topbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dash-stats          { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Aforo chip */
.stat-chip--aforo .stat-num  { color: var(--text); }
.stat-chip--aforo             { border-color: var(--primary); }
.aforo--lleno                 { color: var(--danger) !important; }

/* (alerta-stock retirado del dashboard) */

/* ── Sesión card — elementos V3 ──────────────────────────── */
.sesion-meta {
    display:    flex;
    flex-wrap:  wrap;
    align-items: center;
    gap:        .35rem;
    margin-top: .15rem;
}
.sesion-personas {
    font-size: .78rem;
    color:     var(--text2);
}
.casillero-badge {
    display:       inline-flex;
    align-items:   center;
    gap:           .2rem;
    font-size:     .72rem;
    font-weight:   600;
    background:    rgba(79,142,247,.15);
    color:         var(--primary);
    border:        1px solid rgba(79,142,247,.35);
    border-radius: 4px;
    padding:       1px 6px;
}
.sesion-header-btns {
    display:     flex;
    align-items: flex-start;
    gap:         .35rem;
    flex-shrink: 0;
}

/* Ghost icon button */
.btn-ghost {
    background:  transparent;
    border:      1px solid var(--border);
    color:       var(--text2);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--text2); }

.btn-icon {
    padding: .25rem .45rem;
    font-size: .9rem;
    line-height: 1;
}

/* (pre-pago-row retirado: ahora se elige el método al cerrar) */

/* ── Modal tamaños faltantes ──────────────────────────────── */
.modal-md { max-width: 600px; padding: 1.5rem; }

/* ── Autocomplete ────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }

.ac-dropdown {
    position:      absolute;
    top:           calc(100% + 4px);
    left:          0;
    right:         0;
    z-index:       200;
    background:    var(--bg2);
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height:    220px;
    overflow-y:    auto;
    list-style:    none;
    box-shadow:    var(--shadow);
}
.ac-dropdown[hidden] { display: none; }

.ac-item {
    padding:    .55rem .85rem;
    cursor:     pointer;
    font-size:  .875rem;
    border-bottom: 1px solid var(--bg3);
}
.ac-item:last-child   { border-bottom: none; }
.ac-item:hover,
.ac-item.active       { background: var(--bg3); color: var(--primary); }
.ac-item small        { color: var(--text2); font-size: .78rem; }
.ac-nombre { display: block; font-weight: 500; }
.ac-meta   { display: block; font-size: .75rem; color: var(--text2); margin-top: .1rem; }

/* Visitas info badge */
.visitas-info {
    display:       flex;
    align-items:   center;
    gap:           .4rem;
    background:    rgba(79,142,247,.1);
    border:        1px solid rgba(79,142,247,.3);
    border-radius: var(--radius-sm);
    padding:       .4rem .8rem;
    font-size:     .82rem;
    color:         var(--primary);
    margin-bottom: .25rem;
}

/* ── Modal Notas ─────────────────────────────────────────── */
.notas-visitas-badge {
    display:       inline-block;
    background:    rgba(79,142,247,.12);
    color:         var(--primary);
    border-radius: 20px;
    padding:       .3rem .85rem;
    font-size:     .82rem;
    font-weight:   600;
    margin-bottom: .75rem;
}

.notas-lista {
    display:        flex;
    flex-direction: column;
    gap:            .5rem;
    max-height:     260px;
    overflow-y:     auto;
    margin-bottom:  1rem;
}

.nota-item {
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       .6rem .85rem;
    font-size:     .85rem;
    border-left:   3px solid var(--primary);
}
.nota-fecha {
    font-size:  .72rem;
    color:      var(--text2);
    margin-top: .3rem;
}
.nota-texto { margin: 0 0 .2rem; font-size: .875rem; line-height: 1.45; }
.nota-meta  { font-size: .72rem; color: var(--text2); }
.notas-empty {
    color:     var(--text2);
    font-size: .85rem;
    text-align: center;
    padding:   1rem;
}

/* ── Modal Insumos (Gestor) ──────────────────────────────── */
.insumos-dash-list {
    display:        flex;
    flex-direction: column;
    gap:            .4rem;
    max-height:     340px;
    overflow-y:     auto;
    margin-bottom:  1rem;
}

.insumo-item {
    display:       flex;
    align-items:   center;
    gap:           .6rem;
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       .55rem .85rem;
    border-left:   3px solid transparent;
    transition:    border-color .15s;
}
.insumo-item--bajo { border-left-color: var(--danger); background: rgba(224,83,83,.06); }
.insumo-info   { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.insumo-nombre { font-size: .875rem; font-weight: 500; }
.insumo-unidad { font-size: .75rem; color: var(--text2); }
.insumo-stock  { font-size: .78rem; color: var(--text2); }
.insumo-stock strong { color: var(--text); }

/* Low-stock badge inside gesture modal */
.badge-bajo {
    display:       inline-block;
    font-size:     .7rem;
    font-weight:   700;
    padding:       1px 6px;
    border-radius: 20px;
    background:    rgba(224,83,83,.15);
    color:         var(--danger);
    margin-left:   .3rem;
}

/* Generic stock badges for admin table */
.stock-badge {
    font-size:   .75rem;
    font-weight: 700;
    padding:     2px 8px;
    border-radius: 20px;
    background:  rgba(45,190,108,.15);
    color:       var(--success);
}
.stock-badge--bajo {
    background: rgba(224,83,83,.15);
    color:      var(--danger);
}

/* Admin insumos table row (not gesture modal) */
.insumo-row {
    display:       flex;
    align-items:   center;
    gap:           .6rem;
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       .55rem .85rem;
}

.insumo-mov-form {
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       1rem;
    margin-top:    .5rem;
}
.insumo-mov-form h4 { margin: 0 0 .75rem; font-size: .9rem; color: var(--primary); }

/* ── Admin Insumos — vista completa ──────────────────────── */
.insumo-alerta-banner {
    background:    rgba(245,166,35,.1);
    border:        1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding:       .75rem 1rem;
    margin-bottom: 1.25rem;
    font-size:     .875rem;
    color:         var(--warning);
}

.td-stock      { font-weight: 700; }
.stock-ok      { color: var(--success); }
.stock-bajo    { color: var(--danger); }

/* Generic badge */
.badge {
    display:       inline-block;
    padding:       2px 9px;
    border-radius: 20px;
    font-size:     .73rem;
    font-weight:   700;
}
.badge-success { background: rgba(45,190,108,.15); color: var(--success); }
.badge-danger  { background: rgba(224,83,83,.15);  color: var(--danger); }
.badge-warning { background: rgba(245,166,35,.15); color: var(--warning); }

/* ── Reportes — desglose por tipo ────────────────────────── */
.report-desglose {
    background:    var(--bg2);
    border-radius: var(--radius);
    padding:       1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.desglose-title {
    font-size:   .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color:       var(--text2);
    margin:      0 0 .85rem;
}
.desglose-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap:                   .75rem;
}
.desglose-card {
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       .85rem 1rem;
    display:       flex;
    flex-direction: column;
    gap:            .3rem;
}
.desglose-tipo { font-size: .8rem; color: var(--text2); font-weight: 600; }
.desglose-val  { font-size: 1.15rem; font-weight: 700; color: var(--primary); }

/* ── WhatsApp SVG inline ─────────────────────────────────── */
.wa-svg {
    width:    22px;
    height:   22px;
    fill:     #fff;
    flex-shrink: 0;
}
.wa-svg--sm { width: 16px; height: 16px; }

/* ── Vista cliente — ajustes V3 ──────────────────────────── */
.cliente-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cliente-sub  {
    display:     flex;
    align-items: center;
    gap:         .5rem;
    flex-wrap:   wrap;
    color:       var(--text2);
    font-size:   .875rem;
    margin:      .2rem 0 0;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile-first breakpoints
   ════════════════════════════════════════════════════════════ */

/* Pantallas pequeñas (< 480px) */
@media (max-width: 479px) {

    html { font-size: 14px; }

    /* Navbar */
    .navbar { padding: 0 .75rem; }
    .navbar-brand span { display: none; }  /* ocultar texto marca en móvil */

    /* Dashboard topbar */
    .dash-topbar {
        flex-direction: column;
        align-items:    stretch;
    }
    .dash-stats { justify-content: center; }
    .dash-topbar-actions {
        justify-content: stretch;
    }
    .dash-topbar-actions .btn { flex: 1; }

    /* Sesiones grid: 1 columna */
    .sesiones-grid { grid-template-columns: 1fr; }

    /* Modales ocupan casi toda la pantalla */
    .modal { padding: .5rem; align-items: flex-end; }
    .modal-box {
        max-height:    96vh;
        border-radius: var(--radius) var(--radius) 0 0;
        width:         100%;
        max-width:     100% !important;
    }

    /* Formulario ingreso */
    .tariff-row { grid-template-columns: 1fr auto auto auto; }

    /* POS layout: stack vertical */
    .pos-layout { flex-direction: column; }
    .pos-cart-panel { max-width: none; border-left: none; border-top: 1px solid var(--border); }

    /* Admin tabs: scroll horizontal */
    .admin-tabs { overflow-x: auto; white-space: nowrap; }

    /* Admin table: allow scroll */
    .table-wrap { overflow-x: auto; }
    .admin-table { min-width: 560px; }

    /* Contador visual: stack vertical */
    .dash-counters { flex-direction: column; gap: .5rem; }
    .dash-counter-num { font-size: 2rem; }

    /* Reporte summary: 2 col */
    .report-summary { grid-template-columns: 1fr 1fr; }

    /* Botones de filtro apilados */
    .report-filters { flex-wrap: wrap; }
    .report-daterange { flex-direction: column; align-items: flex-start; }

    /* Cliente metrics: 2 col */
    .cliente-metrics { grid-template-columns: 1fr 1fr; }
    .cli-timer { font-size: 1.8rem; }

    /* Botón WA full-block en vacío */
    .cliente-empty .btn-whatsapp { width: 100%; justify-content: center; }
}

/* Pantallas medianas (480px–767px) */
@media (min-width: 480px) and (max-width: 767px) {

    /* Sesiones grid: 2 columnas cuando caben */
    .sesiones-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

    /* Modales: centrados pero sin ocupar todo */
    .modal-box { max-width: 90vw; }
    .modal-sm  { max-width: 420px; }

    /* POS layout: stack */
    .pos-layout { flex-direction: column; }
    .pos-cart-panel { max-width: none; border-left: none; border-top: 1px solid var(--border); }

    /* Admin tabs scroll */
    .admin-tabs { overflow-x: auto; white-space: nowrap; }
    .table-wrap { overflow-x: auto; }

    /* Reporte summary 2 col */
    .report-summary { grid-template-columns: 1fr 1fr; }
}

/* Tablets (768px–1023px) */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Sesiones: 2 columnas */
    .sesiones-grid { grid-template-columns: repeat(2, 1fr); }

    /* POS: mantener side-by-side si hay espacio */
    .pos-layout { flex-direction: row; }

    /* Summary: 4 col */
    .report-summary { grid-template-columns: repeat(4, 1fr); }
}

/* ════════════════════════════════════════════════════════════
   Utilidades adicionales
   ════════════════════════════════════════════════════════════ */
.btn-lg   { padding: .75rem 1.5rem; font-size: 1rem; }
.nowrap   { white-space: nowrap; }
.td-fecha { white-space: nowrap; font-size: .8rem; }
.td-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.td-dni, .td-creado { font-size: .82rem; color: var(--text2); }
.td-gestor { font-size: .8rem; color: var(--text2); white-space: nowrap; }

/* ── Contador visual grande de actividad ──────────────────── */
.dash-counters {
    display:   flex;
    gap:       1rem;
    padding:   .75rem 0;
    margin-bottom: .5rem;
}
.dash-counter {
    flex:          1;
    display:       flex;
    flex-direction: column;
    align-items:   center;
    gap:           .25rem;
    background:    var(--bg2);
    border-radius: var(--radius);
    padding:       1rem .5rem;
    border:        1px solid var(--border);
}
.dash-counter-num {
    font-size:   2.8rem;
    font-weight: 800;
    line-height: 1;
}
.dash-counter-lbl {
    font-size:  .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color:      var(--text2);
}
.dash-counter--ingresos .dash-counter-num { color: var(--success); }
.dash-counter--pedidos  .dash-counter-num { color: var(--warning); }

/* ── Filtro de rango de fechas en reportes ────────────────── */
.report-daterange {
    display:     flex;
    align-items: center;
    gap:         .75rem;
    flex-wrap:   wrap;
    padding:     .75rem 1rem;
    background:  var(--bg2);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size:   .875rem;
    color:       var(--text2);
}
.input-date {
    padding:       .4rem .6rem;
    background:    var(--bg3);
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    color:         var(--text);
    font-size:     .875rem;
}
.input-date:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

/* ════════════════════════════════════════════════════════════
   IMPRESIÓN — Ticket térmico (único bloque @media print)
   ════════════════════════════════════════════════════════════ */
@media print {
    @page { size: 80mm auto; margin: 3mm 2mm; }

    /* Ocultar toda la UI, mostrar solo #print-area */
    body > *    { display: none !important; }
    #print-area { display: block !important; }

    #print-area {
        position: static !important;
        padding:  0 !important;
        margin:   0 !important;
    }

    * {
        print-color-adjust:         exact !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust:               exact !important;
    }

    body, #print-area        { background: #fff !important; color: #000 !important; }
    .ticket-wrap             { font-family: 'Courier New', monospace; font-size: 8pt; width: 72mm; background: #fff !important; color: #000 !important; }
    .ticket-thermal          { padding: 0; background: #fff !important; }
    .ticket-local            { font-size: 11pt; color: #000 !important; }
    .ticket-total-block,
    .ticket-total-block span { font-size: 11pt; color: #000 !important; }
    .ticket-sep              { border-top: 1px dashed #000; margin: 2mm 0; }
    .no-print                { display: none !important; }
}

/* ════════════════════════════════════════════════════════════
   NUEVOS COMPONENTES V4
   ════════════════════════════════════════════════════════════ */

/* ── print-area (fuera de pantalla en modo normal) ─────── */
.print-only { display: none; }

/* ── Stats row con pills extra ─────────────────────────── */
.admin-stats-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.stat-pill.ok  { color: var(--success); border-color: var(--success); }
.stat-pill.sec { color: #b07cff; border-color: #7e4cdb; }

/* ── Filter bar ─────────────────────────────────────────── */
.filter-bar {
    display:       flex;
    gap:           .65rem;
    flex-wrap:     wrap;
    align-items:   center;
    margin-bottom: 1.25rem;
}
.filter-bar select {
    background: var(--bg2);
    border:     1px solid var(--border);
    color:      var(--text);
    padding:    .4rem .75rem;
    border-radius: var(--radius-sm);
    font-size:  .875rem;
    cursor:     pointer;
}
.input-search {
    padding:       .4rem .75rem;
    background:    var(--bg2);
    border:        1px solid var(--border);
    border-radius: var(--radius-sm);
    color:         var(--text);
    font-size:     .875rem;
    min-width:     180px;
    flex:          1;
}
.input-search:focus { outline: none; border-color: var(--primary); }

/* ── 2FA badges in user table ──────────────────────────── */
.badge-2fa-on  { font-size: .95rem; }
.badge-2fa-off { color: var(--text2); font-size: .85rem; }
.td-2fa        { text-align: center; }

/* ── Top clientes section ──────────────────────────────── */
.top-clientes-section { margin-top: 2rem; }
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }

.top-clientes-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap:                   .75rem;
}
.top-cliente-card {
    display:       flex;
    align-items:   center;
    gap:           .75rem;
    background:    var(--bg2);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       .75rem 1rem;
    transition:    border-color var(--transition);
}
.top-cliente-card:hover { border-color: var(--primary); }
.top-cliente-avatar {
    width:         36px; height: 36px;
    border-radius: 50%;
    background:    var(--primary);
    color:         var(--primary-text);
    font-weight:   700;
    display:       flex;
    align-items:   center;
    justify-content: center;
    font-size:     1rem;
    flex-shrink:   0;
}
.top-cliente-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.top-cliente-info strong { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-cliente-info small  { font-size: .75rem; color: var(--text2); }
.top-cliente-visitas {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            .05rem;
    flex-shrink:    0;
}
.top-cliente-visitas span  { font-size: 1.25rem; font-weight: 700; color: var(--success); line-height: 1; }
.top-cliente-visitas small { font-size: .7rem; color: var(--text2); }

/* ── Stock info in productos table ─────────────────────── */
.stock-info     { display: flex; flex-direction: column; gap: .1rem; }
.stock-disp     { font-size: .85rem; font-weight: 700; }
.stock-disp.ok     { color: var(--success); }
.stock-disp.agotado{ color: var(--danger); }
.stock-detail   { font-size: .72rem; color: var(--text2); }

/* ── Config: tipos persona toggle cards ────────────────── */
.tipos-persona-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap:                   .75rem;
    margin-bottom:         1.25rem;
}
.tipo-toggle-card {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            .4rem;
    background:     var(--bg3);
    border:         2px solid var(--border);
    border-radius:  var(--radius);
    padding:        1rem .75rem;
    cursor:         pointer;
    transition:     border-color var(--transition), background var(--transition);
    text-align:     center;
    user-select:    none;
}
.tipo-toggle-card input { display: none; }
.tipo-toggle-card.active {
    border-color: var(--primary);
    background:   rgba(79,142,247,.08);
}
.tipo-toggle-icon   { font-size: 1.75rem; }
.tipo-toggle-label  { font-size: .85rem; font-weight: 600; }
.tipo-toggle-status {
    font-size:  .72rem;
    font-weight: 600;
    padding:    2px 8px;
    border-radius: 20px;
    background: rgba(224,83,83,.12);
    color: var(--danger);
}
.tipo-toggle-card.active .tipo-toggle-status {
    background: rgba(45,190,108,.12);
    color:      var(--success);
}

/* ── Chart wrap for reportes ───────────────────────────── */
.chart-wrap {
    background:    var(--bg2);
    border-radius: var(--radius);
    padding:       1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.chart-title {
    font-size:   .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color:       var(--text2);
    margin:      0 0 1rem;
}

/* ── OTP input ──────────────────────────────────────────── */
.input-otp {
    letter-spacing: .35em;
    text-align:     center;
    font-size:      1.5rem;
    font-weight:    700;
    font-variant-numeric: tabular-nums;
}

/* ── Login footer ───────────────────────────────────────── */
.login-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text2); }
.login-footer a { color: var(--text2); }
.login-footer a:hover { color: var(--primary); }

/* ── input password wrap (ojo) ─────────────────────────── */
.input-password-wrap { position: relative; }
.input-password-wrap input { padding-right: 2.5rem; }
.btn-eye {
    position:   absolute;
    right:      .5rem; top: 50%;
    transform:  translateY(-50%);
    background: none;
    border:     none;
    cursor:     pointer;
    font-size:  1rem;
    color:      var(--text2);
    padding:    .2rem;
    line-height: 1;
}
.btn-eye:hover { color: var(--text); }

/* ── 2FA: setup page ────────────────────────────────────── */
.twofa-page { max-width: 520px; margin: 0 auto; }
.twofa-card {
    background:    var(--bg2);
    border:        1px solid var(--border);
    border-radius: var(--radius);
    padding:       2rem 1.75rem;
}
.twofa-card h2 { font-size: 1.35rem; margin-bottom: 1.25rem; }

.twofa-activo { text-align: center; padding: 1.5rem 0 .5rem; }
.twofa-check  { font-size: 3rem; margin-bottom: .5rem; }

.twofa-desactivar-section {
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       1.25rem;
    margin-top:    1.25rem;
}
.twofa-desactivar-section h4 { font-size: .95rem; margin-bottom: .35rem; }

.twofa-steps { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.twofa-step {
    display:       flex;
    align-items:   flex-start;
    gap:           .75rem;
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       .75rem 1rem;
    font-size:     .875rem;
}
.twofa-step-num {
    width:          24px; height: 24px;
    background:     var(--primary);
    color:          var(--primary-text);
    border-radius:  50%;
    display:        flex;
    align-items:    center;
    justify-content:center;
    font-size:      .8rem;
    font-weight:    700;
    flex-shrink:    0;
}

.twofa-qr-section { display: flex; gap: 1.5rem; align-items: flex-start; margin: 1.25rem 0; }
.twofa-qr-canvas  { flex-shrink: 0; background: #fff; padding: 6px; border-radius: 8px; }

.twofa-secret-wrap { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.twofa-secret-wrap label { font-size: .8rem; color: var(--text2); }
.twofa-secret-box {
    display:       flex;
    align-items:   center;
    gap:           .5rem;
    background:    var(--bg3);
    border-radius: var(--radius-sm);
    padding:       .5rem .75rem;
    flex-wrap:     wrap;
}
.twofa-secret-box code {
    font-family:   monospace;
    font-size:     .95rem;
    letter-spacing: .08em;
    color:         var(--text);
    word-break:    break-all;
}

.twofa-back { text-align: center; margin-top: 1.5rem; font-size: .875rem; }
.twofa-activo-badge {
    background:    rgba(45,190,108,.1);
    border:        1px solid var(--success);
    border-radius: var(--radius-sm);
    padding:       1rem 1.25rem;
    color:         var(--success);
    font-size:     .9rem;
    text-align:    center;
    margin:        1rem 0;
}

/* ── Responsive extras ──────────────────────────────────── */
@media (max-width: 479px) {
    .twofa-qr-section { flex-direction: column; align-items: center; }
    .top-clientes-grid { grid-template-columns: 1fr 1fr; }
    .tipos-persona-grid { grid-template-columns: repeat(3, 1fr); }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .input-search { min-width: unset; }
}

/* ════════════════════════════════════════════════════════════
   EFECTOS MODERNOS (nativos, inspirados en 21st.dev)
   ════════════════════════════════════════════════════════════ */

/* Tarjeta destacada con barrido de brillo sutil */
.summary-card--highlight {
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}
.summary-card--highlight::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 50%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
    transform: skewX(-18deg);
    animation: shine-sweep 4.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shine-sweep {
    0%, 60%  { left: -60%; }
    100%     { left: 140%; }
}

/* Tarjetas de sesión: elevación suave tipo resorte */
.sesion-card {
    transition: transform .28s cubic-bezier(.34,1.56,.64,1),
                border-color var(--transition),
                box-shadow var(--transition);
}
.sesion-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,.28);
}

/* Entrada con fundido para tarjetas al cargar */
@media (prefers-reduced-motion: no-preference) {
    .sesion-card, .summary-card, .config-card {
        animation: card-in .35s cubic-bezier(.4,0,.2,1) both;
    }
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Botón primario: realce de luz al pasar el cursor */
.btn-primary, .btn-success, .btn-danger, .btn-warning {
    background-size: 100% 100%;
}

/* ════════════════════════════════════════════════════════════
   APARIENCIA — Selector de tema en admin/config
   ════════════════════════════════════════════════════════════ */
.apariencia-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 600px) {
    .apariencia-grid { grid-template-columns: 1fr; }
}

.theme-mode-pills {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
}
.theme-pill {
    flex: 1;
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg3);
    cursor: pointer;
    transition: all .15s;
    user-select: none;
    font-weight: 600;
}
.theme-pill input { display: none; }
.theme-pill:hover { border-color: var(--text3); }
.theme-pill.active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--bg3));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.theme-pill-ico { font-size: 1.3rem; line-height: 1; }

.color-picker-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}
.color-picker-row input[type="color"] {
    width: 52px;
    height: 38px;
    padding: 2px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg3);
}
.color-hex-label {
    font-family: monospace;
    font-size: .85rem;
    color: var(--text);
    background: var(--bg3);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    min-width: 84px;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════
   THEME TOGGLE & LIGHT-THEME TWEAKS
   ════════════════════════════════════════════════════════════ */
.theme-toggle {
    background:    var(--bg3);
    border:        1px solid var(--border);
    color:         var(--text);
    width:         36px;
    height:        36px;
    border-radius: 50%;
    cursor:        pointer;
    display:       inline-flex;
    align-items:   center;
    justify-content: center;
    font-size:     1.05rem;
    transition:    transform .25s cubic-bezier(.4,0,.2,1),
                   background var(--transition),
                   border-color var(--transition),
                   box-shadow var(--transition);
    padding:       0;
    line-height:   1;
}
.theme-toggle:hover {
    background:    var(--bg-elevated);
    border-color:  var(--primary);
    transform:     rotate(20deg);
    box-shadow:    0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
}
.theme-toggle:active { transform: rotate(180deg); }

/* Ajustes específicos del tema CLARO */
[data-theme="light"] body {
    background: linear-gradient(180deg, #f4f6fa 0%, #ebf0f7 100%);
    background-attachment: fixed;
}
[data-theme="light"] .navbar    { background: rgba(255,255,255,.92); }
[data-theme="light"] .sesion-card,
[data-theme="light"] .config-card,
[data-theme="light"] .modal-box,
[data-theme="light"] .summary-card,
[data-theme="light"] .admin-page,
[data-theme="light"] .stat-chip { box-shadow: var(--shadow-sm); }

[data-theme="light"] .pedido-row { background: #f7f9fc; border-left-color: var(--warning); }
[data-theme="light"] .pedido-info:hover { background: rgba(0,0,0,.025); }
[data-theme="light"] .rol-badge { background: var(--bg3); }

[data-theme="light"] .login-body {
    background: radial-gradient(ellipse at 50% 25%, #d6e1f5 0%, #f4f6fa 70%);
}
[data-theme="light"] .alert-error {
    background: rgba(220,38,38,.08);
    color: var(--danger);
    border-color: var(--danger);
}
[data-theme="light"] .alert-success {
    background: rgba(22,163,74,.08);
    color: var(--success);
    border-color: var(--success);
}

/* Toast (notificaciones) */
.toast {
    position: fixed; right: 24px; bottom: 24px;
    z-index: 9999;
    padding: .75rem 1.25rem;
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    animation: toast-in .25s cubic-bezier(.4,0,.2,1);
}
.toast-ok { background: linear-gradient(180deg, var(--success), var(--success-dk)); }
@keyframes toast-in {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet y Móvil (mejoras de Sprint actual)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .pos-layout         { flex-direction: column; }
    .pos-cart-panel     { max-height: 50vh; overflow-y: auto; }
    .pago-options-grid  { grid-template-columns: 1fr; }
    .detalle-item       { grid-template-columns: 30px 1fr auto; }
    .detalle-item .detalle-sub { grid-column: 1 / -1; text-align: right; }
}

@media (max-width: 600px) {
    .dash-topbar          { flex-direction: column; gap: .6rem; align-items: stretch; }
    .dash-topbar-actions  { justify-content: space-between; }
    .dash-counters        { grid-template-columns: 1fr 1fr; }
    .sesiones-grid        { grid-template-columns: 1fr; }
    .report-filters       { flex-wrap: wrap; gap: .35rem; }
    .report-filters .filter-label { width: 100%; }
    .summary-card         { padding: .75rem .9rem; }
    .summary-val          { font-size: 1.1rem; }
    .modal-box            { max-width: 96vw; max-height: 96vh; }
    .modal-pos-box        { max-width: 100vw; max-height: 100vh; border-radius: 0; }
    .pedido-row           { padding: .45rem .55rem; }
    .pedido-actions       { flex-direction: column; }
    .pedido-actions .btn  { padding: .25rem .55rem; }
}

/* ════════════════════════════════════════════════════════════
   REPORTES — estilo profesional + tarjetas clicables
   ════════════════════════════════════════════════════════════ */
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 720px) { .report-summary { grid-template-columns: 1fr 1fr; } }

/* Acento de color por tarjeta (sin tocar la destacada) */
.summary-card:not(.summary-card--highlight) {
    position: relative; overflow: hidden;
    border: 1px solid var(--border);
}
.summary-card:not(.summary-card--highlight)::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--text3); opacity: .85;
}
.report-summary .summary-card:nth-child(1)::before { background: #4f8ef7; }
.report-summary .summary-card:nth-child(2)::before { background: #22c55e; }
.report-summary .summary-card:nth-child(3)::before { background: #f59e0b; }

.filter-label { font-size: .8rem; color: var(--text2); font-weight: 700; margin-right: .25rem; }

/* Contenedor del gráfico */
.chart-wrap {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem; box-shadow: var(--shadow-sm);
}
.chart-title  { font-size: .95rem; color: var(--text2); font-weight: 700; margin-bottom: .85rem; }

/* Desglose */
.report-desglose {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem;
}
.desglose-title { font-size: .95rem; color: var(--text2); font-weight: 700; margin-bottom: .85rem; }
.desglose-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }

.desglose-card {
    --dg: #4f8ef7;
    text-align: left; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; gap: .2rem;
    background: var(--bg3); border: 1px solid var(--border);
    border-left: 4px solid var(--dg);
    border-radius: 10px; padding: .7rem .85rem;
    transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.desglose-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.desglose-card.is-active { background: color-mix(in srgb, var(--dg) 16%, var(--bg3)); }
.desglose-tipo { font-size: .82rem; font-weight: 700; color: var(--text); }
.desglose-val  { font-size: 1.3rem;  font-weight: 800; color: var(--dg); }
.desglose-hint { font-size: .66rem; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }

/* Comentarios del cliente (modal del panel Usuarios) */
.ncli-lista { display: flex; flex-direction: column; gap: .5rem; max-height: 320px; overflow-y: auto; }
.ncli-item {
    display: flex; gap: .6rem; align-items: flex-start; justify-content: space-between;
    background: var(--bg3); border: 1px solid var(--border);
    border-left: 3px solid var(--warning); border-radius: 8px; padding: .6rem .75rem;
}
.ncli-item-body p     { font-size: .9rem; line-height: 1.4; margin: 0 0 .25rem; }
.ncli-item-body small { font-size: .72rem; color: var(--text3); }

/* Columna de comentario en la tabla de usuarios */
.td-comentario { white-space: nowrap; }

/* ════════════════════════════════════════════════════════════
   POS — barra de búsqueda de productos
   ════════════════════════════════════════════════════════════ */
.pos-search-bar {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
}
.pos-search-bar input {
    width: 100%; padding: .55rem .85rem;
    border-radius: 8px; border: 1px solid var(--border);
    background: var(--input-bg); color: var(--text); font-size: .9rem;
}
.pos-search-bar input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

/* ════════════════════════════════════════════════════════════
   ESTADO DE CUENTA — modal "¿cuánto va mi cuenta?"
   ════════════════════════════════════════════════════════════ */
.cuenta-rows { display: flex; flex-direction: column; gap: .3rem; }
.cuenta-line { display: flex; justify-content: space-between; align-items: center; font-size: .92rem; padding: .15rem 0; }
.cuenta-sep  { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text3);
               border-bottom: 1px dashed var(--border); padding-bottom: .25rem; margin-top: .5rem; }
.cuenta-item { display: grid; grid-template-columns: 34px 1fr auto auto; gap: .5rem; align-items: center; font-size: .88rem; padding: .2rem 0; }
.cuenta-cant { font-weight: 800; color: var(--primary); }
.cuenta-nombre { display: flex; flex-direction: column; line-height: 1.25; }
.cuenta-cat  { font-size: .64rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text3); }
.cuenta-cat-Cocina   { color: #f59e0b; }
.cuenta-cat-Alquiler { color: #22c55e; }
.cuenta-cat-General  { color: #a78bfa; }
.cuenta-sub  { font-weight: 700; color: var(--success); }
.cuenta-total {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 1rem; padding: .85rem 1rem; border-radius: 10px;
    background: var(--bg); border: 1px solid var(--border);
    font-size: 1.15rem; font-weight: 800;
}
.cuenta-total span:last-child { color: var(--success); }

/* Checkbox en línea (quitar imagen, etc.) */
.checkbox-line { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text2); cursor: pointer; }
.checkbox-line input { width: auto; }

/* ════════════════════════════════════════════════════════════
   ALERTA DE LÍMITE DE INGRESOS (dashboard)
   ════════════════════════════════════════════════════════════ */
.alerta-limite {
    margin-bottom: 1.25rem;
    padding: .8rem 1.1rem;
    border-radius: 10px;
    font-size: .92rem;
    border: 1px solid;
    display: flex; align-items: center; gap: .5rem;
    animation: card-in .3s ease both;
}
.alerta-limite--warn {
    background: color-mix(in srgb, var(--warning) 14%, var(--bg2));
    border-color: var(--warning);
    color: var(--warning);
}
.alerta-limite--over {
    background: color-mix(in srgb, var(--danger) 14%, var(--bg2));
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}
.alerta-limite strong { color: inherit; }

/* Marco de botones secundarios más visible en tema claro */
[data-theme="light"] .btn-secondary { border-color: #cfd6e3; }
[data-theme="light"] .report-filters .btn-secondary { background: #fff; border-color: #c7cdda; }

/* Botón de notas con aviso (cliente con comentarios) */
.notas-btn { position: relative; overflow: visible; }
/* (6b) Resaltar claramente el botón SOLO cuando el cliente tiene una nota */
.notas-btn.has-notas {
    border-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 22%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 45%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
    .notas-btn.has-notas { animation: notas-pulse 2s ease-in-out infinite; }
}
@keyframes notas-pulse {
    0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 45%, transparent); }
    50%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 25%, transparent); }
}
.notas-badge {
    position: absolute; top: -7px; right: -7px;
    background: var(--warning); color: #15192b;
    font-size: .62rem; font-weight: 800;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 10px; line-height: 16px; text-align: center;
}


/* ════════════════════════════════════════════════════════════
   INSTRUCCIONES DE FER — Fases 1-3 (Jun 2026)
   ════════════════════════════════════════════════════════════ */

/* (4) Búsqueda en vivo de sesiones en la barra superior */
.dash-search-wrap { flex: 1 1 220px; max-width: 360px; }
.dash-search-wrap input {
    width: 100%; padding: .5rem .85rem; border-radius: 20px;
    border: 1px solid var(--border); background: var(--bg2); color: var(--text);
    font-size: .9rem;
}
.dash-search-wrap input:focus { outline: none; border-color: var(--primary); }

/* (8) Banner superior de deudas pendientes */
.alerta-deudas {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding: .6rem .9rem; margin-bottom: 1rem; border-radius: 10px;
    background: color-mix(in srgb, var(--warning) 16%, var(--bg2));
    border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
    color: var(--text); font-size: .9rem;
}
.deuda-banner-ico { font-size: 1.2rem; }
.deuda-chips { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1; }
.deuda-chip {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; padding: .15rem .55rem; font-size: .78rem;
}
.alerta-deudas .btn { margin-left: auto; }

/* (1) Desglose de la entrada en el modal de cuenta */
.cuenta-line--click { cursor: pointer; user-select: none; }
.cuenta-arrow { display: inline-block; width: 1em; color: var(--primary); font-size: .8em; transition: transform .15s; }
.cuenta-desglose {
    margin: .1rem 0 .45rem 1.2rem; padding: .35rem .55rem;
    border-left: 2px solid var(--border); display: grid; gap: .25rem;
}
.cuenta-desglose-row {
    display: grid; grid-template-columns: 1fr auto auto; gap: .7rem;
    font-size: .82rem; color: var(--text2);
}
.cuenta-desglose-row span:last-child { text-align: right; min-width: 72px; font-weight: 600; color: var(--text); }

/* (3) Nota editable en el detalle de pedido */
.detalle-nota-edit {
    margin: .6rem 0; padding: .6rem .7rem; border-radius: 8px;
    background: var(--bg); border: 1px dashed var(--border);
}
.detalle-nota-lbl { display: block; font-size: .82rem; color: var(--text2); margin-bottom: .35rem; }
.detalle-nota-lbl small { color: var(--primary); }
.detalle-nota-edit textarea {
    width: 100%; resize: vertical; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg2); color: var(--text); padding: .45rem .6rem; font-size: .88rem;
}
.detalle-nota-actions { display: flex; align-items: center; gap: .6rem; margin-top: .45rem; }
.detalle-nota-ok { color: var(--success); font-size: .82rem; font-weight: 600; }

/* (2b) Sesiones finalizadas del día */
.fin-resumen {
    display: flex; justify-content: space-between; align-items: center; gap: .6rem;
    padding: .5rem .75rem; margin-bottom: .75rem; border-radius: 8px;
    background: var(--bg2); border: 1px solid var(--border); font-size: .9rem;
}
.fin-resumen strong { color: var(--success); }
.fin-lista { display: flex; flex-direction: column; gap: .5rem; max-height: 60vh; overflow-y: auto; }
.fin-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem; border-radius: 8px;
    background: var(--bg); border: 1px solid var(--border);
}
.fin-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fin-nombre { font-weight: 600; }
.fin-meta { font-size: .76rem; color: var(--text2); }
.fin-montos { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.fin-detalle { font-size: .72rem; color: var(--text2); }
.fin-total { font-weight: 700; color: var(--success); }

/* (8) Modal de gestión de deudas */
.deuda-sep { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.deudas-lista { display: flex; flex-direction: column; gap: .5rem; max-height: 45vh; overflow-y: auto; }
.deuda-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .7rem; border-radius: 8px;
    background: var(--bg); border: 1px solid var(--border);
}
.deuda-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.deuda-cli { font-weight: 600; }
.deuda-meta { font-size: .74rem; color: var(--text2); }
.deuda-nota-txt { font-size: .8rem; color: var(--text); font-style: italic; }
.deuda-monto-val { font-weight: 700; color: var(--warning); white-space: nowrap; }

/* (9) Boleta de cierre más amplia y legible en pantalla (no afecta la impresión térmica) */
.modal-ticket-box { max-width: 460px; width: 92vw; }
.ticket-wrap  { font-size: 1rem; line-height: 1.5; padding: 1.1rem 1.25rem; }
.ticket-local { font-size: 1.35rem; }
.ticket-fecha { font-size: .9rem; }
.ticket-data, .ticket-items { font-size: .98rem; }
.ticket-total-block, .ticket-tr-total td { font-size: 1.15rem; }

/* Móvil: la barra superior apila búsqueda y acciones */
@media (max-width: 760px) {
    .dash-search-wrap { order: 3; max-width: none; width: 100%; }
}


/* ════════════════════════════════════════════════════════════
   LÍMITES POR MÉTODO + PAGO MIXTO + QUITAR ITEM (Jun 2026)
   ════════════════════════════════════════════════════════════ */

/* (#1) Chips de límite por método en el banner de alerta */
.limite-metodo-chip {
    display: inline-block; margin: .15rem .15rem .15rem .4rem;
    padding: .12rem .55rem; border-radius: 12px;
    font-size: .8rem; font-weight: 700; background: rgba(0,0,0,.15);
}
.limite-metodo-chip--warn { background: color-mix(in srgb, var(--warning) 32%, transparent); }
.limite-metodo-chip--over { background: color-mix(in srgb, var(--danger) 38%, transparent); }

/* (#3) Modal de pago mixto */
.pago-total-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .5rem .75rem; border-radius: 8px; margin-bottom: .3rem;
    background: var(--bg2); border: 1px solid var(--border);
}
.pago-total-row strong { font-size: 1.25rem; color: var(--primary); }
.pago-metodos { display: flex; flex-direction: column; gap: .5rem; margin: .3rem 0; }
.pago-metodo-row { display: flex; align-items: center; gap: .5rem; }
.pago-metodo-lbl { flex: 1; font-weight: 600; }
.pago-monto {
    width: 110px; text-align: right; padding: .4rem .55rem;
    border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg2); color: var(--text); font-size: 1rem;
}
.pago-monto:focus { outline: none; border-color: var(--primary); }
.pago-resumen { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; font-size: .92rem; }
.pago-restante { font-weight: 700; padding: .15rem .55rem; border-radius: 10px; }
.pago-falta  { color: var(--danger);  background: color-mix(in srgb, var(--danger) 14%, transparent); }
.pago-sobra  { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.pago-cuadra { color: var(--success); background: color-mix(in srgb, var(--success) 16%, transparent); }

/* (#2) Botón quitar producto en el modal de cuenta */
.cuenta-quitar {
    margin-left: .35rem; border: none; cursor: pointer; flex: none;
    width: 22px; height: 22px; border-radius: 50%;
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    color: var(--danger); font-weight: 800; line-height: 1; font-size: .8rem;
}
.cuenta-quitar:hover { background: var(--danger); color: #fff; }

/* (#3) Panel de ingresos por método en reportes (reusa estilos .desglose-card) */
.pagos-metodo-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem;
}


