/* Tablas con esquinas redondeadas */
.table-rounded {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.table-rounded th:first-child {
    border-top-left-radius: 16px;
}
.table-rounded th:last-child {
    border-top-right-radius: 16px;
}
.table-rounded tr:last-child td:first-child {
    border-bottom-left-radius: 16px;
}
.table-rounded tr:last-child td:last-child {
    border-bottom-right-radius: 16px;
}
:root {
    /* MENTE MAESTRA BRANDING */

    --theme-bg: #F5F7FB;
    --theme-card-bg-light: #111418;
    --theme-card-hover: #1B1F22;
    --theme-sidebar: #000000;
    --theme-sidebar-hover: #162033;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-active-border: #0A66FF;
    --theme-accent-bg: #1E90FF;
    --theme-accent-border: #1667B8;
    --theme-accent-text: #FFFFFF;
    --theme-primary: #0A66FF;
    --theme-primary-hover: #0952CC;
    --theme-primary-bg-soft: rgba(10, 102, 255, 0.08);
    --theme-primary-border-soft: rgba(10, 102, 255, 0.18);
    --theme-accent-bg-soft: rgba(30, 144, 255, 0.08);
    --theme-accent-border-soft: rgba(30, 144, 255, 0.18);
    --theme-danger-bg: rgba(180, 35, 24, 0.08);
    --theme-danger-border: rgba(180, 35, 24, 0.2);
    --theme-focus: #0A66FF;
    --theme-dollar-green: #0A66FF;
    --theme-error: #b42318;
    --theme-border: #E5E7EB;
    --theme-secondary-text: #94A3B8;
    --theme-card-text: #E2E8F0;
    --theme-dollar-orange: #F5A623;
    --theme-dollar-gray: #64748B;
    --theme-dollar-black: #1E293B;
    --theme-dollar-white: #FFFFFF;
}

body[data-theme="warm-vibrant"] {
    /* Paleta personalizada: azul brillante */
    --theme-bg: #F8F9FA;
    --theme-card-bg-light: #111418;
    --theme-card-hover: #1B1F22;
    --theme-sidebar: #000000;
    --theme-sidebar-hover: #162033;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-active-border: #0A66FF;
    --theme-accent-bg: #1E90FF;
    --theme-accent-border: #1667B8;
    --theme-accent-text: #FFFFFF;
    --theme-primary: #0A66FF;
    --theme-primary-hover: #0952CC;
    --theme-primary-bg-soft: rgba(10, 102, 255, 0.08);
    --theme-primary-border-soft: rgba(10, 102, 255, 0.18);
    --theme-accent-bg-soft: rgba(30, 144, 255, 0.08);
    --theme-accent-border-soft: rgba(30, 144, 255, 0.18);
    --theme-danger-bg: rgba(180, 35, 24, 0.08);
    --theme-danger-border: rgba(180, 35, 24, 0.2);
    --theme-focus: #0A66FF;
    --theme-dollar-green: #0A66FF;
    --theme-dollar-orange: #F5A623;
    --theme-dollar-gray: #6C757D;
    --theme-dollar-black: #212529;
    --theme-dollar-white: #FFFFFF;
}

body[data-theme="warm-soft"] {
    /* Paleta personalizada: azul suave */
    --theme-bg: #F5F7FB;
    --theme-card-bg-light: #111418;
    --theme-card-hover: #1B1F22;
    --theme-sidebar: #000000;
    --theme-sidebar-hover: #162033;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-active-border: #0A66FF;
    --theme-accent-bg: #1E90FF;
    --theme-accent-border: #1667B8;
    --theme-accent-text: #FFFFFF;
    --theme-primary: #0A66FF;
    --theme-primary-hover: #0952CC;
    --theme-primary-bg-soft: rgba(10, 102, 255, 0.08);
    --theme-primary-border-soft: rgba(10, 102, 255, 0.18);
    --theme-accent-bg-soft: rgba(30, 144, 255, 0.08);
    --theme-accent-border-soft: rgba(30, 144, 255, 0.18);
    --theme-danger-bg: rgba(180, 35, 24, 0.08);
    --theme-danger-border: rgba(180, 35, 24, 0.2);
    --theme-focus: #0A66FF;
    --theme-dollar-green: #0A66FF;
    --theme-dollar-orange: #F5A623;
    --theme-dollar-gray: #64748B;
    --theme-dollar-black: #1E293B;
    --theme-dollar-white: #FFFFFF;
}

body[data-theme="dark"] {
    /* Paleta personalizada modo oscuro: azul */
    --theme-bg: #0B0F14;
    --theme-card-bg-light: #111418;
    --theme-card-hover: #1B1F22;
    --theme-sidebar: #000000;
    --theme-sidebar-hover: #162033;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-active-border: #0A66FF;
    --theme-accent-bg: #1E90FF;
    --theme-accent-border: #1667B8;
    --theme-accent-text: #FFFFFF;
    --theme-primary: #0A66FF;
    --theme-primary-hover: #0952CC;
    --theme-primary-bg-soft: rgba(10, 102, 255, 0.08);
    --theme-primary-border-soft: rgba(10, 102, 255, 0.18);
    --theme-accent-bg-soft: rgba(30, 144, 255, 0.08);
    --theme-accent-border-soft: rgba(30, 144, 255, 0.18);
    --theme-danger-bg: rgba(180, 35, 24, 0.08);
    --theme-danger-border: rgba(180, 35, 24, 0.2);
    --theme-focus: #0A66FF;
}

body{
    background:var(--theme-bg);
}


.sidebar{
    height:100vh;
    background: var(--theme-sidebar);
    color:white;
    position:fixed;
    width:210px;
}

.main {
    margin-left: 210px;
    transition: margin-left 0.2s;
}

.main--public {
    margin-left: 0 !important;
}

.sidebar-head {
    display: block;
}

.sidebar-nav {
    display: block;
}

.sidebar-toggle {
    display: none;
    border: none;
    background: transparent;
    color: var(--theme-sidebar-text);
    font-size: 26px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 8px;
}

.sidebar-toggle:hover {
    background: var(--theme-sidebar-hover);
    color: white;
    cursor: pointer;
}

.sidebar a{
    color:var(--theme-sidebar-text);
    text-decoration:none;
    display:block;
    padding:12px 20px;
}

.sidebar a:hover{
    background:var(--theme-sidebar-hover);
    color:white;
}

.sidebar a.active{
    background:var(--theme-sidebar-hover);
    color:white;
    border-left:4px solid var(--theme-sidebar-active-border);
}

.sidebar-link {
    display: block;
    padding: 12px 20px;
    color:var(--theme-sidebar-text);
    text-decoration: none;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
}

.sidebar button:hover {
    background-color: var(--theme-sidebar-hover);
    color: var(--theme-sidebar-text);
    cursor: pointer;
}

.sidebar-link.sidebar-link--disabled {
    opacity: 0.65;
    cursor: default;
}

.sidebar-link.sidebar-link--disabled:hover {
    background: none;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: bold;
    padding: 20px;
    color: white;
}

.logo-icon {
    font-size: 32px;
    color: var(--theme-dollar-orange);
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(253, 186, 116, 0.4),
        -1px -1px 2px rgba(255, 255, 255, 0.2),
        1px 1px 2px rgba(0, 0, 0, 0.4);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
    max-height: 96px;
    width: auto;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

.main{
    margin-left:210px;
}

.topbar{
    background:var(--theme-card-bg-light);
    border-bottom:1px solid var(--theme-border, #e5e7eb);
    padding:10px 25px;
    align-items: flex-start;
    flex-wrap: wrap;
    row-gap: 6px;
}

.topbar-greeting-block {
    flex: 1 1 540px;
    min-width: 320px;
}

.topbar-greeting-block span {
    color: var(--theme-secondary-text, #CBD5E1);
}

.topbar-user-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
    align-self: flex-start;
    flex: 0 0 auto;
    color: var(--theme-secondary-text, #CBD5E1);
}

.topbar-support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--theme-accent-border, rgba(30,144,255,0.18));
    background: var(--theme-card-bg-light, #111418);
    color: var(--theme-secondary-text, #CBD5E1);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.topbar-support-link:hover {
    background: var(--theme-card-hover, #1B1F22);
    border-color: var(--theme-primary, #0A66FF);
    color: var(--theme-card-text, #f8fafc);
    text-decoration: none;
}

.topbar-support-link:focus,
.topbar-support-link:focus-visible {
    outline: 2px solid var(--theme-primary, #0A66FF);
    outline-offset: 2px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle-icon {
    font-size: 14px;
    line-height: 1;
    color: var(--theme-accent-text);
    opacity: 0.45;
    user-select: none;
    transform: scale(0.95);
    transition: opacity .2s ease, transform .2s ease, filter .2s ease;
}

.theme-toggle.theme-is-soft .theme-toggle-icon--sun,
.theme-toggle.theme-is-vibrant .theme-toggle-icon--moon {
    opacity: 1;
    transform: scale(1.08);
    filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--theme-focus) 30%, transparent));
}

.theme-toggle.theme-is-soft .theme-toggle-slider {
    background: #E7FBF7;
    border-color: #14C8A8;
}

.theme-toggle.theme-is-vibrant .theme-toggle-slider {
    background: #000000;
    border-color: #000000;
}

.theme-toggle.theme-is-soft .theme-toggle-icon--sun {
    color: #FFD43B;
}

.theme-toggle.theme-is-vibrant .theme-toggle-icon--moon {
    color: #1B5E20;
}

.theme-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 42px;
    height: 24px;
    margin: 0;
    cursor: pointer;
}

.theme-toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-accent-border) 70%, #fff 30%);
    border: 1px solid var(--theme-accent-border);
    transition: all .2s ease;
}

.theme-toggle-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s ease;
}

.theme-toggle-switch input:checked + .theme-toggle-slider {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
}

.theme-toggle-switch input:checked + .theme-toggle-slider::before {
    transform: translateX(18px);
}

.theme-toggle-switch input:focus-visible + .theme-toggle-slider {
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--theme-focus) 24%, transparent);
}

.card{
    border:none;
    border-radius:16px;
    box-shadow:0 8px 24px rgba(15, 23, 42, 0.06);
}

.app-messages {
    margin-bottom: 16px;
}

.app-message {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    margin-bottom: 10px;
}

.app-message--success {
    background: #E7FBF7;
    border-color: #14C8A8;
    color: #0F766E;
}

.app-message--error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #b42318;
}

.app-message--warning {
    background: #fff8eb;
    border-color: #fde68a;
    color: #92400e;
}

.app-message--info {
    background: var(--theme-accent-bg);
    border-color: var(--theme-accent-border);
    color: var(--theme-accent-text);
}

.metric{
    font-size:28px;
    font-weight:bold;
}

.sidebar-group {
    margin: 18px 0 0 0;
    padding: 0 0 0 0;
}
.sidebar-group-title {
    font-size: 0.98em;
    font-weight: 600;
    color: var(--theme-primary, #F5A623);
    padding: 8px 20px 4px 20px;
    letter-spacing: 0.5px;
    opacity: 0.85;
    /* Ajuste para alinear con las opciones principales */
    margin-left: 0;
}
.sidebar-sub {
    padding-left: 40px !important;
    font-size: 0.97em;
    color: var(--theme-sidebar-text);
    opacity: 0.92;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.sidebar-sub.active {
    background: var(--theme-sidebar-hover);
    border-left: 3px solid var(--theme-sidebar-active-border);
    color: #fff;
    opacity: 1;
}
.sidebar a.active {
    background: var(--theme-sidebar-hover);
    border-left: 3px solid var(--theme-sidebar-active-border);
    color: #fff;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 190px;
    }

    .main {
        margin-left: 190px;
    }

    .topbar {
        padding: 10px 18px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        display: block;
        padding: 0 10px 10px 10px;
    }

    .sidebar-head {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .logo {
        width: auto;
        padding: 14px 8px 10px 8px;
        font-size: 20px;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 4px;
    }

    .sidebar-nav {
        display: none;
        width: 100%;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
    }

    .sidebar.is-open .sidebar-nav {
        display: flex;
    }

    .sidebar a,
    .sidebar-link {
        display: inline-block;
        width: auto;
        padding: 8px 10px;
        border-radius: 8px;
    }

    .sidebar a.active {
        border-left: none;
        border-bottom: 2px solid var(--theme-sidebar-active-border);
    }

    .sidebar hr {
        width: 100%;
        margin: 8px 0;
        opacity: 0.25;
    }

    .sidebar form {
        width: auto;
        margin-left: auto;
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        padding: 10px 14px;
        align-items: flex-start;
        row-gap: 8px;
    }

    .topbar-greeting-block {
        min-width: 0;
        flex-basis: 100%;
        order: 2;
    }

    .topbar-user-controls {
        margin-left: 0;
        margin-top: 0;
        width: 100%;
        justify-content: flex-end;
        order: 1;
    }

    .topbar-support-link {
        padding: 6px 9px;
        font-size: 12px;
    }
}

/* Tooltip Bootstrap personalizado */
.custom-tooltip.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before,
.custom-tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.custom-tooltip .tooltip-inner {
    border-radius: 12px !important;
    white-space: pre-line !important;
    max-width: 220px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.3;
    padding: 10px 16px;
}

.sidebar-menu-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    object-fit: contain;
    vertical-align: middle;
    opacity: 0.95;
}

.sidebar a {
    display: flex;
    align-items: center;
}

.feature-icon svg {
    width: 48px;
    height: 48px;
    stroke: #1E90FF;
    stroke-width: 2;
}

# Para el carrusel de productos en la barra lateral

.sidebar-products h4 {
    display: inline-block;
    margin: 0 auto 10px;
}

.sidebar-products {
    text-align: center;
    padding: 15px 10px;
    margin-top: 50px;
}

.sidebar-carousel {
    max-width: 140px;
    margin: 0 auto;
}

.sidebar-product-card {
    display: none;
    text-align: center;
}

.sidebar-product-card.active {
    display: block;
}

.product-thumbnail {
    width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-product-title {
    margin-top: 8px;
    font-size: 12px;
}

.sidebar-product-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 6px 12px;
    text-align: center;    
    margin-top: 8px;
    padding: 6px 12px;
    background: #2343f5;
    color: white;
    border-radius: 5px;
    text-align: center;
}