* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== VARIABLES CSS - TEMA CLARO Y OSCURO ==================== */

:root {
    /* Tema Claro (por defecto) */
    --bg-primary: #e3e6e8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --bg-hover: #f4f4f4;
    --text-primary: #0b0b0b;
    --text-secondary: #595d62;
    --text-muted: #919ba1;
    --border-primary: #e3e6e8;
    --border-secondary: #d0d0d0;
    --shadow-sm: 0px 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-md: 0px 10px 18px 10px rgba(51, 51, 51, 0.08);
    
    /* Colores fijos (no cambian con tema) */
    --header-bg: #0b0b0b;
    --sidebar-bg: #0b0b0b;
    --green-primary: #077e38;
    --green-secondary: #24A148;
    --green-light: #f0f8f4;
    --green-hover: #066b30;
    --red-primary: #d32d22;
    --red-secondary: #da1e28;
    --gray-disabled: #e3e6e8;
}

/* Tema Oscuro */
html.dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2a2a2a;
    --bg-hover: #333333;
    --text-primary: #f4f4f4;
    --text-secondary: #c6c6c6;
    --text-muted: #8d8d8d;
    --border-primary: #3d3d3d;
    --border-secondary: #4a4a4a;
    --shadow-sm: 0px 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0px 10px 18px 10px rgba(0, 0, 0, 0.3);
    --green-light: rgba(7, 126, 56, 0.15);
}

/* ==================== ESTILOS GLOBALES ==================== */

body {
    background-color: var(--bg-primary);
    width: 100vw;
    height: var(--omega-shell-viewport-height, 100dvh);
    min-height: var(--omega-shell-viewport-height, 100dvh);
    overflow: hidden;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: background-color 0.3s ease;
}

/* ⚠️ IMPORTANTE: Anular padding de base.css cuando hay app-container
   base.css agrega padding al body para páginas de contenido simple,
   pero rompe el layout de header/sidebar del index.html */
body:has(.app-container) {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* ⚠️ IMPORTANTE: Anular overflow-y scroll forzado de base.css
   base.css fuerza html { overflow-y: scroll } para mostrar scrollbar siempre,
   pero en index.html NO queremos scrollbars innecesarios */
html:has(.app-container) {
    overflow: hidden !important;
}

/* App Container */
.app-container {
    background-color: var(--bg-primary);
    position: relative;
    width: 100%;
    height: var(--omega-shell-viewport-height, 100dvh);
    min-height: var(--omega-shell-viewport-height, 100dvh);
    overflow: hidden; /* ✅ FIX: Prevenir scrollbars en el contenedor principal */
    transition: background-color 0.3s ease;
}

/* Aviso de actualizacion dentro del shell navegable */
.omega-update-banner {
    margin: 10px 12px 0 12px;
    width: auto;
    border-radius: 4px;
}

@media (max-width: 767px) {
    .omega-update-banner {
        margin: 8px 8px 0 8px;
    }
}

/* Header */
.header {
    position: absolute;
    background-color: var(--header-bg);
    box-sizing: border-box;
    display: flex;
    height: 64px;
    align-items: center;
    left: 0;
    padding: 0 10px;
    right: 0;
    box-shadow: var(--shadow-md);
    top: 0;
}

@media (min-width: 768px) {
    .header {
        gap: 20px;
        padding: 0 20px;
    }
}

/* Mobile View */
.mobile-view {
    display: flex;
    width: 100%;
    align-items: center;
}

@media (min-width: 768px) {
    .mobile-view {
        display: none;
    }
}

/* Desktop View */
.desktop-view {
    display: none;
}

@media (min-width: 768px) {
    .desktop-view {
        display: flex;
        width: 100%;
        gap: 20px;
        align-items: center;
    }
}

/* Logo Omega (Desktop only) */
.logo-omega {
    width: 100px;
    height: 36px;
    flex-shrink: 0;
    cursor: pointer;
}

.logo-omega svg {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Mobile Breadcrumb */
.controles-mobile {
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
    min-height: 1px;
    min-width: 1px;
    position: relative;
    flex-shrink: 0;
}

.breadcrumb-mobile {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    width: 100%;
}

.icon-wrapper-mobile {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
    flex-shrink: 0;
}

.icon-mobile {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.icon-mobile svg {
    display: block;
    width: 100%;
    height: 100%;
}

.controls-mobile {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.controls-mobile svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Desktop Breadcrumb (Controles) */
.controles {
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
    min-height: 1px;
    min-width: 1px;
    position: relative;
    flex-shrink: 0;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    width: 100%;
}

.icon-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
    flex-shrink: 0;
}

.icon-home {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.icon-home svg {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.controls {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.controls svg {
    display: block;
    width: 100%;
    height: 100%;
}

.breadcrumb-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 0;
    font-style: normal;
    position: relative;
    flex-shrink: 0;
    font-size: 14px;
    white-space: nowrap;
    letter-spacing: 0.16px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
}

.breadcrumb-text.inactive {
    color: var(--text-muted);
}

.breadcrumb-text-parent {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 2px;
    cursor: pointer;
    line-height: 18px;
    transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.breadcrumb-text-parent p {
    line-height: 18px;
    white-space: nowrap;
}

.breadcrumb-text-parent:hover {
    color: #f4f4f4;
}

.breadcrumb-text-parent.is-open {
    color: #f4f4f4;
    background: rgba(36, 161, 72, 0.08);
    box-shadow: inset 0 0 0 1px rgba(36, 161, 72, 0.72);
}

.breadcrumb-text-parent:focus-visible {
    outline: none;
    color: #f4f4f4;
    background: rgba(36, 161, 72, 0.1);
    box-shadow: inset 0 0 0 1px rgba(36, 161, 72, 0.82);
}

.breadcrumb-parent-caret {
    display: inline-flex;
    width: 12px;
    height: 12px;
    color: inherit;
    opacity: 0.82;
    transform: translateY(1px);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.breadcrumb-text-parent.is-open .breadcrumb-parent-caret {
    transform: translateY(1px) rotate(180deg);
    opacity: 1;
}

.breadcrumb-parent-caret svg {
    display: block;
    width: 100%;
    height: 100%;
}

.breadcrumb-text.active {
    color: white;
}

.breadcrumb-text p {
    line-height: 18px;
    white-space: pre;
}

.breadcrumb-submenu {
    position: fixed;
    z-index: 10020;
    width: min(280px, calc(100vw - 16px));
    background: #ffffff;
    border: 1px solid #d9dde1;
    border-radius: 2px;
    box-shadow: 0 18px 40px rgba(11, 11, 11, 0.16);
    overflow: hidden;
    transform-origin: top left;
    animation: breadcrumb-submenu-enter 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.breadcrumb-submenu-header {
    padding: 9px 12px 8px;
    border-bottom: 1px solid #e3e6e8;
    background: #f9f9f9;
}

.breadcrumb-submenu-title {
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #595d62;
}

.breadcrumb-submenu-list {
    display: grid;
    gap: 0;
    padding: 4px 0;
}

.breadcrumb-submenu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border: none;
    border-left: 2px solid transparent;
    background: transparent;
    color: #0b0b0b;
    text-align: left;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
    line-height: 1.35;
}

button.breadcrumb-submenu-item {
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button.breadcrumb-submenu-item:hover,
button.breadcrumb-submenu-item:focus-visible {
    background: rgba(7, 126, 56, 0.06);
    border-left-color: #24a148;
    color: #077e38;
    outline: none;
}

.breadcrumb-submenu-item.is-current {
    background: rgba(7, 126, 56, 0.08);
    border-left-color: #24a148;
    color: #077e38;
}

.breadcrumb-submenu-item-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(7, 126, 56, 0.22);
    background: rgba(7, 126, 56, 0.08);
    color: #077e38;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

html.dark .breadcrumb-text-parent:hover {
    color: #ffffff;
}

html.dark .breadcrumb-text-parent.is-open {
    background: rgba(36, 161, 72, 0.14);
    box-shadow: inset 0 0 0 1px rgba(66, 190, 101, 0.8);
}

html.dark .breadcrumb-submenu {
    background: #161616;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
}

html.dark .breadcrumb-submenu-header {
    background: #1f1f1f;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark .breadcrumb-submenu-title {
    color: #c6c6c6;
}

html.dark .breadcrumb-submenu-item {
    color: #f4f4f4;
}

html.dark button.breadcrumb-submenu-item:hover,
html.dark button.breadcrumb-submenu-item:focus-visible {
    background: rgba(36, 161, 72, 0.14);
    border-left-color: #42be65;
    color: #6edb8e;
}

html.dark .breadcrumb-submenu-item.is-current {
    background: rgba(36, 161, 72, 0.16);
    border-left-color: #42be65;
    color: #6edb8e;
}

html.dark .breadcrumb-submenu-item-state {
    border-color: rgba(66, 190, 101, 0.26);
    background: rgba(36, 161, 72, 0.16);
    color: #8ae6a5;
}

@keyframes breadcrumb-submenu-enter {
    0% {
        opacity: 0;
        transform: translateY(-4px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Search Icon (44px) */
.omni-search-mobile {
    background-color: #595d62;
    box-sizing: border-box;
    display: flex;
    gap: 10px;
    align-items: center;
    overflow: hidden;
    padding: 10px;
    position: relative;
    border-radius: 2px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}

.omni-search-mobile svg {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Desktop Omni Search (Expanded) */
.omni-search {
    flex-basis: 0;
    background-color: #595d62;
    flex-grow: 1;
    min-height: 1px;
    min-width: 1px;
    position: relative;
    border-radius: 2px;
    flex-shrink: 0;
    cursor: text; /* ← FIX: Cursor de texto en todo el contenedor */
    border: 1px solid transparent;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* ← FIX BUG 2: Eliminar highlight verde en dark mode */
.omni-search:focus-within {
    outline: none;
    border-color: #24A148;
    box-shadow: inset 0 0 0 1px #24A148;
}

.search-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow: hidden;
    border-radius: inherit;
    width: 100%;
    height: 100%;
    cursor: text; /* ← FIX: Cursor de texto en todo el inner */
}

.search-content {
    box-sizing: border-box;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    position: relative;
    width: 100%;
    cursor: text; /* ← FIX: Cursor de texto en el content */
}

.search-clear-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-family: inherit;
    font-size: 22px;
    line-height: 1;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.search-clear-btn.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-clear-btn:hover,
.search-clear-btn:focus-visible {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
    outline: none;
}

.search-icon-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
    flex-shrink: 0;
}

.search-icon {
    position: relative;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.search-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.search-input-text {
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    flex-grow: 1;
    justify-content: center;
    line-height: 0;
    min-height: 1px;
    min-width: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    flex-shrink: 0;
    font-size: 14px;
    white-space: nowrap;
    color: white;
}

.search-input-text p {
    white-space: collapse;
    line-height: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search Input Field */
.search-input-field {
    flex-basis: 0;
    flex-grow: 1;
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    color: white;
    caret-color: white;
    color-scheme: light;
    -webkit-text-fill-color: currentColor;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 14px;
    padding: 0;
    width: 100%;
}

.omni-search .search-input-field {
    background: transparent;
}

.search-input-field:focus,
.search-input-field:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.search-input-field::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.16), 0px 2px 4px rgba(0, 0, 0, 0.08);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

html.dark .search-results-dropdown {
    background-color: #161616;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0px 10px 28px rgba(0, 0, 0, 0.42), 0px 4px 10px rgba(0, 0, 0, 0.28);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #e3e6e8;
}

html.dark .search-result-item {
    background-color: #161616;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f5f6f7;
}

html.dark .search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.search-result-item.is-active {
    background-color: #f0f8f4;
}

html.dark .search-result-item.is-active {
    background-color: rgba(7, 126, 56, 0.32);
}

.search-result-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-result-icon svg {
    width: 100%;
    height: 100%;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #0b0b0b;
    margin-bottom: 2px;
}

.search-result-breadcrumb {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #919ba1;
}

html.dark .search-result-title {
    color: #f4f4f4;
}

html.dark .search-result-breadcrumb,
html.dark .search-no-results {
    color: #c6c6c6;
}

html.dark .search-no-results {
    background-color: #161616;
}

.search-no-results {
    padding: 20px 16px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #919ba1;
}

/* ==================== MAIN CONTENT ==================== */

/* Área de contenido principal - Mobile */
.main-content {
    position: absolute;
    top: var(--omega-shell-header-height, 64px); /* Debajo del header */
    left: 0;
    right: 0;
    bottom: var(--omega-shell-bottom-reserve, 56px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px; /* Canon de 5px alrededor del contenido */
    box-sizing: border-box;
    min-height: 0;
}

/* Desktop: Ajustar para sidebar izquierdo */
@media (min-width: 768px) {
    .main-content {
        left: 64px; /* Ancho del sidebar colapsado */
        bottom: var(--omega-shell-bottom-reserve, 0px);
        padding: 5px; /* Canon de 5px */
        transition: left 0.3s ease;
    }

    .main-content.no-floating-space {
        bottom: 5px !important;
    }

    #mainContent.no-floating-space {
        bottom: 5px !important;
    }

    /* Cuando sidebar está expandido (clase añadida por sidebar.js) */
    .sidebar-expanded .main-content {
        left: var(--sidebar-width-expanded, 280px); /* 🔧 Ancho variable S/M/L */
    }
}

/* Estilos para h1 dentro de main-content */
.main-content h1 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 32px;
    line-height: 40px;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}

.dev-layout-intro {
    width: min(760px, calc(100% - 40px));
    margin: 48px auto 0;
    padding: 28px 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    background: var(--surface-primary, #ffffff);
    border: 1px solid var(--border-subtle, #d9dde1);
    box-shadow: 0 12px 32px rgba(11, 11, 11, 0.08);
    box-sizing: border-box;
}

.dev-layout-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.dev-layout-copy h1 {
    margin: 0;
}

.dev-layout-copy p {
    max-width: 540px;
    margin: 0;
    color: var(--text-secondary, #525252);
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

.dev-layout-copy code {
    padding: 1px 5px;
    font-family: 'Roboto Condensed', monospace;
    font-size: 0.95em;
    background: var(--field-bg, #eef0f2);
    color: var(--text-primary, #0b0b0b);
    border: 1px solid var(--border-subtle, #d9dde1);
}

.dev-layout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    align-self: center;
    min-height: 44px;
    padding: 0 18px 0 16px;
    background: var(--button-primary-bg, #077e38);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(7, 126, 56, 0.22);
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.dev-layout-link:visited,
.dev-layout-link:active {
    color: #ffffff !important;
}

.dev-layout-link:hover {
    background: var(--button-primary-hover, #0a6d33);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 14px 28px rgba(7, 126, 56, 0.28);
    transform: translateY(-1px);
}

.dev-layout-link:focus-visible {
    outline: 2px solid #21b25a;
    outline-offset: 3px;
}

.dev-layout-link svg {
    flex: 0 0 auto;
    transition: transform 0.18s ease;
}

.dev-layout-link:hover svg,
.dev-layout-link:focus-visible svg {
    transform: translateX(2px);
}

body.dark-mode .dev-layout-intro,
.dark .dev-layout-intro {
    background: #0f1113;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

body.dark-mode .dev-layout-link,
.dark .dev-layout-link {
    background: #0b8f43;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36);
}

body.dark-mode .dev-layout-link:hover,
.dark .dev-layout-link:hover {
    background: #0a7d3a;
}

body.dark-mode .dev-layout-copy code,
.dark .dev-layout-copy code {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f4f4f4;
}

@media (max-width: 767px) {
    .dev-layout-intro {
        width: 100%;
        margin: 12px 0 0;
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }

    .dev-layout-link {
        width: 100%;
    }
}

/* ==================== SIDEBAR ==================== */

/* Mobile Sidebar (Bottom, Horizontal) - COLAPSADO POR DEFECTO */
.sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    --menu-feedback-y: 96px;
    --menu-feedback-core: rgba(36, 161, 72, 0.28);
    --menu-feedback-soft: rgba(36, 161, 72, 0.14);
    background-color: var(--sidebar-bg);
    border-top: 1px solid #595d62;
    box-shadow: 0px 6px 10px 4px rgba(0, 0, 0, 0.15), 0px 2px 3px 0px rgba(0, 0, 0, 0.3);
    z-index: 100;
    height: 64px;
    transition: height 0.3s ease;
}

.sidebar::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    top: calc(var(--menu-feedback-y) - 48px);
    height: 112px;
    border-radius: 18px;
    background: radial-gradient(circle at 34px 50%, var(--menu-feedback-core) 0%, var(--menu-feedback-soft) 34%, transparent 72%);
    opacity: 0;
    pointer-events: none;
    filter: blur(12px);
    transform: translateX(-22px) scaleX(0.92);
    transition: opacity 0.22s ease, transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar.menu-feedback-active::after {
    opacity: 1;
    transform: translateX(0) scaleX(1);
}

/* ==================== TOOLTIPS ==================== */

/* Tooltip global - Se crea via JavaScript como hijo de body */
.global-tooltip {
    position: fixed;
    background-color: #0b0b0b;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.16px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 99999; /* Muy alto para estar por encima de todo */
    border: 1px solid #595d62;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.24);
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.global-tooltip[data-show="true"] {
    opacity: 1;
    visibility: visible;
}

.global-tooltip .tooltip-text {
    display: block;
}

.global-tooltip .tooltip-arrow {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 6px 0;
    border-color: transparent #0b0b0b transparent transparent;
}

/* Tooltip específico para tablas y botones flotantes - Sin flecha */
.global-tooltip.table-tooltip .tooltip-arrow {
    display: none;
}

.sidebar-content {
    display: flex;
    align-items: center;
    padding: 12px;
    height: 100%;
    gap: 5px;
    transition: all 0.3s ease;
    /* ✅ FIX: REMOVER overflow: hidden para permitir que .sidebar-icons tenga scroll */
    /* 🔧 NO position: relative aquí - se aplica específicamente en mobile cuando sea necesario */
}

/* Sidebar content cuando está expandido en mobile */
.sidebar.mobile-expanded .sidebar-content {
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    align-items: center;
}

/* Logo Omega Simple (Mobile colapsado) */
.logo-omega-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.logo-omega-simple svg {
    display: block;
    width: 20px;
    height: 28px;
    flex-shrink: 0;
}

/* Logo Omega COMPLETO (Mobile expandido) */
.logo-omega-complete {
    display: none;
    width: 134px;
    height: 37px;
    background-color: #0b0b0b;
    border-radius: 8px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar.mobile-expanded .logo-omega-simple {
    display: none;
}

.sidebar.mobile-expanded .logo-omega-complete {
    display: flex;
}

.logo-omega-complete svg {
    display: block;
    width: 134px;
    height: 36.635px;
    cursor: pointer;
}

/* Expand/Collapse Arrow (Mobile only, floats top center) */
.expand-collapse-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: calc(50% + 0.5px);
    top: -16px;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    z-index: 10;
}

.sidebar.mobile-expanded .expand-collapse-arrow {
    top: -15px;
}

.expand-collapse-button {
    width: 24px;
    height: 24px;
    background-color: #0b0b0b;
    border: 1px solid #595d62;
    border-radius: 9999px;
    box-shadow: 0px 6px 6px -6px rgba(0, 0, 0, 0.16), 0px 0px 1px 0px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(270deg);
    cursor: pointer;
    position: relative;
    left: 4px;
    top: 4px;
}

.expand-collapse-button svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Chevron derecha cuando colapsado, izquierda cuando expandido */
.expand-collapse-button .chevron-right {
    display: block;
}

.expand-collapse-button .chevron-left {
    display: none;
}

.sidebar.mobile-expanded .expand-collapse-button .chevron-right {
    display: none;
}

.sidebar.mobile-expanded .expand-collapse-button .chevron-left {
    display: block;
}

/* Gradient Left (Mobile only) */
.gradient-left {
    display: block;
    position: absolute;
    left: 57px;
    top: 1px;
    bottom: 0;
    width: 30px;
    background-color: #0b0b0b;
    pointer-events: none;
    z-index: 5;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 100%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* Gradient Right (Mobile only) */
.gradient-right {
    display: block;
    position: absolute;
    right: 57px;
    top: 1px;
    bottom: 0;
    width: 30px;
    background-color: #0b0b0b;
    pointer-events: none;
    z-index: 5;
    -webkit-mask-image: linear-gradient(90deg, black 0%, transparent 100%);
    mask-image: linear-gradient(90deg, black 0%, transparent 100%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* Position Indicator (Red bar) - Mobile: hidden initially */
.position-indicator {
    display: none;
}

/* Iconos del menú - Mobile: Horizontal scroll */
.sidebar-icons {
    display: flex;
    flex-direction: row;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 0 10px;
}

.sidebar-icons::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0b0b0b;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box; /* 🔧 CRÍTICO: Asegurar que respeta el ancho */
}

.sidebar.expanded .sidebar-icon {
    width: 100%;
    box-sizing: border-box; /* 🔧 CRÍTICO: Asegurar que respeta el ancho */
}

/* 🔧 NUEVO: Efecto visual ligero en mousedown para respuesta inmediata */
.sidebar-icon:active,
.submenu-item:active,
.sidebar-user-content:active {
    opacity: 0.7;
    transform: scale(0.98);
}

.sidebar-icon:hover {
    background-color: #1f1f1f;
}

.sidebar-icon.active {
    background-color: #0b0b0b;
}

.sidebar-icon.shortcut-nav-focus {
    background-color: rgba(36, 161, 72, 0.18);
    box-shadow: inset 0 0 0 1px rgba(36, 161, 72, 0.75);
}

.sidebar-icon.shortcut-nav-focus .menu-item-text p,
.sidebar-icon.shortcut-nav-focus .menu-item-icon svg,
.sidebar-icon.shortcut-nav-focus > svg {
    filter: brightness(1.05);
}

.sidebar-icon > svg {
    width: 24px;
    height: 24px;
    pointer-events: none; /* 🔑 Permitir que el hover pase al contenedor padre */
}

.menu-origin-pressed {
    animation: menu-origin-press 0.42s cubic-bezier(0.18, 0.9, 0.22, 1);
}

.sidebar.menu-feedback-active .sidebar-icon.menu-feedback-target,
.sidebar.expanded .sidebar-icon.menu-feedback-target .menu-item-inner {
    animation: menu-target-highlight 0.92s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar.expanded .submenu-container.menu-feedback-target .submenu-items {
    animation: submenu-target-reveal 0.82s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar.expanded .submenu-container.menu-feedback-target .submenu-item {
    animation: submenu-item-settle 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes menu-origin-press {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(0.88);
    }
    62% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes menu-target-highlight {
    0% {
        box-shadow: inset 0 0 0 0 rgba(36, 161, 72, 0), 0 0 0 0 rgba(36, 161, 72, 0);
        transform: translateX(0);
    }
    28% {
        box-shadow: inset 0 0 0 1px rgba(36, 161, 72, 0.72), 0 0 0 12px rgba(36, 161, 72, 0.12);
        transform: translateX(3px);
    }
    62% {
        box-shadow: inset 0 0 0 1px rgba(36, 161, 72, 0.48), 0 0 0 18px rgba(36, 161, 72, 0.04);
        transform: translateX(1px);
    }
    100% {
        box-shadow: inset 0 0 0 0 rgba(36, 161, 72, 0), 0 0 0 0 rgba(36, 161, 72, 0);
        transform: translateX(0);
    }
}

@keyframes submenu-target-reveal {
    0% {
        opacity: 0.14;
        transform: translateY(-12px);
    }
    40% {
        opacity: 0.9;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes submenu-item-settle {
    0% {
        opacity: 0.16;
        transform: translateX(-12px);
    }
    45% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-user {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    min-width: 0; /* 🔑 CRÍTICO para ellipsis en flexbox anidado */
    width: 100%; /* Asegurar que tiene ancho definido */
}

.divider {
    width: 1px;
    height: 40px;
    background-color: #595d62;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: rgba(211, 45, 34, 0.32);
    border-radius: 9999px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 24px;
    color: #d32d22;
    text-align: center;
    cursor: pointer;
}

/* ==================== MOBILE EXPANDED STYLES ==================== */

/* OCULTAR botón "Colapsar menú" en mobile - SOLO DESKTOP */
.collapse-menu-button {
    display: none !important;
}

/* Ocultar gradientes cuando está expandido */
.sidebar.mobile-expanded .gradient-left,
.sidebar.mobile-expanded .gradient-right {
    display: none;
}

/* Iconos del menú - Mobile EXPANDIDO: Vertical sin scroll */
.sidebar.mobile-expanded .sidebar-icons {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: visible;
    flex: initial;
    padding: 0;
    width: 100%;
}

/* Mobile colapsado: mostrar solo SVG, ocultar menu-item-inner */
.sidebar-icon > svg {
    display: block;
}

.sidebar-icon .menu-item-inner {
    display: none;
}

/* Mobile expandido: ocultar SVG, mostrar menu-item-inner */
.sidebar.mobile-expanded .sidebar-icon {
    width: 100%;
}

.sidebar.mobile-expanded .sidebar-icon > svg {
    display: none;
}

.sidebar.mobile-expanded .sidebar-icon .menu-item-inner {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Estilos para menu-item-inner en mobile expandido */
.sidebar.mobile-expanded .menu-item-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.mobile-expanded .menu-item-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sidebar.mobile-expanded .menu-item-text {
    display: flex !important;
    flex: 1;
    min-width: 1px;
    min-height: 1px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.16px;
    color: white;
    flex-direction: column;
    justify-content: center;
}

.sidebar.mobile-expanded .menu-item-text p {
    margin: 0;
    line-height: 20px;
}

.sidebar.mobile-expanded .menu-item-arrow {
    display: block !important;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

/* Colapsar menú - SIN flecha dropdown */
.sidebar.mobile-expanded .collapse-menu-item .menu-item-arrow {
    display: none !important;
}

/* Colapsar menú - Texto verde EXPANDIDO #0CB250 */
.sidebar.mobile-expanded .collapse-menu-item .collapse-menu-text {
    color: #0CB250 !important;
}

/* Icono COLAPSADO - solo visible cuando sidebar NO expandido - Verde claro #42BE65 */
.collapse-icon-only {
    display: block;
}

.sidebar.mobile-expanded .collapse-icon-only {
    display: none !important;
}

.sidebar.mobile-expanded .menu-item-arrow svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Control de flechas arrow-down (roja, cerrado) y arrow-up (blanca, abierto) - MOBILE */
.sidebar.mobile-expanded .menu-item-arrow .arrow-down {
    display: block; /* Por defecto mostrar flecha roja (cerrado) */
}

.sidebar.mobile-expanded .menu-item-arrow .arrow-up {
    display: none; /* Por defecto ocultar flecha blanca (abierto) */
}

/* Cuando el item tiene clase 'expanded', invertir las flechas - MOBILE */
.sidebar.mobile-expanded .sidebar-icon.expanded .menu-item-arrow .arrow-down {
    display: none; /* Ocultar flecha roja */
}

.sidebar.mobile-expanded .sidebar-icon.expanded .menu-item-arrow .arrow-up {
    display: block; /* Mostrar flecha blanca */
}

/* Mobile expandido: width 100% y mostrar menu-item-inner */
.sidebar.mobile-expanded .sidebar-icon {
    width: 100%;
}

.sidebar.mobile-expanded .sidebar-icon > svg {
    display: none;
}

.sidebar.mobile-expanded .sidebar-icon .menu-item-inner {
    display: flex;
}

/* Mobile expandido: Divider horizontal completo + usuario con info */
.sidebar.mobile-expanded .sidebar-user {
    flex-direction: column;
    width: 100%;
    gap: 16px;
}

.sidebar.mobile-expanded .divider {
    width: 100%;
    height: 1px;
}

/* Mostrar user-info y user-dropdown-arrow en mobile expandido */
.sidebar.mobile-expanded .user-info {
    display: flex !important;
}

.sidebar.mobile-expanded .user-dropdown-arrow {
    display: block !important;
}

/* User info - Oculto por defecto (mobile colapsado y desktop colapsado) */
.user-info {
    display: none;
    flex: 1; /* Permite grow y shrink */
    min-width: 0; /* CRÍTICO para que funcione el truncate */
    flex-direction: column;
    gap: 0;
    color: white;
}

.sidebar.expanded .user-info {
    display: flex;
}

.user-name {
    font-family: 'IBM Plex Sans Condensed', sans-serif; /* ✅ Condensed para compactar horizontalmente */
    font-weight: 600;
    font-size: 14px;
    line-height: 24px; /* ✅ Cambio de 20px → 24px según Figma */
    letter-spacing: 0.16px;
    margin: 0;
    /* Truncamiento */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.user-role {
    font-family: 'IBM Plex Sans Condensed', sans-serif; /* ✅ Condensed para compactar horizontalmente */
    font-weight: 700;
    font-size: 9px;
    line-height: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    /* Truncamiento */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* User dropdown arrow - Oculto por defecto */
.user-dropdown-arrow {
    display: none;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.user-dropdown-arrow svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Adjust user section layout */
    .sidebar-user-content {
        display: flex;
        gap: 16px;
        align-items: center;
        width: 100%;
        min-width: 0; /* 🔑 CRÍTICO para ellipsis en flexbox anidado */
        overflow: hidden; /* 🔑 Esconde desbordamiento */
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        text-align: left;
        color: inherit;
        /* 🔧 NUEVO: Centrar contenido cuando sidebar colapsado */
        justify-content: center;
    }
    
    /* 🔧 NUEVO: Cuando expandido, resetear a flex-start */
    .sidebar.expanded .sidebar-user-content {
        justify-content: flex-start;
    }

    .sidebar-user-content:hover {
        opacity: 0.9;
    }

/* Avatar container - nunca se encoge */
.avatar-container {
    flex-shrink: 0 !important;
    /* ✅ Estilos base para TODOS los avatares (desktop) */
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--avatar-bg-color, rgba(211, 45, 34, 0.32));
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ❌ NO overflow:hidden para que el badge quede FUERA del círculo */
}

/* Imagen dentro del avatar - ESTA sí necesita overflow:hidden para ser circular */
.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Iniciales dentro del avatar */
.avatar-container .avatar-initials {
    color: var(--avatar-initials-color, #D32D22);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.16px;
    margin: 0;
    line-height: 1;
}

/* Badge de notificaciones en desktop */
.avatar-container .notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #24A148;
    border-radius: 50%;
    border: 2px solid #0b0b0b;
    z-index: 10;
}

/* ==================== DESKTOP SIDEBAR (Left, Vertical) ==================== */
@media (min-width: 768px) {
    .sidebar {
        position: fixed;
        top: 64px; /* Below header */
        left: 0;
        bottom: 0;
        right: auto;
        width: 64px;
        height: auto;
        border-top: none;
        border-right: 1px solid #595d62;
        box-shadow: 0px 10px 18px 10px rgba(51, 51, 51, 0.08);
        transition: width 0.3s ease;
        overflow: hidden; /* 🔧 CRÍTICO: Ocultar TODO desbordamiento */
    }

    /* Sidebar Expanded State (Desktop) */
    .sidebar.expanded {
        width: var(--sidebar-width-expanded, 280px); /* 🔧 Ancho variable S/M/L */
    }

    /* 🔧 MÉTODO NUEVO: Padding CERO cuando colapsado */
    .sidebar:not(.expanded) .sidebar-content {
        padding: 0; /* Sin padding cuando colapsado */
        align-items: center; /* 🔧 NUEVO: Centrar TODOS los hijos (iconos Y usuario) */
    }

    /* 🔧 Padding normal cuando expandido */
    .sidebar.expanded .sidebar-content {
        padding: 12px; /* Padding completo cuando expandido */
    }

    .sidebar-content {
        flex-direction: column;
        height: 100%;
        display: flex;
        position: static;
        box-sizing: border-box;
        overflow: hidden; /* 🔧 Prevenir cualquier desbordamiento */
        width: 100%; /* 🔧 Tomar el 100% del sidebar */
    }
    
    /* 🔧 NUEVO: Cuando está expandido, aplicar padding completo */
    .sidebar.expanded .sidebar-content {
        padding: 12px; /* Padding completo en todos los lados */
        align-items: stretch; /* Resetear a comportamiento normal */
        position: relative;
    }

    /* Hide mobile-only elements in desktop */
    .logo-omega-simple {
        display: none;
    }

    .expand-collapse-arrow {
        display: none;
    }

    .gradient-left,
    .gradient-right {
        display: none;
    }

    /* Collapse Menu Button (Desktop only, visible when expanded) */
    .collapse-menu-button {
        display: none;
        width: 100%;
        background-color: #0b0b0b;
        border-radius: 8px;
        cursor: pointer;
        transition: background-color 0.2s;
        margin-bottom: 5px;
        overflow: hidden;
    }

    .sidebar.expanded .collapse-menu-button {
        display: block;
    }

    .collapse-menu-button:hover {
        background-color: #1f1f1f;
    }

    .menu-item-inner {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 12px;
        padding: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .menu-item-icon {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .menu-item-icon svg {
        display: block;
        width: 100%;
        height: 100%;
    }

    .menu-item-text {
        display: none;
        flex: 1;
        min-width: 1px;
        min-height: 1px;
        font-family: 'IBM Plex Sans', sans-serif;
        font-weight: 400;
        font-size: 14px;
        line-height: 20px;
        letter-spacing: 0.16px;
        color: white;
    }

    .collapse-menu-button .menu-item-text {
        color: #0cb250;
    }

    .sidebar.expanded .menu-item-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .menu-item-text p {
        margin: 0;
        line-height: 20px;
    }

    .menu-item-arrow {
        display: none;
        flex-shrink: 0;
        width: 24px;
        height: 24px;
    }

    .sidebar.expanded .menu-item-arrow {
        display: block;
    }

    /* Colapsar menú - SIN flecha dropdown - DESKTOP */
    .collapse-menu-item .menu-item-arrow {
        display: none !important;
    }

    .sidebar.expanded .collapse-menu-item .menu-item-arrow {
        display: none !important;
    }

    /* Colapsar menú - Texto verde EXPANDIDO #0CB250 - DESKTOP */
    .sidebar.expanded .collapse-menu-item .collapse-menu-text {
        color: #0CB250 !important;
    }

    /* Icono COLAPSADO - solo visible cuando sidebar NO expandido - DESKTOP */
    .sidebar .collapse-icon-only {
        display: block;
    }

    .sidebar.expanded .collapse-icon-only {
        display: none !important;
    }

    .menu-item-arrow svg {
        display: block;
        width: 100%;
        height: 100%;
    }

    /* Control de flechas arrow-down (roja, cerrado) y arrow-up (blanca, abierto) */
    .menu-item-arrow .arrow-down {
        display: block; /* Por defecto mostrar flecha roja (cerrado) */
    }

    .menu-item-arrow .arrow-up {
        display: none; /* Por defecto ocultar flecha blanca (abierto) */
    }

    /* Cuando el item tiene clase 'expanded', invertir las flechas */
    .sidebar-icon.expanded .menu-item-arrow .arrow-down {
        display: none; /* Ocultar flecha roja */
    }

    .sidebar-icon.expanded .menu-item-arrow .arrow-up {
        display: block; /* Mostrar flecha blanca */
    }

    /* Position Indicator (Red bar) - Desktop: Visible */
    .position-indicator {
        display: block;
        position: absolute;
        left: 0;
        top: 0; /* Se actualiza dinámicamente por JS */
        width: 5px;
        height: 24px;
        background-color: #d32d22;
        pointer-events: none;
        z-index: 999; /* 🔧 AUMENTADO de 10 → 999 para estar por encima de todo */
        transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* NO override de posición cuando expandido - el JS calcula dinámicamente */

    /* Iconos del menú - Desktop: Vertical */
    .sidebar-icons {
        flex-direction: column;
        gap: 0px;
        overflow-x: visible;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
        padding: 0;
        /* Custom scrollbar MUY delgado - 3px */
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
        width: 100%;
        max-width: 100%;
        /* 🔧 CRÍTICO NUEVO: Centrar los iconos cuando sidebar está colapsado */
        align-items: center;
    }
    
    /* 🔧 NUEVO: Cuando expandido, alinear a stretch */
    .sidebar.expanded .sidebar-icons {
        align-items: stretch;
    }

    .sidebar-icons::-webkit-scrollbar {
        width: 3px;
    }

    .sidebar-icons::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-icons::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 2px; /* 🔧 Reducido de 3px → 2px para scrollbar más delgado */
    }

    .sidebar-icons::-webkit-scrollbar-thumb:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }

    .sidebar-scroll-arrow {
        position: absolute;
        left: 50%;
        width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.16);
        color: rgba(255, 255, 255, 0.92);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
        backdrop-filter: blur(8px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.18s ease, visibility 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
        z-index: 1200;
        transform: translateX(-50%);
    }

    .sidebar-scroll-arrow::before {
        content: '';
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 44px;
        height: 56px;
        pointer-events: none;
        z-index: -1;
    }

    .sidebar-scroll-arrow-up {
        top: 10px;
    }

    .sidebar-scroll-arrow-up::before {
        top: -12px;
        background: linear-gradient(180deg, rgba(11, 11, 11, 0.48) 0%, rgba(11, 11, 11, 0) 100%);
    }

    .sidebar-scroll-arrow-down {
        bottom: 82px;
    }

    .sidebar-scroll-arrow-down::before {
        bottom: -12px;
        background: linear-gradient(0deg, rgba(11, 11, 11, 0.48) 0%, rgba(11, 11, 11, 0) 100%);
    }

    .sidebar.sidebar-scrollable .sidebar-scroll-arrow[data-visible="true"] {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-scroll-arrow:hover {
        background: rgba(255, 255, 255, 0.24);
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.18);
    }

    .sidebar-scroll-arrow:disabled {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .sidebar-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #0b0b0b;
        border-radius: 8px;
        cursor: pointer;
        transition: background-color 0.2s;
        box-sizing: border-box; /* 🔧 CRÍTICO: Asegurar que respeta el ancho */
    }

    .sidebar.expanded .sidebar-icon {
        width: 100%;
        box-sizing: border-box; /* 🔧 CRÍTICO: Asegurar que respeta el ancho */
    }

    /* Hide icon-only view, show full menu item in expanded state */
    .sidebar-icon > svg {
        display: block;
    }

    .sidebar.expanded .sidebar-icon > svg {
        display: none;
    }

    .sidebar-icon .menu-item-inner {
        display: none;
    }

    .sidebar.expanded .sidebar-icon .menu-item-inner {
        display: flex;
    }

    /* Mostrar submenús cuando sidebar está expandido en desktop */
    .sidebar.expanded .submenu-container[data-expanded="true"] {
        display: grid !important;
    }

    /* ✅ Estilos para SUBMENU */
    .submenu-container {
        width: 100%;
        display: none;
        grid-template-rows: 0fr;
        opacity: 0.96;
        transform: translateY(-4px);
        transition:
            grid-template-rows 0.42s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.24s ease,
            transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .sidebar.expanded .submenu-container {
        display: grid;
    }

    .submenu-container[data-expanded="true"] {
        grid-template-rows: 1fr;
        opacity: 1;
        transform: translateY(0);
    }

    .submenu-items {
        min-height: 0; /* Necesario para que grid funcione correctamente */
        overflow: hidden; /* Solo durante la transición */
        background: #0B0B0B;
        border-radius: 10px;
        padding: 4px 0;
        display: flex;
        flex-direction: column;
        gap: 5px;
        transition:
            padding 0.42s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.24s ease,
            transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
        position: relative; /* 🎨 Para posicionar la línea vertical */
        opacity: 0.1;
        transform: translateY(-6px);
    }
    
    /* 🎨 Línea vertical continua alineada al centro del icono */
    .submenu-items::before {
        content: '';
        position: absolute;
        left: 20px; /* Centro del icono: 8px padding + 12px (mitad de 24px icono) */
        top: 0;
        bottom: 0;
        width: 1px;
        background-color: rgba(255, 255, 255, 0.15);
        pointer-events: none; /* No interferir con clicks */
    }

    .submenu-item {
        background: transparent; /* 🎨 Transparente para que la línea se vea continua */
        border-radius: 2px;
        padding: 8px 16px 8px 32px; /* 🎨 Padding izquierdo mayor para dar espacio a la línea */
        cursor: pointer;
        transition:
            background-color 0.2s ease,
            opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
            transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        margin: 0 8px; /* Margen horizontal en lugar de padding en el contenedor */
        opacity: 0;
        transform: translateY(-6px);
    }

    .submenu-container[data-expanded="true"] .submenu-items {
        padding: 8px 0;
        opacity: 1;
        transform: translateY(0);
    }

    .submenu-container[data-expanded="true"] .submenu-item {
        opacity: 1;
        transform: translateY(0);
    }

    .submenu-container[data-expanded="true"] .submenu-item:nth-child(1) { transition-delay: 0.03s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(2) { transition-delay: 0.055s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(3) { transition-delay: 0.08s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(4) { transition-delay: 0.105s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(5) { transition-delay: 0.13s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(6) { transition-delay: 0.155s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(7) { transition-delay: 0.18s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(8) { transition-delay: 0.205s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(9) { transition-delay: 0.23s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(10) { transition-delay: 0.255s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(11) { transition-delay: 0.28s; }
    .submenu-container[data-expanded="true"] .submenu-item:nth-child(12) { transition-delay: 0.305s; }

    .submenu-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .submenu-item p {
        font-family: 'IBM Plex Sans', sans-serif;
        font-weight: 400;
        font-size: 14px;
        line-height: 24px;
        color: white;
        margin: 0;
        white-space: nowrap;
    }

    .submenu-item.active p {
        color: #0CB250;
    }

    .submenu-item.shortcut-nav-focus {
        background: rgba(36, 161, 72, 0.16);
        box-shadow: inset 0 0 0 1px rgba(36, 161, 72, 0.72);
    }

    .submenu-item.shortcut-nav-focus p {
        color: #ffffff;
    }

    /* Ocultar submenús cuando sidebar está colapsado en desktop */
    .sidebar:not(.expanded) .submenu-container {
        display: none !important;
    }

    /* Mostrar submenús cuando sidebar está expandido en desktop */
    .sidebar.expanded .submenu-container[data-expanded="true"] {
        display: grid !important;
    }

    /* User section - Desktop: Vertical */
    .sidebar-user {
        flex-direction: column;
        gap: 16px;
        flex-shrink: 0; /* ✅ FIX: FIJO en la parte inferior, NO se mueve con scroll */
        /* 🔧 NUEVO: Centrar elementos cuando el sidebar está colapsado */
        align-items: center;
    }
    
    /* 🔧 NUEVO: Padding bottom cuando colapsado */
    .sidebar:not(.expanded) .sidebar-user {
        padding-bottom: 10px;
    }
    
    /* 🔧 NUEVO: Cuando expandido, resetear a stretch */
    .sidebar.expanded .sidebar-user {
        align-items: stretch;
    }

    .divider {
        width: 100%;
        height: 1px;
    }

    /* 🔧 TAREA #26-01-20-O: Ocultar divisor cuando sidebar está colapsado */
    .sidebar:not(.expanded) .divider {
        display: none;
    }

    /* User info - Hidden when collapsed, visible when expanded */
    .user-info {
        display: none;
        flex: 1 1 0; /* flex-grow: 1, flex-shrink: 1, flex-basis: 0 */
        flex-direction: column;
        justify-content: center;
        min-width: 0; /* Permite que flexbox pueda reducir el elemento correctamente */
        color: white;
        overflow: hidden; /* Evitar desbordamiento */
    }

    .sidebar.expanded .user-info {
        display: flex;
    }

    .user-name {
        font-family: 'DM Sans', sans-serif; /* ✅ Cambio de IBM Plex Sans → DM Sans según Figma */
        font-weight: 400;
        font-size: 14px;
        line-height: 24px; /* ✅ Cambio de 20px → 24px según Figma */
        letter-spacing: 0.16px;
        margin: 0;
        white-space: nowrap;
        overflow: hidden; /* Ocultar texto que desborda */
        text-overflow: ellipsis; /* Mostrar ... cuando el texto es muy largo */
        max-width: 100%; /* Asegurar que respeta el contenedor padre */
    }

    .user-role {
        font-family: 'DM Sans', sans-serif;
        font-weight: 700;
        font-size: 9px;
        line-height: 16px;
        letter-spacing: 1px;
        text-transform: uppercase;
        margin: 0;
        white-space: nowrap;
        overflow: hidden; /* Ocultar texto que desborda */
        text-overflow: ellipsis; /* Mostrar ... cuando el texto es muy largo */
        max-width: 100%; /* Asegurar que respeta el contenedor padre */
    }

    /* User dropdown arrow - Hidden when collapsed */
    .user-dropdown-arrow {
        display: none;
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .sidebar.expanded .user-dropdown-arrow {
        display: block;
    }

    .user-dropdown-arrow svg {
        display: block;
        width: 100%;
        height: 100%;
    }

    /* Adjust user section layout when expanded */
    .sidebar-user-content {
        display: flex;
        gap: 16px;
        align-items: center;
        width: 100%;
        min-width: 0; /* Permite que los elementos hijos puedan hacer ellipsis correctamente */
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        text-align: left;
        color: inherit;
    }

    .sidebar-user-content:hover {
        opacity: 0.9;
    }

    /* Sidebar expandido */
    .sidebar.expanded ~ .user-submenu {
        left: 296px; /* 🔧 Actualizado para coincidir: 280px sidebar + 16px margen */
    }
}

/* ==================== USER SUBMENU ==================== */

/* Badge de notificación */
.notification-badge {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #24A148;
    border-radius: 50%;
    border: 2px solid #0b0b0b;
    z-index: 10;
}

.notification-badge.show {
    display: block;
}

/* Badge mobile - 8px según Figma */
@media (max-width: 767px) {
    .notification-badge,
    .avatar-container .notification-badge {
        width: 8px !important;
        height: 8px !important;
        border: 2px solid #1F1F1F !important;
    }
}

/* Chevron indicador */
.user-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.user-chevron.rotated {
    transform: rotate(180deg);
}

/* Submenú desplegable */
.user-submenu {
    position: fixed;
    width: 320px !important;
    background-color: #0b0b0b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    overflow: visible;
    z-index: 9999;
    display: block; /* Siempre visible en el DOM */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none; /* No bloquear clicks cuando está oculto */
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.user-submenu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important; /* Permitir clicks cuando está visible */
}

/* Posicionamiento mobile (bottom) */
@media (max-width: 767px) {
    .user-submenu {
        bottom: 72px;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }
    
    .user-submenu.show {
        transform: translateX(-50%) translateY(0) !important;
    }
    
    /* Mobile EXPANDIDO: Menú aparece centrado en pantalla */
    .sidebar.mobile-expanded ~ .user-submenu {
        bottom: auto;
        top: 50%;
        transform: translateX(-50%) translateY(calc(-50% + 10px));
    }
    
    .sidebar.mobile-expanded ~ .user-submenu.show {
        transform: translateX(-50%) translateY(-50%) !important;
    }
}

/* Posicionamiento desktop */
@media (min-width: 768px) {
    .user-submenu {
        bottom: 16px;
        left: 80px;
    }
    
    /* Sidebar expandido */
    .sidebar.expanded ~ .user-submenu {
        left: 296px; /* 🔧 Actualizado para coincidir: 280px sidebar + 16px margen */
    }
}

/* Botones del submenú */
.submenu-button {
    font-family: 'IBM Plex Sans', sans-serif;
}

.user-menu-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 28%),
        #0b0b0b;
}

.user-menu-panel .submenu-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.user-menu-panel .submenu-section:last-child {
    border-bottom: 0 !important;
}

.user-menu-header {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) 20px;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px !important;
    text-align: left;
}

.user-menu-user-copy {
    min-width: 0;
}

.user-menu-user-name {
    margin: 0;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.25;
    letter-spacing: 0.01em;
    color: #ffffff !important;
}

.user-menu-user-meta {
    margin: 2px 0 0;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72) !important;
}

.user-menu-edit-icon {
    color: rgba(255, 255, 255, 0.48) !important;
    transition: color 0.18s ease, transform 0.18s ease;
}

.user-menu-header:hover .user-menu-edit-icon {
    color: #ffffff !important;
    transform: translateX(1px);
}

.user-menu-panel .submenu-section {
    padding: 0 !important;
}

.user-menu-panel .submenu-section-language {
    padding: 14px 16px 16px !important;
}

.user-menu-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 8px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 12px !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72) !important;
}

.user-menu-language-title {
    margin: 0 0 8px !important;
}

.user-menu-select {
    width: 100% !important;
    min-height: 42px;
    padding: 10px 14px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: #ffffff !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 14px !important;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.user-menu-select:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

.user-menu-select:focus {
    border-color: #24a148 !important;
    box-shadow: 0 0 0 1px rgba(36, 161, 72, 0.35) inset;
}

.user-submenu .submenu-button {
    display: grid !important;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center !important;
    column-gap: 12px;
    width: 100% !important;
    min-height: 58px;
    padding: 14px 16px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    text-align: left;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.user-submenu .submenu-button > svg,
.user-submenu .submenu-button > #theme-icon,
.user-submenu .submenu-button > .logout-icon {
    width: 20px;
    min-width: 20px;
    justify-self: center;
}

.user-submenu .submenu-button > div:nth-child(2),
.user-submenu .submenu-button > div:nth-child(3) {
    min-width: 0;
}

.user-menu-row-copy {
    min-width: 0;
}

.user-menu-row-title {
    margin: 0 !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.25;
    color: #ffffff !important;
}

.user-menu-row-meta {
    margin: 2px 0 0 !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 12px !important;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.6) !important;
}

.user-menu-badge {
    min-width: 20px;
    padding: 2px 6px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.45;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.user-submenu .submenu-section.desktop-only > div {
    display: grid !important;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center !important;
    column-gap: 12px;
    min-height: 58px;
    padding: 14px 16px !important;
}

.user-submenu .submenu-section.desktop-only > div > svg {
    width: 20px;
    min-width: 20px;
    justify-self: center;
}

.user-menu-size-group {
    display: inline-flex !important;
    gap: 4px !important;
}

#logout-btn {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    justify-content: flex-start;
}

#logout-btn .logout-label {
    text-align: left;
}

.submenu-button:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.user-menu-panel .submenu-button:hover,
.user-menu-panel .submenu-button:focus-visible,
.user-menu-header:hover,
.user-menu-header:focus-visible {
    box-shadow: inset 3px 0 0 rgba(36, 161, 72, 0.95);
}

.user-menu-panel .submenu-button:focus-visible,
.user-menu-panel .user-menu-header:focus-visible,
.user-menu-panel .size-btn:focus-visible,
.user-menu-panel .canonical-toggle input:focus-visible + .canonical-toggle-track,
.user-menu-panel .user-menu-select:focus-visible {
    outline: none;
}

.user-menu-panel .submenu-button:focus-visible,
.user-menu-panel .user-menu-header:focus-visible,
.user-menu-panel .size-btn:focus-visible {
    background-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow:
        inset 3px 0 0 rgba(36, 161, 72, 0.95),
        0 0 0 1px rgba(36, 161, 72, 0.28);
}

#logout-btn:hover {
    background-color: rgba(218, 30, 40, 0.1);
}

#logout-btn {
    color: #fa4d56 !important;
}

#logout-btn .logout-icon,
#logout-btn .logout-label {
    color: inherit !important;
}

.user-menu-row-destructive {
    color: #fa4d56 !important;
}

.user-menu-row-destructive:hover,
.user-menu-row-destructive:focus-visible {
    background-color: rgba(250, 77, 86, 0.1) !important;
    box-shadow:
        inset 3px 0 0 rgba(250, 77, 86, 0.95),
        0 0 0 1px rgba(250, 77, 86, 0.14);
}

.user-menu-row-destructive .user-menu-row-title,
.user-menu-row-destructive .logout-icon {
    color: inherit !important;
}

html.dark .position-indicator {
    background-color: #fa4d56 !important;
}

html.dark .sidebar-scroll-arrow {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.12);
    color: #f4f4f4;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

html.dark .sidebar-scroll-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Theme-aware user menu controls. */
.user-menu-panel {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}
.user-menu-panel .submenu-section,
.user-menu-panel .user-menu-header {
    border-color: var(--border-secondary) !important;
}
.user-menu-panel .user-menu-label,
.user-menu-panel .user-menu-row-meta,
.user-menu-panel .user-menu-user-meta {
    color: var(--text-secondary) !important;
}
.user-menu-panel .user-menu-row-title,
.user-menu-panel .user-menu-user-name,
.user-menu-panel .submenu-button,
.user-menu-panel .user-menu-header {
    color: var(--text-primary) !important;
}
.user-menu-panel .submenu-button,
.user-menu-panel .user-menu-header {
    background: transparent !important;
}
.user-menu-panel .submenu-button:hover,
.user-menu-panel .submenu-button:focus-visible,
.user-menu-panel .user-menu-header:hover,
.user-menu-panel .user-menu-header:focus-visible {
    background: var(--bg-hover) !important;
    box-shadow: inset 3px 0 0 var(--green-status), 0 0 0 1px color-mix(in srgb, var(--green-status) 28%, transparent) !important;
}
.user-menu-panel .submenu-section-language:hover,
.user-menu-panel .submenu-section-auto-collapse:hover,
.user-menu-panel .submenu-section-sidebar-size:hover {
    background: var(--bg-hover) !important;
}
.user-menu-panel .user-menu-language-field {
    margin: 0 !important;
}
.user-menu-panel .user-menu-language-field .form-field-select {
    width: 100% !important;
}
.user-menu-panel .user-menu-select,
.user-menu-panel .user-menu-language-field .form-field-select {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-secondary) !important;
}

/* En claro, el selector del menú usa exactamente el skin canónico de formularios. */
:root:not(.dark) .user-menu-panel .user-menu-language-field .form-field-select {
    background-color: #ffffff !important;
    color: #0b0b0b !important;
    border-color: #949494 !important;
}
.user-menu-panel .size-btn {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-secondary) !important;
}
.user-menu-panel .size-btn.active {
    background: var(--green-status) !important;
    border-color: var(--green-status) !important;
    color: var(--success-foreground) !important;
}
.user-menu-panel #theme-icon,
.user-menu-panel #theme-icon svg,
.user-menu-panel .logout-icon,
.user-menu-panel .submenu-button > svg {
    color: var(--text-secondary) !important;
}
.user-menu-panel svg [fill="white"] { fill: currentColor !important; }
.user-menu-panel svg [stroke="white"] { stroke: currentColor !important; }
.user-menu-panel #logout-btn,
.user-menu-panel #logout-btn .logout-label,
.user-menu-panel #logout-btn .logout-icon {
    color: var(--red-status) !important;
}

.shortcuts-modal-open {
    overflow: hidden;
}

.shortcuts-modal {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.shortcuts-modal[hidden] {
    display: none !important;
}

.shortcuts-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(2px);
}

.shortcuts-modal-panel {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    border-radius: 2px;
    border: 1px solid var(--card-border);
    background: var(--card-background);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.shortcuts-modal.show .shortcuts-modal-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.shortcuts-modal-body {
    max-height: min(60vh, 520px);
    overflow-y: auto;
}

.shortcuts-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 30px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.shortcuts-modal-header h2 {
    margin: 0 0 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.shortcuts-modal-header p {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
}

.shortcuts-modal-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-primary);
    border-radius: 2px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.shortcuts-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.shortcuts-list {
    display: grid;
    gap: 16px;
    padding: 20px 30px;
}

.shortcut-group {
    display: grid;
    gap: 10px;
}

.shortcut-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.shortcut-group-header h3 {
    margin: 0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.shortcut-group-header p {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
}

.shortcut-group-list {
    display: grid;
    gap: 10px;
}

.shortcut-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    width: 100%;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.shortcut-card:hover {
    border-color: var(--green-primary);
    background: var(--bg-hover);
}

.shortcut-card:focus-visible {
    outline: 2px solid var(--green-primary);
    outline-offset: 2px;
}

.shortcut-card.is-armed {
    border-color: var(--green-primary);
    background: color-mix(in srgb, var(--green-light) 62%, var(--card-background) 38%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--green-primary) 32%, transparent);
}

.shortcut-card.is-success {
    border-color: var(--green-primary);
    background: color-mix(in srgb, var(--green-light) 78%, var(--card-background) 22%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--green-primary) 36%, transparent), 0 0 18px color-mix(in srgb, var(--green-primary) 22%, transparent);
    animation: shortcut-card-celebrate 0.55s ease;
}

.shortcut-card.is-error {
    border-color: var(--red-status);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--red-status) 36%, transparent);
    animation: shortcut-card-shake 0.34s ease;
}

.shortcut-card-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    background: var(--green-light);
    color: var(--green-primary);
}

.shortcut-card-copy h3 {
    margin: 0 0 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.shortcut-card-copy p {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.shortcut-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 2px;
    border: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.22s ease;
}

.shortcut-card.is-armed .shortcut-kbd,
.shortcut-card.is-success .shortcut-kbd {
    border-color: var(--green-primary);
    background: color-mix(in srgb, var(--green-light) 65%, var(--card-background) 35%);
    color: var(--green-primary);
}

.shortcut-card.is-error .shortcut-kbd {
    border-color: var(--red-status);
    color: var(--red-status);
}

@keyframes shortcut-card-shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(4px);
    }

    75% {
        transform: translateX(-2px);
    }
}

@keyframes shortcut-card-celebrate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.015);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 767px) {
    .shortcuts-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .shortcuts-modal-panel {
        width: min(100%, 420px);
        border-radius: 2px;
    }

    .shortcuts-modal-body {
        max-height: min(72vh, 560px);
    }

    .shortcut-card {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .shortcut-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .shortcut-kbd {
        grid-column: 1 / -1;
        justify-self: flex-start;
        min-width: 0;
    }

    .shortcuts-modal-header,
    .shortcuts-list {
        padding-left: 18px;
        padding-right: 18px;
    }

    .shortcuts-list {
        padding-top: 18px;
        padding-bottom: 18px;
    }
}

/* Desktop only */
@media (min-width: 768px) {
    .desktop-only {
        display: block !important;
    }
}

/* Select personalizado */
select {
    outline: none;
}

select:focus {
    border-color: #D32D22;
}

option {
/*    background-color: #0b0b0b;
    color: white;*/
    font-family: "Atkinson Hyperlegible", "Atkinson Hyperlegible Next", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.user-menu-select option {
    background-color: #0b0b0b;
    color: White;
    font-family: "Atkinson Hyperlegible", "Atkinson Hyperlegible Next", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ==================== PANEL DE NOTIFICACIONES ==================== */

/* Overlay para cerrar el panel */
.notifications-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.notifications-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Panel de notificaciones */
.notifications-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background-color: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notifications-panel.active {
    right: 0;
}

/* Header del panel */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 14px;
    border-bottom: 1px solid #e3e6e8;
    background-color: white;
    flex-shrink: 0;
}

.notifications-header h2 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #0b0b0b;
    margin: 0;
}

.close-notifications-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #595d62;
    transition: background-color 0.2s, color 0.2s;
}

.close-notifications-btn:hover {
    background-color: #f4f4f4;
    color: #0b0b0b;
}

/* Acciones rápidas */
.notifications-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 10px 16px;
    border-bottom: 1px solid #e3e6e8;
    background-color: #ffffff;
    flex-shrink: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 36px;
    padding: 7px 8px;
    background: #ffffff;
    border: 1px solid #d9dde1;
    border-radius: 2px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    color: #0b0b0b;
    cursor: pointer;
    white-space: normal;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.action-btn:hover {
    background-color: #f4f4f4;
    border-color: #077e38;
    box-shadow: 0 0 0 1px rgba(7, 126, 56, 0.14);
}

.action-btn.destructive {
    color: #d32d22;
    border-color: rgba(211, 45, 34, 0.28);
}

.action-btn.destructive:hover {
    background-color: rgba(211, 45, 34, 0.05);
    border-color: #d32d22;
}

.action-btn svg {
    flex-shrink: 0;
}

/* Lista de notificaciones */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Item de notificación */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #e3e6e8;
    transition: background-color 0.2s;
    cursor: pointer;
    position: relative;
}

.notification-item:hover {
    background-color: #f9f9f9;
}

.notification-item.unread {
    background-color: #f0f8f4;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #077e38;
}

/* Icono de la notificación */
.notification-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #e3e6e8;
}

.notification-icon.success {
    background-color: rgba(7, 126, 56, 0.1);
    color: #077e38;
}

.notification-icon.info {
    background-color: rgba(0, 120, 212, 0.1);
    color: #0078d4;
}

.notification-icon.warning {
    background-color: rgba(255, 180, 0, 0.1);
    color: #ffb400;
}

/* Contenido de la notificación */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0b0b0b;
    margin: 0 0 3px 0;
    line-height: 1.4;
}

.notification-description {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #595d62;
    margin: 0 0 5px 0;
    line-height: 1.45;
}

.notification-time {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #919ba1;
    margin: 0;
}

.notification-footer {
    margin: 8px 0 6px;
}

.notification-context-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(7, 126, 56, 0.24);
    border-radius: 999px;
    background-color: rgba(7, 126, 56, 0.06);
    color: #077e38;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.notification-context-action:hover {
    background-color: rgba(7, 126, 56, 0.12);
    border-color: rgba(7, 126, 56, 0.42);
    box-shadow: 0 0 0 1px rgba(7, 126, 56, 0.14);
}

.notification-context-action:focus-visible {
    outline: none;
    background-color: rgba(7, 126, 56, 0.12);
    border-color: rgba(7, 126, 56, 0.46);
    box-shadow: 0 0 0 2px rgba(7, 126, 56, 0.18);
}

/* Botón de descartar notificación */
.notification-toggle-read {
    width: 100%;
    border: 1px solid #d0d0d0;
    border-radius: 999px;
    background-color: #ffffff;
    color: #595d62;
    cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    min-height: 28px;
    padding: 6px 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.notification-actions-rail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 72px;
    margin-left: auto;
}

.notification-toggle-read:hover {
    background-color: #f4f4f4;
    border-color: #919ba1;
}

.notification-item.unread .notification-toggle-read {
    background-color: rgba(7, 126, 56, 0.08);
    border-color: rgba(7, 126, 56, 0.25);
    color: #077e38;
}

html.dark .notification-toggle-read {
    background-color: #242424;
    border-color: #4a4a4a;
    color: #c6c6c6;
}

html.dark .notification-toggle-read:hover {
    background-color: #2a2a2a;
    border-color: #6f6f6f;
}

html.dark .notification-item.unread .notification-toggle-read {
    background-color: rgba(7, 126, 56, 0.18);
    border-color: rgba(36, 161, 72, 0.35);
    color: #6edb8e;
}

.notification-dismiss {
    position: static;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #919ba1;
    transition: all 0.2s;
}

.notification-dismiss:hover {
    background-color: rgba(211, 45, 34, 0.1);
    color: #d32d22;
}

html.dark .notifications-panel {
    background-color: #161616;
    box-shadow: -6px 0 18px rgba(0, 0, 0, 0.34);
}

html.dark .notifications-header,
html.dark .notifications-actions {
    background-color: #161616;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark .notifications-header h2 {
    color: #f4f4f4;
}

html.dark .close-notifications-btn {
    color: #c6c6c6;
}

html.dark .close-notifications-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #f4f4f4;
}

html.dark .action-btn {
    background: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f4f4f4;
}

html.dark .action-btn:hover {
    background-color: #262626;
    border-color: #24a148;
    box-shadow: 0 0 0 1px rgba(36, 161, 72, 0.16);
}

html.dark .action-btn.destructive {
    color: #ff8389;
    border-color: rgba(255, 131, 137, 0.28);
}

html.dark .action-btn.destructive:hover {
    background-color: rgba(211, 45, 34, 0.14);
    border-color: #ff8389;
}

html.dark .notification-item {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark .notification-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

html.dark .notification-item.unread {
    background-color: rgba(7, 126, 56, 0.12);
}

html.dark .notification-title {
    color: #f4f4f4;
}

html.dark .notification-description {
    color: #c6c6c6;
}

html.dark .notification-time,
html.dark .notification-dismiss {
    color: #8d8d8d;
}

html.dark .notification-context-action {
    background-color: rgba(36, 161, 72, 0.12);
    border-color: rgba(111, 220, 140, 0.26);
    color: #6fdd8d;
}

html.dark .notification-context-action:hover {
    background-color: rgba(36, 161, 72, 0.18);
    border-color: rgba(111, 220, 140, 0.46);
    box-shadow: 0 0 0 1px rgba(111, 220, 140, 0.14);
}

/* Estado vacío */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #919ba1;
}

.empty-state svg {
    margin-bottom: 16px;
    color: #e3e6e8;
}

.empty-state p {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #595d62;
    margin: 0 0 8px 0;
}

.empty-state span {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #919ba1;
}

/* Botón de restaurar notificaciones */
.restore-notifications-btn {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #077e38;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.restore-notifications-btn:hover {
    background: #066b30;
}

.restore-notifications-btn svg {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .notifications-panel {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }

    .notifications-header {
        padding: 16px 14px 12px;
    }

    .notifications-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        padding: 10px 14px;
    }

    .action-btn {
        min-height: 34px;
        padding: 6px 6px;
        font-size: 10px;
        gap: 4px;
    }

    .action-btn svg {
        width: 14px;
        height: 14px;
    }

    .notification-item {
        padding: 14px;
        gap: 9px;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
    }

    .notification-actions-rail {
        flex-basis: 64px;
        gap: 5px;
    }

    .notification-toggle-read {
        font-size: 10px;
        padding: 6px 8px;
    }

    .notification-context-action {
        min-height: 28px;
        padding: 5px 9px;
        font-size: 11px;
    }
}

/* ==================== PANEL DE DESARROLLO ==================== */

#omega-dev-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 2px solid #077e38;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 220px;
    font-family: 'Roboto', sans-serif;
}

.dev-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #077e38;
    color: white;
    border-radius: 6px 6px 0 0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
}

.dev-panel-header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background-color 0.2s;
}

.dev-panel-header button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dev-panel-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.dev-panel-content button {
    padding: 8px 12px;
    background: #f4f4f4;
    border: 1px solid #e3e6e8;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #0b0b0b;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.dev-panel-content button:hover {
    background: #077e38;
    color: white;
    border-color: #077e38;
}

@media (max-width: 768px) {
    #omega-dev-panel {
        bottom: 10px;
        right: 10px;
        min-width: 180px;
    }
}

