/* ============================================================================
 * ARCHIVO: styles.css
 * PROYECTO: JOGAKE POS - Sistema de Caja e Inventario
 * PROPÓSITO: Estética moderna tipo Bento / iOS, recibo de caja en curso con
 *            columnas reales, scroll vertical fluido en móvil, vitrina en
 *            baldosas y factura al costado en 768px / 1024px / 1440px.
 * ============================================================================ */

:root {
    --bg-app: #f3f5f8;
    --bg-surface: #ffffff;
    --bg-soft: #f8fafc;
    --ink-main: #0f172a;
    --ink-muted: #64748b;
    --line-soft: #e2e8f0;
    --line-card: #cbd5e1;
    --brand-blue: #0284c7;
    --brand-blue-dark: #0369a1;
    --brand-green: #16a34a;
    --brand-green-dark: #15803d;
    --radius-card: 20px;
    --radius-btn: 14px;
    --radius-input: 12px;
    --shadow-card: 0 6px 20px rgba(15, 23, 42, 0.045);
    --shadow-float: 0 14px 34px rgba(2, 132, 199, 0.14);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    min-height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-app);
    color: var(--ink-main);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
 * VISTA TIENDA CLIENTE (VITRINA TIPO MARKETPLACE)
 * ========================================================================== */
#vista-tienda-cliente {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-app);
    overflow-x: hidden;
    padding-bottom: 54px;
}

.tienda-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 50;
}

.tienda-cart-btn {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tienda-cart-btn:active {
    transform: scale(0.96);
}

/* ==========================================================================
 * BANNER PWA Y PORTADA DE BIENVENIDA
 * ========================================================================== */
#pwa-install-banner {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 950;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid #bae6fd;
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: var(--shadow-float);
}

.pwa-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pwa-banner-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-banner-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
}

.pwa-banner-icon svg {
    width: 100%;
    height: 100%;
    fill: #ffffff;
}

.pwa-banner-text strong {
    display: block;
    font-size: 0.82rem;
    color: var(--ink-main);
}

.pwa-banner-text span {
    font-size: 0.68rem;
    color: var(--ink-muted);
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-instalar-pwa {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 7px 12px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.btn-cerrar-pwa {
    background: #f1f5f9;
    color: var(--ink-muted);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-weight: bold;
    cursor: pointer;
}

#pantalla-bienvenida {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: radial-gradient(circle at 15% 15%, #e0f2fe 0%, transparent 45%),
                radial-gradient(circle at 85% 25%, #f0fdf4 0%, transparent 45%),
                #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.landing-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 14px;
    border-radius: 9999px;
    border: 1px solid var(--line-soft);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.landing-brand-pill {
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--brand-blue);
    letter-spacing: 0.4px;
}

.btn-pill-outline {
    background: #ffffff;
    color: var(--ink-main);
    border: 1px solid var(--line-card);
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.16s ease;
}

.btn-pill-outline:active {
    transform: scale(0.96);
    background: #f1f5f9;
}

.landing-hero {
    max-width: 440px;
    width: 100%;
    margin: auto;
    background: #ffffff;
    border-radius: 28px;
    padding: 26px 20px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}

.landing-icon-badge {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    padding: 13px;
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.25);
}

.landing-features {
    width: 100%;
    background: #f8fafc;
    border-radius: 18px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    gap: 9px;
    text-align: left;
    font-size: 0.74rem;
    color: #334155;
}

.landing-feature-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.feature-check-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.65rem;
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 1px;
}

.btn-enter-main {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.25);
    transition: transform 0.15s ease;
}

.btn-enter-main:active {
    transform: scale(0.98);
}

.btn-google-modern {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    padding: 12px 18px;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-google-modern:hover {
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.btn-google-modern:active {
    transform: scale(0.98);
}

.btn-google-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
 * HEADER PRINCIPAL
 * ========================================================================== */
.app-header-modern {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.035);
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
}

.header-row-top, .header-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.brand-block {
    min-width: 0;
}

.brand-block h2 {
    font-size: 0.94rem;
    font-weight: 900;
    color: var(--ink-main);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.badge-plan {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 9999px;
    cursor: pointer;
}

.btn-text-salir {
    background: #f1f5f9;
    border: none;
    color: #475569;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 9999px;
    cursor: pointer;
}

.header-actions-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.btn-icon-top {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: #f8fafc;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.12s ease;
}

.btn-icon-top:hover {
    background: #e0f2fe;
}

.btn-icon-top:active {
    transform: scale(0.94);
}

.status-pill-mini {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    padding: 4px 9px;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 800;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

.ticker-tasas-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.66rem;
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    padding: 5px 10px;
    border-radius: 9999px;
    border: 1px solid var(--line-soft);
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
    min-width: 0;
}

.selector-tasas-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.btn-config-mini {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: #f8fafc;
    cursor: pointer;
    flex-shrink: 0;
}

/* ==========================================================================
 * ÁREA PRINCIPAL Y PESTAÑAS
 * ========================================================================== */
.view-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: visible;
    padding-bottom: 54px;
}

.app-view, .app-canvas {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: visible;
}

.nav-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 10px 4px 10px;
    flex-shrink: 0;
    width: 100%;
}

.nav-tab-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
    border-radius: 9999px;
    border: 1px solid var(--line-soft);
    background: #ffffff;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    transition: all 0.16s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.nav-tab-btn.active-pos {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.24);
}

.nav-tab-btn.active-inv {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.24);
}

.nav-tab-btn.active-cat {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.24);
}

.badge-notif-red {
    position: absolute;
    top: -4px;
    right: 6px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 9999px;
}

/* ==========================================================================
 * DISTRIBUCIÓN POS Y DISEÑO DE RECIBO / FACTURA EN CURSO
 * ========================================================================== */
#seccion-pos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 10px 10px 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

.ticket-live-card {
    background: var(--bg-surface);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-card);
    padding: 10px 12px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 100%;
}

.ticket-paper-look {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border: 1.5px solid #cbd5e1;
    border-top: 4px solid #0284c7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    position: relative;
}

.ticket-receipt-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 6px 10px;
}

.ticket-live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
    flex-shrink: 0;
}

.ticket-count-pill {
    background: #ffffff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
}

.btn-trash-mini {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 26px;
    height: 26px;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ticket-columns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.6rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
}

.ticket-empty-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 8px,
        #f1f5f9 8px,
        #f1f5f9 16px
    );
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    text-align: center;
}

.ticket-serrated-divider {
    height: 1px;
    border-top: 2px dashed #cbd5e1;
    margin: 2px 0;
}

.ticket-total-visor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 14px;
    padding: 8px 12px;
    gap: 8px;
}

.ticket-items-box {
    overflow-y: auto;
    max-height: 125px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 2px;
}

.ticket-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 6px 10px;
}

.pos-grid-container {
    background: var(--bg-surface);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-card);
    padding: 10px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

/* En móvil (< 768px): 2 columnas x 2 filas para que ningún botón se corte */
@media (max-width: 767px) {
    .ticket-live-card div[style*="repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .ticket-live-card .btn-neon-action {
        font-size: 0.72rem !important;
        padding: 8px 6px !important;
    }

    .barra-acciones-diarias {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .barra-acciones-diarias .btn-neon-action {
        font-size: 0.74rem !important;
        padding: 10px 8px !important;
    }
}

@media (min-width: 768px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .view-container {
        height: calc(100vh - 84px);
        min-height: 0;
        overflow: hidden;
        padding-bottom: 0;
    }

    .app-view, .app-canvas {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #seccion-pos {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 350px;
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "vitrina factura";
        align-items: stretch;
        gap: 12px;
        padding: 8px 12px;
        height: 100%;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .pos-grid-container {
        grid-area: vitrina;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        overflow: hidden;
    }

    .pos-grid-container .pos-grid {
        flex: 1;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
    }

    .ticket-live-card {
        grid-area: factura;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        padding: 14px;
        gap: 10px;
        border: 1.5px solid #bae6fd;
        box-shadow: 0 10px 28px rgba(2, 132, 199, 0.08);
        overflow-y: auto;
    }

    .ticket-items-box {
        flex: 1;
        min-height: 60px;
        max-height: none;
    }

    .nav-tab-btn {
        min-height: 44px;
        padding: 10px 14px !important;
        font-size: 0.86rem !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .btn-neon-action,
    .ticket-live-card .btn-neon-action,
    .barra-acciones-diarias .btn-neon-action {
        min-height: 42px;
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
        line-height: 1.2 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-action-primary,
    .btn-action-secondary {
        min-height: 38px;
        padding: 9px 12px !important;
        font-size: 0.8rem !important;
    }

    .subtab-btn {
        min-height: 38px;
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
    }

    .btn-quick-pay {
        min-height: 36px;
        padding: 8px 6px !important;
        font-size: 0.78rem !important;
    }

    .btn-plan-select {
        min-height: 44px;
        padding: 10px 6px !important;
        font-size: 0.76rem !important;
    }
}

@media (min-width: 1100px) {
    #seccion-pos {
        grid-template-columns: minmax(0, 1fr) 410px;
    }
}

/* ==========================================================================
 * BALDOSAS DE PRODUCTOS (TARJETAS MODERNAS BENTO)
 * ========================================================================== */
.pos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 2px;
    align-content: start;
    width: 100%;
}

@media (min-width: 520px) {
    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    }
}

.pos-tile {
    background: #ffffff;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    min-height: 168px;
    min-width: 0;
}

.pos-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.09);
    border-color: #7dd3fc;
}

.pos-tile:active {
    transform: scale(0.97);
}

.pos-tile-img-box {
    width: 100%;
    height: 98px;
    min-height: 98px;
    flex-shrink: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.pos-tile-img-box img,
.pos-tile-img-box svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pos-tile-details {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: space-between;
}

.pos-tile-name {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--ink-main);
    line-height: 1.24;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-tile-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.pos-tile-price {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--brand-green-dark);
    line-height: 1.15;
    word-break: break-word;
}

.pos-tile-stock {
    font-size: 0.6rem;
    font-weight: 800;
    color: #0369a1;
    background: #f0f9ff;
    padding: 2px 8px;
    border-radius: 9999px;
    align-self: flex-end;
}

.pos-tile-stock.stock-critico {
    color: #dc2626;
    background: #fef2f2;
}

/* ==========================================================================
 * BARRA INFERIOR Y BOTONES DE ACCIÓN
 * ========================================================================== */
.barra-acciones-diarias {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px 10px 10px 10px;
    flex-shrink: 0;
    width: 100%;
}

.btn-neon-action {
    border: none;
    border-radius: var(--radius-btn);
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-live-card .btn-neon-action {
    font-size: 0.63rem !important;
    padding: 7px 4px !important;
}

.barra-acciones-diarias .btn-neon-action {
    font-size: 0.65rem !important;
    padding: 8px 4px !important;
    line-height: 1.15;
}

.btn-neon-action:active {
    transform: scale(0.97);
}

.btn-neon-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.btn-neon-green {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.btn-neon-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-neon-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.btn-action-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.btn-action-secondary {
    background: #ffffff;
    color: #334155;
    border: 1px solid var(--line-card);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-action-secondary:hover {
    background: #f8fafc;
}

.btn-margen-pct {
    background: #ffffff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    border-radius: 9999px;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 800;
    cursor: pointer;
}

.btn-quick-pay {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    border-radius: 10px;
    padding: 6px 4px;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

/* ==========================================================================
 * INPUTS, SELECTS, TABLAS Y SUBTABS
 * ========================================================================== */
input, select, textarea {
    font-family: inherit;
    background: #f8fafc;
    color: var(--ink-main);
    border: 1px solid var(--line-card);
    border-radius: var(--radius-input);
    padding: 8px 11px;
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    max-width: 100%;
}

input:focus, select:focus, textarea:focus {
    background: #ffffff;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

th, td {
    padding: 8px 6px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
}

th {
    color: var(--ink-muted);
    font-size: 0.62rem;
    text-transform: uppercase;
    background: #f8fafc;
}

.subtab-btn {
    border: 1px solid var(--line-soft);
    background: #ffffff;
    color: #475569;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.subtab-btn.active {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}

.quota-pill-bar {
    background: #ffffff;
    border: 1px solid #bae6fd;
    border-radius: 14px;
    padding: 7px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.66rem;
    font-weight: 700;
    color: #0369a1;
}

.quota-progress-track {
    width: 72px;
    height: 7px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.quota-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #16a34a);
    border-radius: 9999px;
}

/* ==========================================================================
 * CRÉDITOS, MODALES Y PAYWALL
 * ========================================================================== */
.card-credito-cliente {
    background: #ffffff;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.badge-abonado {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
}

.badge-deuda {
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

/* Asegura que el selector de mapa siempre quede por encima de cualquier otro modal */
#modal-selector-mapa {
    z-index: 1200 !important;
}

.modal-card {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.auth-modal-modern {
    border-radius: 26px;
    padding: 20px 18px;
    gap: 10px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.24);
}

.btn-close-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
    padding: 0 10px;
}

.auth-label {
    display: block;
    font-size: 0.66rem;
    color: #475569;
    font-weight: 700;
    margin-bottom: 3px;
}

.auth-alert-pill {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

.auth-switch-text {
    font-size: 0.74rem;
    color: #64748b;
    text-align: center;
    cursor: pointer;
    margin-top: 4px;
}

.auth-switch-text span {
    color: var(--brand-blue);
    font-weight: 800;
}

.input-eye-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-eye-container input {
    width: 100%;
    padding-right: 34px;
}

.btn-toggle-eye {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.2s;
    border-radius: 9999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #16a34a;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

#paywall-loader-overlay {
    display: none;
    padding: 16px 8px;
}

.spinner-ring {
    width: 34px;
    height: 34px;
    border: 3px solid #e0f2fe;
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: girarSpinner 0.8s linear infinite;
}

@keyframes girarSpinner {
    to { transform: rotate(360deg); }
}

.btn-plan-select {
    flex: 1;
    position: relative;
    padding: 8px 4px;
    border-radius: 14px;
    border: 1px solid var(--line-card);
    background: #f8fafc;
    color: #334155;
    font-size: 0.64rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-plan-select.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.badge-popular-plan {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #16a34a;
    color: #ffffff;
    font-size: 0.5rem;
    padding: 1px 6px;
    border-radius: 9999px;
    white-space: nowrap;
}

/* ==========================================================================
 * TOAST
 * ========================================================================== */
#toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 700;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}

#toast.show {
    opacity: 1;
}