/* ============================================================
   POS Botillerías — Hoja de estilos global
   Alternativa B · Moderna y premium
   Breakpoints: 320 / 375 / 768 / 1024 / 1280 / 1440
   ============================================================ */

/* ------------------------------------------------------------
   Tokens de marca — sistema de diseño completo
   ------------------------------------------------------------ */
:root {
    /* Layout */
    --sidebar-w:            240px;
    --topbar-h:             56px;
    --content-padding:      1.5rem;
    --content-padding-sm:   0.875rem;
    --radius-sm:            6px;
    --radius-md:            10px;
    --radius-lg:            14px;
    --transition-fast:      0.15s ease;
    --transition-med:       0.25s ease;

    /* Base y superficies */
    --bg-app:               #F8FAFC;
    --bg-dark:              #0F172A;
    --bg-dark-2:            #111827;
    --surface:              #FFFFFF;
    --surface-soft:         #F8FAFC;
    --border-soft:          #E5E7EB;
    --border-strong:        #CBD5E1;

    /* Marca / acento premium */
    --primary:              #2563EB;
    --primary-hover:        #1D4ED8;
    --primary-soft:         #DBEAFE;
    --primary-rgb:          37, 99, 235;

    /* Éxito / operativo */
    --success:              #16A34A;
    --success-soft:         #DCFCE7;
    --success-rgb:          22, 163, 74;

    /* Advertencia */
    --warning:              #F59E0B;
    --warning-soft:         #FEF3C7;
    --warning-rgb:          245, 158, 11;

    /* Error */
    --danger:               #DC2626;
    --danger-soft:          #FEE2E2;
    --danger-rgb:           220, 38, 38;

    /* Texto */
    --text-primary:         #0F172A;
    --text-secondary:       #475569;
    --text-muted-clr:       #94A3B8;
    --text-on-dark:         #E5E7EB;

    /* Sidebar */
    --sidebar-bg:           #0F172A;
    --sidebar-text:         #94A3B8;
    --sidebar-text-hover:   #E5E7EB;
    --sidebar-hover:        #1E293B;
    --sidebar-active:       #2563EB;
    --sidebar-active-hover: #1D4ED8;
    --sidebar-section:      #475569;
    --sidebar-border:       rgba(255,255,255,0.06);

    /* ── Bootstrap 5 CSS variable overrides ─────────────────── */
    --bs-primary:               #2563EB;
    --bs-primary-rgb:           37, 99, 235;
    --bs-success:               #16A34A;
    --bs-success-rgb:           22, 163, 74;
    --bs-warning:               #F59E0B;
    --bs-warning-rgb:           245, 158, 11;
    --bs-danger:                #DC2626;
    --bs-danger-rgb:            220, 38, 38;
    --bs-body-bg:               #F8FAFC;
    --bs-body-color:            #0F172A;
    --bs-link-color:            #2563EB;
    --bs-link-hover-color:      #1D4ED8;
    --bs-border-color:          #E5E7EB;
    --bs-border-radius:         0.5rem;
    --bs-border-radius-sm:      0.375rem;
    --bs-border-radius-lg:      0.75rem;
    --bs-card-border-color:     #E5E7EB;
    --bs-card-border-radius:    10px;
    --bs-secondary-color:       #475569;
    --bs-secondary-bg:          #F8FAFC;
    --bs-tertiary-bg:           #F1F5F9;
    --bs-emphasis-color:        #0F172A;
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-size: 0.875rem;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* touch target mínimo 44px */
.btn, button, [role="button"], a.btn {
    min-height: 36px;
}
@media (max-width: 767px) {
    .btn, button[type="submit"], button[type="button"], a.btn {
        min-height: 44px;
    }
    .table .btn   { min-height: 32px; }
    .cart-qty .btn { min-height: 32px; }
}

/* ── Bootstrap button overrides ─────────────────────────────── */
.btn-primary {
    --bs-btn-bg:           var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg:     var(--primary-hover);
    --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-bg:    var(--primary-hover);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
    --bs-btn-color:        #fff;
    --bs-btn-hover-color:  #fff;
    --bs-btn-active-color: #fff;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.btn-success {
    --bs-btn-bg:           var(--success);
    --bs-btn-border-color: var(--success);
    --bs-btn-hover-bg:     #15803d;
    --bs-btn-hover-border-color: #15803d;
    --bs-btn-focus-shadow-rgb: var(--success-rgb);
}
.btn-danger {
    --bs-btn-bg:           var(--danger);
    --bs-btn-border-color: var(--danger);
    --bs-btn-hover-bg:     #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-focus-shadow-rgb: var(--danger-rgb);
}
.btn-warning {
    --bs-btn-bg:           var(--warning);
    --bs-btn-border-color: var(--warning);
    --bs-btn-hover-bg:     #d97706;
    --bs-btn-hover-border-color: #d97706;
    --bs-btn-color:        #fff;
    --bs-btn-hover-color:  #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: var(--warning-rgb);
}
.btn-outline-primary {
    --bs-btn-color:        var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg:     var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg:    var(--primary-hover);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
}
.btn-outline-danger {
    --bs-btn-color:        var(--danger);
    --bs-btn-border-color: var(--danger);
    --bs-btn-hover-bg:     var(--danger);
    --bs-btn-active-bg:    #b91c1c;
    --bs-btn-focus-shadow-rgb: var(--danger-rgb);
}
.btn-outline-secondary {
    --bs-btn-color:        var(--text-secondary);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-bg:     var(--surface-soft);
    --bs-btn-hover-border-color: var(--border-strong);
    --bs-btn-hover-color:  var(--text-primary);
}

/* ── Bootstrap badge overrides ──────────────────────────────── */
.badge.bg-primary  { background-color: var(--primary) !important; }
.badge.bg-success  { background-color: var(--success) !important; }
.badge.bg-danger   { background-color: var(--danger)  !important; }
.badge.bg-warning  { background-color: var(--warning) !important; color: #fff !important; }

/* ── Bootstrap form overrides ───────────────────────────────── */
.form-control, .form-select {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background-color: var(--surface);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    outline: none;
}
.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}
.input-group-text {
    background-color: var(--surface-soft);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }

/* ------------------------------------------------------------
   SIDEBAR
   ------------------------------------------------------------ */

/* Backdrop (solo móvil) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1039;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-med);
    will-change: transform;
    /* scrollbar sutil en sidebar */
    scrollbar-width: thin;
    scrollbar-color: #1E293B transparent;
}
.sidebar::-webkit-scrollbar       { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #1E293B; border-radius: 4px; }

/* DESKTOP (≥992px) */
@media (min-width: 992px) {
    .sidebar { transform: translateX(0); }
    .sidebar.sidebar-hidden { transform: translateX(-100%); }
}

/* MÓVIL (<992px) */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.sidebar-open { transform: translateX(0); }
}

/* ── Sidebar brand ──────────────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: var(--topbar-h);
    flex-shrink: 0;
    letter-spacing: -0.01em;
    gap: 0;
}
.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-right: 0.65rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.sidebar-brand-text strong {
    font-size: 0.88rem;
    color: #fff;
    font-weight: 700;
}
.sidebar-brand-text span {
    font-size: 0.65rem;
    color: var(--sidebar-section);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ── Nav items ───────────────────────────────────────────────── */
.sidebar-nav {
    padding: 0.625rem 0;
    flex: 1;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.55rem 1rem;
    margin: 0 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    transition: background var(--transition-fast), color var(--transition-fast);
    font-size: 0.835rem;
    font-weight: 450;
    line-height: 1.4;
    position: relative;
}
.sidebar-nav .nav-link i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 1.15rem;
    text-align: center;
    transition: color var(--transition-fast);
}

/* ── Hover ───────────────────────────────────────────────────── */
.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}
.sidebar-nav .nav-link:hover i { color: var(--sidebar-text-hover); }

/* ── Active — sólido, claro, inconfundible ───────────────────── */
.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.sidebar-nav .nav-link.active i { color: #fff; }
.sidebar-nav .nav-link.active:hover {
    background: var(--sidebar-active-hover);
}

/* ── Section labels ──────────────────────────────────────────── */
.sidebar-section {
    color: var(--sidebar-section);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 1.5rem 0.3rem;
}

/* ── Footer del sidebar ──────────────────────────────────────── */
.sidebar-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   MAIN WRAPPER
   ------------------------------------------------------------ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-med);
    min-width: 0;
}

@media (min-width: 992px) {
    .main-wrapper.sidebar-hidden { margin-left: 0; }
}
@media (max-width: 991px) {
    .main-wrapper { margin-left: 0; }
}

/* ------------------------------------------------------------
   TOPBAR
   ------------------------------------------------------------ */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    gap: 0.75rem;
    flex-shrink: 0;
}

.topbar-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    letter-spacing: -0.01em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

/* Topbar toggle — sin borde visible */
#sidebarToggle {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}
#sidebarToggle:hover {
    background: var(--surface-soft);
    color: var(--text-primary);
}

/* Badge caja */
.caja-badge-text { display: none; }
@media (min-width: 576px) {
    .caja-badge-text { display: inline; }
}

/* Nombre usuario */
.topbar-user-name { display: none; }
@media (min-width: 480px) {
    .topbar-user-name { display: inline; }
}

/* Dropdown del topbar */
.topbar-right .dropdown-toggle {
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    padding: 0.3rem 0.65rem;
    gap: 0.4rem;
    background: transparent;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.topbar-right .dropdown-toggle:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
    color: var(--text-primary);
}
.topbar-right .dropdown-menu {
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    min-width: 180px;
}

/* ── Badges de caja en topbar ────────────────────────────────── */
.topbar-right .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ------------------------------------------------------------
   MAIN CONTENT
   ------------------------------------------------------------ */
.main-content {
    padding: var(--content-padding);
    flex: 1;
    min-width: 0;
}

@media (max-width: 575px) {
    .main-content { padding: var(--content-padding-sm); }
}

/* ------------------------------------------------------------
   PAGE HEADER
   ------------------------------------------------------------ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.375rem;
}
.page-header h5,
.page-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    background: var(--surface);
}
.card.border-0 {
    border: 1px solid var(--border-soft) !important;
}
.card-header {
    border-bottom: 1px solid var(--border-soft);
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    background: var(--surface) !important;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.card-header.d-flex {
    gap: 0.5rem;
    flex-wrap: wrap;
}
.card-body { padding: 1.25rem; }

/* shadow-sm override */
.shadow-sm {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04) !important;
}

/* ------------------------------------------------------------
   AUTH
   ------------------------------------------------------------ */
.auth-body {
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(37,99,235,0.08) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
}

@media (min-width: 480px) {
    .auth-card { padding: 2.5rem 2.25rem; }
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-brand-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}
.auth-brand i { font-size: 3rem; color: var(--primary); }
.auth-brand h4 {
    margin-top: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.auth-brand p { color: var(--text-secondary); }

/* ------------------------------------------------------------
   METRIC CARDS (Dashboard)
   ------------------------------------------------------------ */
.metric-card {
    border-radius: var(--radius-md) !important;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

/* Metric icon semantic colors */
.metric-icon.bg-primary-subtle  { background: var(--primary-soft) !important; color: var(--primary) !important; }
.metric-icon.bg-success-subtle  { background: var(--success-soft) !important; color: var(--success) !important; }
.metric-icon.bg-warning-subtle  { background: var(--warning-soft) !important; color: var(--warning) !important; }
.metric-icon.bg-info-subtle     { background: #E0F2FE !important; color: #0369A1 !important; }
.metric-icon.bg-danger-subtle   { background: var(--danger-soft) !important; color: var(--danger) !important; }

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted-clr);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    white-space: nowrap;
}

.metric-value {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-break: break-all;
}

/* ------------------------------------------------------------
   ALERTS
   ------------------------------------------------------------ */
.alert {
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}
.alert-success {
    background: var(--success-soft);
    color: #14532d;
    border-color: #bbf7d0;
}
.alert-danger {
    background: var(--danger-soft);
    color: #7f1d1d;
    border-color: #fecaca;
}
.alert-warning {
    background: var(--warning-soft);
    color: #78350f;
    border-color: #fde68a;
}
.alert-info {
    background: #E0F2FE;
    color: #0c4a6e;
    border-color: #bae6fd;
}

/* ------------------------------------------------------------
   TABLES
   ------------------------------------------------------------ */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(var(--primary-rgb), 0.04);
    --bs-table-border-color: var(--border-soft);
    color: var(--text-primary);
}
.table th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-clr);
    white-space: nowrap;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-soft);
    background: var(--surface-soft);
}
.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    border-color: var(--border-soft);
    color: var(--text-primary);
}
.table td:last-child { max-width: none; white-space: nowrap; }
.table-sm th { padding: 0.5rem 0.875rem; }
.table-sm td { padding: 0.5rem 0.875rem; }

.card .table-responsive { overflow-x: auto; }

@media (max-width: 575px) {
    .table    { font-size: 0.8rem; }
    .table th { font-size: 0.66rem; }
}

/* ------------------------------------------------------------
   BADGES — semánticos premium
   ------------------------------------------------------------ */
.fs-7 { font-size: 0.75rem !important; }

/* Utilitarios semánticos premium */
.badge-success-soft {
    background: var(--success-soft);
    color: #14532d;
    font-weight: 600;
}
.badge-warning-soft {
    background: var(--warning-soft);
    color: #78350f;
    font-weight: 600;
}
.badge-danger-soft {
    background: var(--danger-soft);
    color: #7f1d1d;
    font-weight: 600;
}
.badge-primary-soft {
    background: var(--primary-soft);
    color: #1e3a8a;
    font-weight: 600;
}

/* ── Bootstrap badge bg-secondary refinado ──────────────────── */
.badge.bg-secondary {
    background-color: var(--border-strong) !important;
    color: var(--text-secondary) !important;
}

/* ------------------------------------------------------------
   FORMULARIOS
   ------------------------------------------------------------ */
.form-max-sm  { max-width: 480px; }
.form-max-md  { max-width: 600px; }
.form-max-lg  { max-width: 720px; }

@media (max-width: 575px) {
    .form-max-sm,
    .form-max-md,
    .form-max-lg { max-width: 100%; }
}

/* ── Dropdown menu global ───────────────────────────────────── */
.dropdown-menu {
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    font-size: 0.84rem;
}
.dropdown-item {
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: 4px;
    margin: 0 0.25rem;
    width: calc(100% - 0.5rem);
}
.dropdown-item:hover { background: var(--surface-soft); color: var(--text-primary); }
.dropdown-item.text-danger:hover { background: var(--danger-soft); }
.dropdown-divider { border-color: var(--border-soft); }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-content {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,0.15);
}
.modal-header {
    border-bottom: 1px solid var(--border-soft);
    padding: 1.125rem 1.5rem;
}
.modal-footer {
    border-top: 1px solid var(--border-soft);
    padding: 1rem 1.5rem;
}

/* ------------------------------------------------------------
   REPORTES — cards de acceso
   ------------------------------------------------------------ */
.report-access-card {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
    color: inherit;
}
.report-access-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
}

/* ------------------------------------------------------------
   UTILITIES
   ------------------------------------------------------------ */
.scroll-x {
    overflow-x: auto;
    scrollbar-width: thin;
}
.text-nowrap-all * { white-space: nowrap; }

@media (max-width: 575px) {
    .section-divider {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-soft);
    }
}

/* ── Text color utilities ────────────────────────────────────── */
.text-primary    { color: var(--primary) !important; }
.text-success    { color: var(--success) !important; }
.text-danger     { color: var(--danger)  !important; }
.text-warning    { color: var(--warning) !important; }
.text-muted      { color: var(--text-muted-clr) !important; }
.text-secondary  { color: var(--text-secondary) !important; }

/* ── Bg subtle utilities (Bootstrap 5.3) ────────────────────── */
.bg-primary-subtle  { background-color: var(--primary-soft) !important; }
.bg-success-subtle  { background-color: var(--success-soft) !important; }
.bg-warning-subtle  { background-color: var(--warning-soft) !important; }
.bg-danger-subtle   { background-color: var(--danger-soft)  !important; }
.bg-info-subtle     { background-color: #E0F2FE !important; }

/* ── Link override ───────────────────────────────────────────── */
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

/* ============================================================
   POS — Layout principal
   ============================================================ */

/* POS: sidebar overlay */
.pos-page .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    visibility: hidden;
    pointer-events: none;
}
.pos-page .sidebar.sidebar-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

/* POS: main-wrapper full width */
.pos-page .main-wrapper { margin-left: 0; }

.pos-page .main-content {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos-container {
    display: flex;
    width: 100%;
    height: calc(100vh - var(--topbar-h));
    max-height: calc(100vh - var(--topbar-h));
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

/* ── Panel productos (izquierda) ─────────────────────────────── */
.pos-products {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-soft);
    background: var(--bg-app);
    min-width: 0;
}

.pos-search-bar {
    padding: 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.category-pills {
    display: flex;
    gap: 0.3rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }

.category-pill {
    padding: 0.25rem 0.75rem;
    font-size: 0.775rem;
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 20px;
    border: 1px solid var(--border-soft);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}
.category-pill:hover,
.category-pill.active,
.category-pill.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.product-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.4rem;
        padding: 0.5rem;
    }
}

/* ── Product cards ───────────────────────────────────────────── */
.product-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    -webkit-user-select: none;
    user-select: none;
    min-height: 105px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.2rem;
}
.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-1px);
}
.product-card:active { transform: scale(0.97); }
.product-card.out-of-stock { opacity: 0.45; cursor: not-allowed; }
.product-card.out-of-stock:hover { transform: none; border-color: var(--border-soft); box-shadow: none; }

.product-card .prod-name {
    font-size: 0.70rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .prod-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}
.product-card .prod-stock     { font-size: 0.68rem; color: var(--text-muted-clr); }
.product-card .prod-stock.low { color: var(--danger); font-weight: 600; }

/* ── Panel carrito (derecha) ─────────────────────────────────── */
.pos-cart {
    flex: 0 1 clamp(280px, 30vw, 400px);
    min-width: 280px;
    max-width: 400px;
    width: auto;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow: hidden;
    border-left: 1px solid var(--border-soft);
}

.pos-cart-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--surface-soft);
}
.pos-cart-header .fw-semibold {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.625rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    margin-bottom: 0.375rem;
    background: var(--surface);
    transition: border-color var(--transition-fast);
}
.cart-item:hover { border-color: var(--border-strong); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.cart-item-price {
    font-size: 0.7rem;
    color: var(--text-muted-clr);
}

.cart-qty {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}
.cart-qty input {
    width: 42px;
    text-align: center;
    font-size: 0.8rem;
    padding: 0.2rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    -moz-appearance: textfield;
    appearance: textfield;
    color: var(--text-primary);
    background: var(--surface);
}
.cart-qty input::-webkit-outer-spin-button,
.cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cart-qty input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.15);
}

.cart-item-total {
    font-weight: 700;
    font-size: 0.82rem;
    min-width: 62px;
    text-align: right;
    color: var(--primary);
    flex-shrink: 0;
}

.cart-totals {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-soft);
    background: var(--surface-soft);
    flex-shrink: 0;
}
.cart-totals .fw-bold {
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.cart-payment {
    padding: 0.75rem 1rem 0.875rem;
    border-top: 1px solid var(--border-soft);
    overflow-y: auto;
    flex-shrink: 0;
}

/* Customer dropdown */
.customer-search-wrap { position: relative; }
.customer-dropdown {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    z-index: 1050;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    max-height: 160px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.customer-dropdown .dropdown-option {
    padding: 0.45rem 0.875rem;
    cursor: pointer;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}
.customer-dropdown .dropdown-option:last-child { border-bottom: none; }
.customer-dropdown .dropdown-option:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ── Botón Cobrar — acción principal POS ─────────────────────── */
#btnCobrar {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    letter-spacing: 0.02em;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    transition: all var(--transition-fast);
}
#btnCobrar:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px);
}
#btnCobrar:active { transform: translateY(0); box-shadow: none; }

/* ── POS ≤1024px: layout apilado ────────────────────────────── */
@media (max-width: 1024px) {
    .pos-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - var(--topbar-h));
        overflow: visible;
    }
    .pos-page .main-content { overflow: visible; }
    .pos-products {
        height: 45vh;
        min-height: 260px;
        border-right: none;
        border-bottom: 2px solid var(--border-soft);
    }
    .pos-cart {
        width: 100%;
        min-width: 0;
        max-width: none;
        flex: none;
    }
    .cart-items {
        flex: none;
        max-height: 220px;
    }
    .cart-payment {
        overflow: visible;
        max-height: none;
    }
    .pos-search-bar .input-group { margin-bottom: 0.4rem !important; }
}

/* Botones rápidos de monto — tamaño xs */
.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
    line-height: 1.3;
    border-radius: 0.25rem;
}
#quickAmounts .btn-xs:hover {
    background-color: var(--bs-secondary);
    color: #fff;
    border-color: var(--bs-secondary);
}
