/**
 * BOTICA ERP — DISEÑO INSPIRADO EN COBRIFY PERÚ (SAAS FINTECH / RETAIL)
 * Tipografía Oficial: Plus Jakarta Sans
 * Paleta: Clean Slate, Pure White (#FFFFFF), Cobrify Blue (#2563EB)
 * Menú Lateral Auto-Colapsable (Hover & Toggle)
 */

/* ==========================================================================
   1. VARIABLES & DESIGN TOKENS (COBRIFY PERÚ STYLE)
   ========================================================================== */
:root {
    /* Colores Primarios Cobrify */
    --primary-color: #2563eb;       /* Azul Cobrify Blue-600 */
    --primary-hover: #1d4ed8;       /* Blue-700 */
    --primary-light: #eff6ff;       /* Blue-50 */
    --primary-subtle: #dbeafe;      /* Blue-100 */
    --primary-dark: #1e3a8a;        /* Blue-900 */

    --secondary-color: #0284c7;     /* Sky-600 */
    --accent-color: #f59e0b;        /* Amber-500 */
    --danger-color: #dc2626;        /* Red-600 */
    --danger-light: #fee2e2;        /* Red-50 */
    --success-color: #16a34a;       /* Green-600 */
    --success-light: #dcfce7;       /* Green-50 */
    --warning-color: #d97706;       /* Amber-600 */
    --warning-light: #fef3c7;       /* Amber-50 */
    --info-color: #2563eb;          /* Blue-600 */
    --info-light: #eff6ff;
    
    /* Superficies y Fondos */
    --bg-body: #f8fafc;             /* Slate-50 neutro moderno */
    --bg-surface: #ffffff;          /* Blanco puro */
    --bg-sidebar: #ffffff;          /* Sidebar Blanco Cobrify */
    --text-sidebar: #475569;        /* Slate-600 */
    --text-sidebar-hover: #0f172a;  /* Slate-900 */
    --text-sidebar-active: #2563eb; /* Azul Cobrify */
    --sidebar-active-bg: #eff6ff;   /* Píldora activa Blue-50 */
    --border-color: #e2e8f0;        /* Slate-200 */
    --border-subtle: #f1f5f9;       /* Slate-100 */
    --text-main: #0f172a;           /* Slate-900 texto primario */
    --text-muted: #64748b;          /* Slate-500 texto secundario */

    /* Dimensiones Equilibradas (Reducción 50%) */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 68px;
    --navbar-height: 58px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
}

/* ==========================================================================
   2. TIPOGRAFÍA BALANCED SAAS (PLUS JAKARTA SANS)
   ========================================================================== */
html {
    font-size: 14px; /* Reducción de escala al 50% solicitada */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 0.925rem; /* ~13px - 14px */
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Títulos y Jerarquía Tipográfica */
h1, .h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-main); }
h2, .h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; color: var(--text-main); }
h3, .h3 { font-size: 1.18rem; font-weight: 600; color: var(--text-main); }
h4, .h4 { font-size: 1.05rem; font-weight: 600; color: var(--text-main); }
h5, .h5 { font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
h6, .h6 { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }

small, .small {
    font-size: 0.8rem !important;
    color: var(--text-muted);
}

.text-muted {
    color: #64748b !important;
}

/* ==========================================================================
   3. LAYOUT STRUCTURE (SIDEBAR COLAPSABLE & AUTO-ESCONDIBLE)
   ========================================================================== */
#app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-body);
    position: relative;
}

/* SIDEBAR BLANCO COBRIFY */
#sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    border-right: 1px solid var(--border-color);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand .brand-icon {
    width: 34px;
    height: 34px;
    background: var(--primary-color);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* Botón colapsar menú « » */
.sidebar-collapse-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.sidebar-collapse-toggle:hover {
    background: var(--border-subtle);
    color: var(--text-main);
}

/* Menú y Links estilo Cobrify */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.5rem;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 0.65rem 0.75rem 0.25rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.52rem 0.75rem;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.nav-link-custom i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.15s ease;
}

.nav-link-custom:hover {
    background-color: var(--border-subtle);
    color: var(--text-main);
}

.nav-link-custom:hover i {
    color: var(--primary-color);
}

/* Enlace Activo: Píldora Azul Suave Cobrify */
.nav-link-custom.active {
    background-color: var(--sidebar-active-bg);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link-custom.active i {
    color: var(--primary-color);
}

/* Submenús Desplegables en Menú Lateral (Acordeón Cobrify) */
.nav-dropdown-toggle {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.nav-dropdown-toggle .arrow-icon {
    font-size: 0.72rem !important;
    width: auto !important;
    color: #94a3b8;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
}

.nav-dropdown-toggle[aria-expanded="true"] .arrow-icon,
.nav-dropdown-toggle:not(.collapsed) .arrow-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.nav-submenu {
    padding-left: 0.5rem;
    margin-left: 1.15rem;
    border-left: 2px solid #e2e8f0;
    margin-top: 2px;
    margin-bottom: 4px;
}

.nav-sublink {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.42rem 0.65rem;
    color: var(--text-sidebar);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.nav-sublink i {
    font-size: 0.88rem;
    width: 14px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.nav-sublink:hover {
    background-color: var(--border-subtle);
    color: var(--text-main);
}

.nav-sublink:hover i {
    color: var(--primary-color);
}

.nav-sublink.active {
    background-color: var(--sidebar-active-bg);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-sublink.active i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
    background: #ffffff;
    white-space: nowrap;
}

/* ==========================================================================
   4. MODO COLAPSADO & AUTO-ESCONDIBLE (HOVER)
   ========================================================================== */
#main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cuando el sidebar está colapsado por el usuario */
#app-wrapper.sidebar-collapsed #sidebar {
    width: var(--sidebar-collapsed-width);
}

#app-wrapper.sidebar-collapsed #main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

#app-wrapper.sidebar-collapsed #sidebar .sidebar-header {
    justify-content: center;
    padding: 0 0.5rem;
}

#app-wrapper.sidebar-collapsed #sidebar .sidebar-brand {
    display: none;
}

#app-wrapper.sidebar-collapsed #sidebar .sidebar-collapse-toggle {
    margin: 0 auto;
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-section-title {
    opacity: 0;
    display: none;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-link-custom span,
#app-wrapper.sidebar-collapsed #sidebar .sidebar-footer span {
    opacity: 0;
    display: none;
}

#app-wrapper.sidebar-collapsed #sidebar:not(:hover) .nav-submenu {
    display: none !important;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-dropdown-toggle .arrow-icon {
    display: none;
}

#app-wrapper.sidebar-collapsed #sidebar:hover .nav-dropdown-toggle .arrow-icon {
    display: inline-block;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-link-custom {
    justify-content: center;
    padding: 0.6rem 0;
    margin: 2px 0.35rem;
}

#app-wrapper.sidebar-collapsed #sidebar .nav-link-custom i {
    font-size: 1.2rem;
    margin: 0;
}

/* Efecto Auto-Escondible / Hover sobre Menú Colapsado en Desktop */
@media (min-width: 992px) {
    #app-wrapper.sidebar-collapsed #sidebar:hover {
        width: var(--sidebar-width) !important;
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12) !important;
        z-index: 1055 !important;
    }

    #app-wrapper.sidebar-collapsed #sidebar:hover .sidebar-header {
        justify-content: space-between;
        padding: 0 1rem;
    }

    #app-wrapper.sidebar-collapsed #sidebar:hover .sidebar-brand {
        display: flex;
    }

    #app-wrapper.sidebar-collapsed #sidebar:hover .sidebar-brand span,
    #app-wrapper.sidebar-collapsed #sidebar:hover .nav-link-custom span,
    #app-wrapper.sidebar-collapsed #sidebar:hover .sidebar-footer span {
        opacity: 1 !important;
        display: inline !important;
    }

    #app-wrapper.sidebar-collapsed #sidebar:hover .nav-section-title {
        opacity: 1 !important;
        display: block !important;
    }

    #app-wrapper.sidebar-collapsed #sidebar:hover .nav-link-custom {
        justify-content: flex-start !important;
        padding: 0.52rem 0.75rem !important;
        margin: 2px 0.5rem !important;
    }

    #app-wrapper.sidebar-collapsed #sidebar:hover .nav-link-custom i {
        font-size: 1.05rem !important;
        margin-right: 0.5rem !important;
    }
}

/* Overlay móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

    #main-wrapper {
        margin-left: 0 !important;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ==========================================================================
   5. TOP NAVBAR ESTILO COBRIFY
   ========================================================================== */
#navbar {
    height: var(--navbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.navbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    margin: 0 1rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.sidebar-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--border-subtle);
    color: var(--text-main);
}

/* ==========================================================================
   BOTONES DE ACCESO RÁPIDO DEL HEADER (POS, HISTORIAL, CAJA) — CENTRADOS Y LLAMATIVOS
   ========================================================================== */
.quick-nav-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-quick-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.42rem 0.95rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}

/* 1. Punto de Venta: Azul Cobrify / Royal Blue */
.btn-quick-pos {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}
.btn-quick-pos:hover {
    background-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

/* 2. Historial Ventas: Verde Esmeralda Llamativo */
.btn-quick-sales {
    background-color: #16a34a;
    color: #ffffff;
    border-color: #15803d;
    box-shadow: 0 2px 5px rgba(22, 163, 74, 0.3);
}
.btn-quick-sales:hover {
    background-color: #15803d;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

/* 3. Control Caja: Naranja Vibrante / Rojo Cálido */
.btn-quick-cash {
    background-color: #ea580c;
    color: #ffffff;
    border-color: #c2410c;
    box-shadow: 0 2px 5px rgba(234, 88, 12, 0.3);
}
.btn-quick-cash:hover {
    background-color: #c2410c;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.4);
    transform: translateY(-1px);
}

/* 4. Stock Actual: Púrpura / Índigo Moderno */
.btn-quick-stock {
    background-color: #7c3aed;
    color: #ffffff;
    border-color: #6d28d9;
    box-shadow: 0 2px 5px rgba(124, 58, 237, 0.3);
}
.btn-quick-stock:hover {
    background-color: #6d28d9;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

/* Insignia de Atajo en Teclado */
.shortcut-kbd {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    font-size: 0.68rem;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.1;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn-quick-nav:hover .shortcut-kbd {
    background-color: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 991.98px) {
    .navbar-center .btn-label {
        display: none;
    }
    .btn-quick-nav {
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-center .shortcut-kbd {
        display: none;
    }
}

/* Compatibilidad heredada */
.btn-pos-header {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
    transition: all 0.15s ease;
}
.btn-pos-header:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

/* Métodos de Pago Digitales Peruanos (Yape & Plin) */
.btn-outline-yape {
    color: #742284;
    border: 1.5px solid #742284;
    background-color: #ffffff;
}
.btn-outline-yape:hover,
.btn-check:checked + .btn-outline-yape {
    color: #ffffff !important;
    background-color: #742284 !important;
    border-color: #742284 !important;
    box-shadow: 0 4px 12px rgba(116, 34, 132, 0.35);
}

.btn-outline-plin {
    color: #009fe3;
    border: 1.5px solid #009fe3;
    background-color: #ffffff;
}
.btn-outline-plin:hover,
.btn-check:checked + .btn-outline-plin {
    color: #ffffff !important;
    background-color: #009fe3 !important;
    border-color: #009fe3 !important;
    box-shadow: 0 4px 12px rgba(0, 159, 227, 0.35);
}

.badge-yape {
    background-color: #742284;
    color: #ffffff;
}

.badge-plin {
    background-color: #009fe3;
    color: #ffffff;
}

/* User Profile Chip */
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.65rem 0.3rem 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-chip:hover {
    background: #f8fafc;
}

.user-chip-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   6. CONTENIDO, TARJETAS & COMPONENTES COBRIFY
   ========================================================================== */
#content {
    padding: 1.5rem 1.75rem;
    flex: 1;
}

/* Tarjetas Limpias con Bordes Finos */
.card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.15rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.card-body {
    padding: 1.15rem;
}

/* KPI Cards de Cobrify (Métricas en fila) */
.kpi-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.25rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card .kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.kpi-card .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.kpi-card .kpi-subtext {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.kpi-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.kpi-icon-circle.blue { background: #eff6ff; color: #2563eb; }
.kpi-icon-circle.green { background: #ecfdf5; color: #059669; }
.kpi-icon-circle.red { background: #fef2f2; color: #dc2626; }
.kpi-icon-circle.amber, .kpi-icon-circle.warning { background: #fffbeb; color: #d97706; }
.kpi-icon-circle.info, .kpi-icon-circle.cyan { background: #f0fdfa; color: #0d9488; }
.kpi-icon-circle.purple { background: #faf5ff; color: #7c3aed; }
.kpi-icon-circle.secondary { background: #f8fafc; color: #64748b; }

/* ==========================================================================
   7. FORMULARIOS & BOTONES PROPORCIONADOS
   ========================================================================== */
.form-control, .form-select {
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.form-control-lg {
    height: 42px;
    font-size: 0.95rem;
}

/* Botones Proporcionados */
.btn {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.42rem 0.85rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: #334155;
    background: #ffffff;
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-main);
}

.btn-lg {
    padding: 0.6rem 1.25rem;
    font-size: 0.98rem;
    height: 44px;
}

/* ==========================================================================
   8. TABLAS & BADGES
   ========================================================================== */
.table {
    margin-bottom: 0;
    font-size: 0.88rem;
}

.table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
}

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

/* Badges Píldora */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.28em 0.65em;
    border-radius: var(--radius-pill);
}

.badge.bg-success { background-color: var(--success-light) !important; color: #15803d !important; border: 1px solid rgba(22, 163, 74, 0.2); }
.badge.bg-danger { background-color: var(--danger-light) !important; color: #b91c1c !important; border: 1px solid rgba(220, 38, 38, 0.2); }
.badge.bg-warning { background-color: var(--warning-light) !important; color: #b45309 !important; border: 1px solid rgba(217, 119, 6, 0.2); }
.badge.bg-primary { background-color: var(--primary-light) !important; color: var(--primary-color) !important; border: 1px solid rgba(37, 99, 235, 0.2); }
.badge.bg-light { background-color: #f1f5f9 !important; color: #475569 !important; border: 1px solid var(--border-color); }

/* Píldoras de filtro en POS estilo Cobrify */
.filter-pill {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.filter-pill.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    font-weight: 600;
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
#footer {
    padding: 0.85rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   10. DROPDOWN DE BÚSQUEDA DE MEDICAMENTOS (ALTO CONTRASTE & LEGIBILIDAD)
   ========================================================================== */
.pos-search-dropdown {
    position: absolute;
    width: 100%;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px;
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.22), 0 8px 16px -4px rgba(15, 23, 42, 0.12) !important;
    overflow-x: hidden;
    padding: 0;
}

.pos-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: #0f172a !important;
    transition: all 0.15s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.pos-search-item:last-child {
    border-bottom: none;
}

/* Estado seleccionado o hover: suave realce con barra azul lateral, manteniendo texto nítido */
.pos-search-item:hover,
.pos-search-item.is-selected {
    background-color: #f8fafc !important;
    border-left: 4px solid #2563eb !important;
}

.pos-search-item .product-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}

.pos-search-item .product-sku-badge {
    font-family: var(--bs-font-monospace);
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.pos-search-item .product-generic-desc {
    font-size: 0.8rem;
    color: #475569 !important;
    font-weight: 500;
    line-height: 1.35;
}

.pos-search-item .product-main-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   11. SISTEMA PROFESIONAL DE NOTIFICACIONES & ALERTAS SANITARIAS
   ========================================================================== */
.btn-icon-nav {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-nav:hover,
.btn-icon-nav[aria-expanded="true"] {
    background-color: #f1f5f9;
    color: var(--primary-color);
    border-color: #cbd5e1;
}

.notif-badge-bubble {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
    color: #ffffff;
    background-color: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
    animation: notifPulse 2.5s infinite;
}

@keyframes notifPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 7px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.notifications-dropdown {
    width: 390px;
    max-width: 95vw;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.2), 0 10px 20px -5px rgba(15, 23, 42, 0.1) !important;
    border: 1px solid #e2e8f0 !important;
    margin-top: 8px !important;
    z-index: 1060;
}

.notif-dropdown-header {
    background-color: #f8fafc;
    border-top-left-radius: 13px;
    border-top-right-radius: 13px;
}

.notif-mark-read-btn {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color) !important;
    cursor: pointer;
    transition: color 0.15s ease;
}

.notif-mark-read-btn:hover {
    color: var(--primary-hover) !important;
    text-decoration: underline !important;
}

.notif-dropdown-body {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.notif-dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.notif-dropdown-body::-webkit-scrollbar-track {
    background: #f8fafc;
}

.notif-dropdown-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.notif-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
    cursor: pointer;
    position: relative;
}

.notif-dropdown-item:last-child {
    border-bottom: none;
}

.notif-dropdown-item:hover {
    background-color: #f8fafc !important;
}

/* Indicador sutil de no leído: Fondo 100% blanco limpio y punto indicador azul */
.notif-dropdown-item.is-unread {
    background-color: #ffffff !important;
}

.notif-dropdown-item.is-unread::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #2563eb;
}

.notif-icon-circle {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-full-card {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background-color 0.15s ease;
}

.notif-full-card:hover {
    background-color: #f8fafc !important;
}

.notif-full-card.notif-unread {
    background-color: #ffffff !important;
    border-left: 3px solid #2563eb !important;
}

.notif-dropdown-footer {
    background-color: #f8fafc;
    border-bottom-left-radius: 13px;
    border-bottom-right-radius: 13px;
}

