﻿/* =============================================
   DESIGN SYSTEM â€” Glass Modular v2
   ERP GastronÃ³mico Â· RestoCore
   Solo estilos visuales Â· No afecta lÃ³gica
   ============================================= */

/* â”€â”€â”€ Google Fonts: IBM Plex Sans (UI/body) + DM Serif Display (display) â”€â”€â”€ */
/* [REBRAND 2026-04-24] "Indigo Harvest" + DM Serif Display / IBM Plex Sans.
   Inter se mantiene como fallback porque varios mÃ³dulos scoped lo declaran
   explÃ­citamente; el cambio global ocurre vÃ­a --font-main y body { font-family }. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=DM+Serif+Display&display=swap');

/* â”€â”€â”€ Design Tokens â€” Indigo Harvest (Tech Premium) â”€â”€â”€ */
:root {
    /* â€” Corporativos (Indigo) â€” */
    --ih-midnight:        #10122A;  /* Medianoche */
    --ih-indigo-deep:     #1A2050;  /* Ãndigo Oscuro */
    --ih-indigo-mid:      #283280;  /* Ãndigo Medio */
    --ih-indigo-active:   #4050C0;  /* Ãndigo Activo (CTA principal) */

    /* â€” Acentos & Neutros â€” */
    --ih-lime-harvest:    #60B860;  /* Lima Cosecha */
    --ih-mint:            #A8E0A8;  /* Verde Menta */
    --ih-lavender-soft:   #E0E8FF;  /* Lavanda Suave */
    --ih-indigo-white:    #F0F4FF;  /* Blanco Ãndigo */

    /* â€” Estados â€” */
    --ih-success:         #40A040;
    --ih-warning:         #D09020;
    --ih-error:           #C03030;
    --ih-info:            #4050C0;

    /* â€” Tokens semÃ¡nticos (compat hacia atrÃ¡s) â€” */
    --color-primary:        var(--ih-indigo-active);
    --color-primary-hover:  var(--ih-indigo-mid);
    --color-primary-deep:   var(--ih-indigo-deep);
    --color-accent:         var(--ih-lime-harvest);
    --color-accent-soft:    var(--ih-mint);
    --color-success:        var(--ih-success);
    --color-warning:        var(--ih-warning);
    --color-danger:         var(--ih-error);
    --color-info:           var(--ih-info);

    /* â€” TipografÃ­as â€” */
    --font-main:    'IBM Plex Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'DM Serif Display', 'IBM Plex Sans', Georgia, serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Glass module â€” tintado Ã­ndigo sutil */
    --glass-bg:     rgba(255, 255, 255, 0.65);
    --glass-border: rgba(224, 232, 255, 0.85);
    --glass-shadow: 0 8px 32px 0 rgba(16, 18, 42, 0.08);

    /* Text */
    --text-main:    #1A2050;
    --text-muted:   #5A6280;
    --text-hint:    #8890B0;
}

body.dark-mode {
    --glass-bg:     rgba(26, 32, 80, 0.55);
    --glass-border: rgba(64, 80, 192, 0.35);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
    --text-main:    #E0E8FF;
    --text-muted:   #A8B0D8;
    --text-hint:    #7880A8;
    --color-primary:       #6878E0;   /* Ã­ndigo mÃ¡s luminoso para contraste */
    --color-primary-hover: #8090F0;
    --color-accent:        var(--ih-mint);
}

/* =============================================
   BODY â€” Global Background
   ============================================= */
body.glass-ui {
    /* [REBRAND 2026-04-24] Indigo Harvest: fondo lavanda suave -> blanco Ã­ndigo */
    background: linear-gradient(120deg, var(--ih-lavender-soft) 0%, var(--ih-indigo-white) 60%, #ffffff 100%) !important;
    background-attachment: fixed !important;
    font-family: var(--font-main) !important;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* [REBRAND 2026-04-24] Display typography para tÃ­tulos principales */
body.glass-ui h1,
body.glass-ui .display-font {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

/* Decorative background orbs */
body.glass-ui::before,
body.glass-ui::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}
body.glass-ui::before {
    width: 384px;
    height: 384px;
    top: -10%;
    left: -5%;
    /* [REBRAND] Ãndigo Activo */
    background: rgba(64, 80, 192, 0.20);
    filter: blur(100px);
}
body.glass-ui::after {
    width: 500px;
    height: 500px;
    bottom: -10%;
    right: -5%;
    /* [REBRAND] Lima Cosecha */
    background: rgba(96, 136, 96, 0.14);
    filter: blur(120px);
}

/* Override wrapper for glass layout */
body.glass-ui .backDashboard {
    background: transparent !important;
}
body.glass-ui #wrapper {
    position: relative;
    z-index: 1;
    height: 100vh;
    overflow: hidden;
}

/* â”€â”€â”€ Animations â”€â”€â”€ */
@keyframes softPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.8; transform: scale(1.02); }
}

/* =============================================
   GLASS MODULE â€” Reusable Card Base
   ============================================= */
.glass-module {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* â”€â”€â”€ Glass Scrollbar â”€â”€â”€ */
.glass-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.4) transparent;
}
.glass-scrollbar::-webkit-scrollbar { width: 4px; }
.glass-scrollbar::-webkit-scrollbar-track { background: transparent; }
.glass-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 10px;
}
.glass-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.6);
}

/* =============================================
   SIDEBAR â€” Glass Layout
   ============================================= */
body.glass-ui .glass-sidebar {
    width: 300px;
    min-width: 300px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 20;
    flex-shrink: 0;
    overflow: visible;
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1),
                min-width 300ms cubic-bezier(0.4, 0, 0.2, 1),
                padding 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* â”€â”€â”€ Brand / Logo Module â”€â”€â”€ */
.gs-brand {
    padding: 16px 16px 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.gs-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 16px;
}
.gs-brand:hover::before { opacity: 1; }
.gs-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
}

.gs-brand-link {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 1;
}
.gs-brand-link:hover { text-decoration: none; color: inherit; }

/* Logo completo: visible en sidebar expandido, oculto en colapsado (via .menu-text) */
.brand-logo-full {
    width: 148px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

/* Ícono: visible en sidebar colapsado, oculto en expandido */
.brand-logo-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: none;
    flex-shrink: 0;
}
.gs-brand:hover .brand-logo-full { opacity: 0.9; }
.gs-brand:hover .brand-logo-icon { opacity: 0.9; transform: rotate(4deg) scale(1.04); transition: transform 0.3s ease, opacity 0.2s ease; }

/* â”€â”€â”€ Scrollable Nav â”€â”€â”€ */
.gs-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}

/* =============================================
   HOME / INICIO â€” Active Module
   ============================================= */
.gs-home {
    padding: 4px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.gs-home-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}
.gs-home-link:hover {
    text-decoration: none;
    color: #334155;
    background: rgba(249, 250, 251, 0.8);
}
.gs-home-icon { font-size: 22px; width: 24px; text-align: center; }

/* Active state */
.gs-home.gs-active {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    animation: softPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.gs-home.gs-active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 16px;
    pointer-events: none;
}
.gs-home.gs-active .gs-home-link {
    color: var(--color-primary);
    font-weight: 600;
}
.gs-home.gs-active .gs-home-icon {
    color: var(--color-primary);
}

/* Active indicator bar */
.gs-active-bar {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(1);
    transform-origin: center;
    width: 6px;
    height: 32px;
    background: var(--color-primary);
    border-top-right-radius: 9999px;
    border-bottom-right-radius: 9999px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
    z-index: 10;
    transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =============================================
   SECTION CARDS â€” Glass Modules
   ============================================= */
.gs-section {
    padding: 10px;
    overflow: visible;
    /* Category color variables â€” defaults */
    --cat-color: #6366f1;
    --cat-color-10: rgba(99, 102, 241, 0.1);
    --cat-color-30: rgba(99, 102, 241, 0.3);
}
.gs-section:hover {
    transform: translateY(-2px);
    border-color: var(--cat-color-30);
    box-shadow: 0 4px 20px var(--cat-color-10);
}

/* Category color definitions */
.gs-section[data-cat="ops"]       { --cat-color: #10b981; --cat-color-10: rgba(16,185,129,0.1);  --cat-color-30: rgba(16,185,129,0.3); }
.gs-section[data-cat="pos"]       { --cat-color: #3b82f6; --cat-color-10: rgba(59,130,246,0.1);  --cat-color-30: rgba(59,130,246,0.3); }
.gs-section[data-cat="prod"]      { --cat-color: #8b5cf6; --cat-color-10: rgba(139,92,246,0.1);  --cat-color-30: rgba(139,92,246,0.3); }
.gs-section[data-cat="inv"]       { --cat-color: #f59e0b; --cat-color-10: rgba(245,158,11,0.1);  --cat-color-30: rgba(245,158,11,0.3); }
.gs-section[data-cat="supply"]    { --cat-color: #ef4444; --cat-color-10: rgba(239,68,68,0.1);   --cat-color-30: rgba(239,68,68,0.3); }
.gs-section[data-cat="menu"]      { --cat-color: #ec4899; --cat-color-10: rgba(236,72,153,0.1);  --cat-color-30: rgba(236,72,153,0.3); }
.gs-section[data-cat="clients"]   { --cat-color: #14b8a6; --cat-color-10: rgba(20,184,166,0.1);  --cat-color-30: rgba(20,184,166,0.3); }
.gs-section[data-cat="fin"]       { --cat-color: #0ea5e9; --cat-color-10: rgba(14,165,233,0.1);  --cat-color-30: rgba(14,165,233,0.3); }
.gs-section[data-cat="analytics"] { --cat-color: #6366f1; --cat-color-10: rgba(99,102,241,0.1);  --cat-color-30: rgba(99,102,241,0.3); }
.gs-section[data-cat="config"]    { --cat-color: #64748b; --cat-color-10: rgba(100,116,139,0.1); --cat-color-30: rgba(100,116,139,0.3); }

/* Active section glow */
.gs-section-active {
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.06), var(--glass-shadow);
}

/* â”€â”€â”€ Section Header â”€â”€â”€ */
.gs-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    transition: all 0.15s ease;
    outline: none;
    min-height: 44px;
}

.gs-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--cat-color-10);
    color: var(--cat-color);
    transition: transform 0.2s ease;
}
.gs-section-icon .material-icons { font-size: 18px; }
.gs-section-header:hover .gs-section-icon { transform: scale(1.1); }

/* Config gear rotates on hover */
.gs-section[data-cat="config"] .gs-section-header:hover .gs-section-icon {
    transform: rotate(90deg);
    transition-duration: 0.5s;
}

.gs-section-label {
    flex: 1;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    transition: color 0.2s ease;
    line-height: 1.35;
}
.gs-section-header:hover .gs-section-label { color: var(--cat-color); }

.gs-chevron {
    font-size: 16px;
    color: #94a3b8;
    transition: transform 0.25s ease, color 0.2s ease;
    flex-shrink: 0;
}
.gs-section-header:hover .gs-chevron { color: var(--cat-color); }
.gs-section-header[aria-expanded="true"] .gs-chevron { transform: rotate(90deg); }

/* â”€â”€â”€ Sub-items â”€â”€â”€ */
.gs-subitems {
    margin-top: 4px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 2px solid rgba(229, 231, 235, 1);
    position: relative;
}
/* Gradient overlay on left border */
.gs-subitems::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 33%;
    background: linear-gradient(to bottom, var(--cat-color-30), transparent);
    pointer-events: none;
}

.gs-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.15s ease;
    position: relative;
}
.gs-subitem .material-icons {
    font-size: 18px;
    opacity: 0.7;
    flex-shrink: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.gs-subitem:hover {
    background: rgba(249, 250, 251, 1);
    color: #111827;
    text-decoration: none;
}
.gs-subitem:hover .material-icons {
    opacity: 1;
    transform: translateX(2px);
}

/* Active sub-item */
.gs-subitem-active {
    background: rgba(99, 102, 241, 0.06);
    color: var(--color-primary);
    font-weight: 600;
}
.gs-subitem-active .material-icons {
    opacity: 1;
    color: var(--color-primary);
}

/* Coming soon â€” dimmed */
.gs-subitem-soon {
    opacity: 0.55;
}
.gs-subitem-soon:hover {
    background: rgba(249, 250, 251, 0.5);
    color: #94a3b8;
}

/* Badge "Pronto" */
.gs-badge-soon {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--cat-color-10);
    color: var(--cat-color);
    border: 1px solid var(--cat-color-30);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.gs-subitem:hover .gs-badge-soon { opacity: 1; }

/* =============================================
   USER FOOTER â€” Sidebar bottom
   ============================================= */
.gs-user {
    margin-top: auto;
    padding: 8px;
    flex-shrink: 0;
    cursor: pointer;
}
.gs-user:hover {
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
}
.gs-user-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.4);
}
.gs-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 2px 8px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.gs-user:hover .gs-user-avatar { transform: scale(1.05); }

.gs-user-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gs-user-role {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-top: 2px;
}
.gs-user-info {
    min-width: 0;
    flex: 1;
}
.gs-user-more {
    margin-left: auto;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.gs-user-more .material-icons { font-size: 20px; }
.gs-user:hover .gs-user-more { color: var(--color-primary); }

/* Superadmin "Add Page" button */
.gs-add-page {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    padding: 8px 16px !important;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    margin: 0 4px !important;
}
.gs-add-page:hover {
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

/* =============================================
   COLLAPSED SIDEBAR
   ============================================= */
body.glass-ui #sidebar-wrapper.collapsed {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding: 10px 6px;
    gap: 6px;
}

body.glass-ui #sidebar-wrapper.collapsed .gs-brand {
    padding: 10px 4px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-brand-link {
    justify-content: center;
}
/* En colapsado: mostrar solo el ícono */
body.glass-ui #sidebar-wrapper.collapsed .brand-logo-icon {
    display: block !important;
    width: 40px;
    height: 40px;
}

body.glass-ui #sidebar-wrapper.collapsed .gs-home {
    padding: 4px 2px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-home-link {
    justify-content: center;
    padding: 10px 4px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-home-icon {
    font-size: 24px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-active-bar {
    width: 4px;
    height: 20px;
}

body.glass-ui #sidebar-wrapper.collapsed .gs-section {
    padding: 4px 2px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-section-header {
    justify-content: center;
    padding: 8px 4px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-section-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto;
}

/* Hide collapsible sections when collapsed */
body.glass-ui #sidebar-wrapper.collapsed .collapse,
body.glass-ui #sidebar-wrapper.collapsed .collapsing,
body.glass-ui #sidebar-wrapper.collapsed .gs-subitems {
    display: none !important;
}

/* Hide chevrons when collapsed */
body.glass-ui #sidebar-wrapper.collapsed .gs-chevron {
    display: none !important;
}

body.glass-ui #sidebar-wrapper.collapsed .gs-user {
    padding: 4px 2px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-user-inner {
    justify-content: center;
    padding: 6px 4px;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-user-avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
    margin: 0 auto;
}

body.glass-ui #sidebar-wrapper.collapsed .gs-add-page {
    display: none !important;
}

/* â”€â”€â”€ Collapsed Sidebar Tooltips â”€â”€â”€ */
body.glass-ui #sidebar-wrapper.collapsed .gs-section {
    position: relative;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-section::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease;
    z-index: 100;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-section:hover::after {
    opacity: 1;
}

/* Tooltip for home */
body.glass-ui #sidebar-wrapper.collapsed .gs-home {
    position: relative;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-home::after {
    content: 'Inicio';
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease;
    z-index: 100;
}
body.glass-ui #sidebar-wrapper.collapsed .gs-home:hover::after {
    opacity: 1;
}

/* Dark-mode tooltips */
body.dark-mode.glass-ui #sidebar-wrapper.collapsed .gs-section::after,
body.dark-mode.glass-ui #sidebar-wrapper.collapsed .gs-home::after {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
}

/* =============================================
   TOPBAR â€” Glass Header
   ============================================= */
body.glass-ui #page-content-wrapper > nav.navbar {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    border-radius: 16px;
    height: 56px;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 5;
}

/* Sidebar toggle â€” glass pill */
body.glass-ui .sidebar-toggle-btn {
    background: rgba(255,255,255,0.6) !important;
    border: 1px solid rgba(229, 231, 235, 0.8) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}
body.glass-ui .sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.9) !important;
    border-color: #d1d5db !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* =============================================
   MAIN CONTENT AREA â€” Glass Card
   ============================================= */
body.glass-ui #page-content-wrapper {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 16px 0;
    flex-grow: 1;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.glass-content-area {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 12px;
    position: relative;
}

/* =============================================
   PAGE TRANSITIONS â€” Exit-only, fail-safe
   No entry animation (source of vibration/flicker on PHP reloads).
   Content is ALWAYS visible by default. Only the exit class hides it.
   ============================================= */

/* EXIT: JS adds on link click â€” fast fade-out before navigation */
.page-is-exiting {
    opacity: 0 !important;
    transform: translateY(-6px) !important;
    transition: opacity 160ms cubic-bezier(0.55, 0, 1, 0.45),
                transform 160ms cubic-bezier(0.55, 0, 1, 0.45) !important;
    pointer-events: none !important;
}

/* =============================================
   RESPONSIVE â€” Mobile
   ============================================= */
@media (max-width: 768px) {
    body.glass-ui .glass-sidebar {
        position: fixed;
        left: -300px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    body.glass-ui .glass-sidebar.show {
        left: 0;
    }
    body.glass-ui #page-content-wrapper {
        padding: 8px;
    }
}

/* =============================================
   DARK MODE â€” Glass overrides
   ============================================= */
body.dark-mode.glass-ui {
    /* [REBRAND 2026-04-24] Medianoche -> Ãndigo Oscuro */
    background: linear-gradient(135deg, var(--ih-midnight) 0%, var(--ih-indigo-deep) 100%) !important;
}
body.dark-mode.glass-ui::before { background: rgba(64, 80, 192, 0.14); }
body.dark-mode.glass-ui::after  { background: rgba(168, 224, 168, 0.06); }

body.dark-mode.glass-ui .glass-module {
    background: rgba(26, 32, 80, 0.65) !important;
    border-color: rgba(64, 80, 192, 0.45) !important;
}

body.dark-mode.glass-ui .gs-home-link { color: #94a3b8; }
body.dark-mode.glass-ui .gs-home.gs-active .gs-home-link { color: #818cf8; }

body.dark-mode.glass-ui .gs-section-label { color: #94a3b8; }
body.dark-mode.glass-ui .gs-chevron { color: #64748b; }

body.dark-mode.glass-ui .gs-subitems {
    border-left-color: #334155;
}
body.dark-mode.glass-ui .gs-subitem { color: #94a3b8; }
body.dark-mode.glass-ui .gs-subitem:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
}
body.dark-mode.glass-ui .gs-subitem-active { color: #818cf8; }

body.dark-mode.glass-ui .gs-user-name { color: #e2e8f0; }
body.dark-mode.glass-ui .gs-user-inner { background: rgba(30, 41, 59, 0.5); }

body.dark-mode.glass-ui #page-content-wrapper > nav.navbar {
    background: rgba(15, 23, 42, 0.6) !important;
    border-bottom-color: rgba(51, 65, 85, 0.5) !important;
}

body.dark-mode.glass-ui .glass-content-area {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(51, 65, 85, 0.8);
}

/* =============================================
   GLOBAL UTILITY BAR — compact authenticated controls
   ============================================= */
body.glass-ui .global-utility-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3, 12px);
    min-height: 56px;
    padding: var(--space-2, 8px) var(--space-4, 16px);
}

body.glass-ui .global-utility-start,
body.glass-ui .global-utility-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
}

body.glass-ui .global-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2, 8px);
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: var(--radius-md, 10px);
    background: rgba(255, 255, 255, .72);
    color: var(--text-main, #1A2050);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease-out, border-color 120ms ease-out, transform 120ms ease-out;
}

body.glass-ui .global-utility-bar #darkModeToggle,
body.glass-ui .global-utility-bar a[href="/logout"],
body.glass-ui .global-utility-bar .sidebar-toggle-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: var(--radius-md, 10px) !important;
}

body.glass-ui .global-icon-button:hover {
    background: rgba(255, 255, 255, .96);
    border-color: rgba(64, 80, 192, .38);
    color: var(--ih-indigo-active, #4050C0);
    text-decoration: none;
    transform: translateY(-1px);
}

body.glass-ui .global-icon-button:focus-visible,
body.glass-ui .global-upgrade-link:focus-visible {
    outline: 2px solid var(--ih-indigo-active, #4050C0);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

body.glass-ui .global-profile-button {
    width: auto;
    max-width: 184px;
    padding: 0 var(--space-3, 12px);
}

body.glass-ui .global-profile-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

body.glass-ui .global-upgrade-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2, 8px);
    padding: 0 var(--space-4, 16px);
    border-radius: var(--radius-md, 10px);
    background: rgba(255, 255, 255, .72);
    color: var(--text-main, #1A2050);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

body.dark-mode.glass-ui .global-icon-button,
body.dark-mode.glass-ui .global-upgrade-link {
    background: rgba(30, 41, 59, .82);
    border-color: rgba(148, 163, 184, .28);
    color: #e2e8f0;
}

@media (max-width: 768px) {
    body.glass-ui .global-icon-button {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }
    body.glass-ui .global-utility-bar #darkModeToggle,
    body.glass-ui .global-utility-bar a[href="/logout"],
    body.glass-ui .global-utility-bar .sidebar-toggle-btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }
    body.glass-ui .global-profile-button {
        width: 44px;
        padding: 0;
    }
    body.glass-ui .global-profile-name,
    body.glass-ui .global-utility-upgrade {
        display: none;
    }
}

/* =============================================
   SPECIFICITY OVERRIDES â€” Beat dashboard.css / sidebar-erp.css
   dashboard.css uses #sidebar-wrapper (ID) selectors that
   override class-based rules. These ID-level rules restore
   the glass design.
   ============================================= */
body.glass-ui #sidebar-wrapper {
    width: 300px !important;
    min-width: 300px !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 20;
    flex-shrink: 0;
    overflow: visible;
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1),
                min-width 300ms cubic-bezier(0.4, 0, 0.2, 1),
                padding 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Restore .menu-text display â€” dashboard.css forces display:inline */
body.glass-ui #sidebar-wrapper .menu-text {
    display: revert !important;
    opacity: 1 !important;
    transition: opacity 200ms ease;
}

/* Collapsed: hide text, keep icons */
body.glass-ui #sidebar-wrapper.collapsed {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding: 10px 6px;
    gap: 6px;
}
body.glass-ui #sidebar-wrapper.collapsed .menu-text {
    display: none !important;
    opacity: 0 !important;
}

/* Ensure section headers are always flex (never inline) */
body.glass-ui #sidebar-wrapper .gs-section-header {
    display: flex !important;
}

/* Ensure sub-items are block anchors */
body.glass-ui #sidebar-wrapper .gs-subitem {
    display: flex !important;
}

/* Override sidebar-erp collapsed rules for glass UI */
body.glass-ui #sidebar-wrapper.collapsed .erp-sidebar-section {
    display: none !important;
}

/* Override page-content-wrapper width from dashboard.css */
body.glass-ui #page-content-wrapper {
    width: auto !important;
    flex-grow: 1;
    min-width: 0;
    transition: margin-left 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
