﻿/* ========================================================= */
/* TIENDAROPA - DASHBOARD ADMINISTRATIVO */
/* ========================================================= */


/* ========================================================= */
/* Tokens centralizados del panel administrativo. */
:root,
body[data-theme="dark"] {
    --admin-bg: #030914;
    --admin-surface: #071728;
    --admin-surface-elevated: #0a1b30;
    --admin-sidebar: #061222;
    --admin-text: #f8fafc;
    --admin-text-muted: #7f91a8;
    --admin-border: rgba(255, 255, 255, .08);
    --admin-input-bg: rgba(255, 255, 255, .045);
    --admin-input-text: #edf5ff;
    --admin-table-header: rgba(255, 255, 255, .018);
    --admin-hover: rgba(255, 255, 255, .035);
    --admin-option-bg: #0a1a2e;
    color-scheme: dark;
}

body[data-theme="light"] {
    --admin-bg: #edf3fa;
    --admin-surface: #ffffff;
    --admin-surface-elevated: #f5f9fd;
    --admin-sidebar: #f7fbff;
    --admin-text: #18324a;
    --admin-text-muted: #607891;
    --admin-border: rgba(24, 58, 93, .14);
    --admin-input-bg: #ffffff;
    --admin-input-text: #18324a;
    --admin-table-header: #eef4f9;
    --admin-hover: #f3f8fc;
    --admin-option-bg: #ffffff;
    color-scheme: light;
}

/* CONTENEDOR PRINCIPAL */
/* ========================================================= */

body.dashboard-body {
    min-height: 100vh;
    margin-bottom: 0;
    background: var(--admin-bg);
}

.dashboard-shell {
    min-height: 100vh;
    background: radial-gradient( circle at 55% 5%, rgba(0, 110, 255, 0.16), transparent 32% ), radial-gradient( circle at 85% 35%, rgba(125, 55, 255, 0.10), transparent 30% ), radial-gradient( circle at 20% 80%, rgba(0, 220, 180, 0.05), transparent 28% ), #030914;
    color: #f8fafc;
    display: flex;
    position: relative;
    overflow-x: hidden;
}


/* ========================================================= */
/* FONDO ANIMADO */
/* ========================================================= */

#dashboardParticles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: .75;
}


/* ========================================================= */
/* SIDEBAR */
/* ========================================================= */

.dashboard-sidebar {
    width: 270px;
    min-width: 270px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0 18px;
    background: linear-gradient( 180deg, rgba(6, 18, 34, .98), rgba(3, 10, 21, .98) );
    border-right: 1px solid rgba(255,255,255,.08);
    box-sizing: border-box;
    overflow-y: auto;
}


/* ========================================================= */
/* LOGO */
/* ========================================================= */

.dashboard-logo {
    height: 94px;
    min-height: 94px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 8px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 15px;
}


.logo-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #25a8ff;
    background: rgba(0,130,255,.10);
    border: 1px solid rgba(0,150,255,.14);
    box-shadow: 0 0 25px rgba(0,130,255,.18);
    font-size: 23px;
}


.logo-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.5px;
    white-space: nowrap;
}


    .logo-title span {
        color: #229cff;
    }


.dashboard-logo small {
    display: block;
    color: #718096;
    font-size: 10px;
    margin-top: 3px;
    letter-spacing: .2px;
}


/* ========================================================= */
/* TÍTULOS DEL SIDEBAR */
/* ========================================================= */

.sidebar-title {
    color: #60728b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 24px 11px 9px;
}


/* ========================================================= */
/* SECCIONES DEL SIDEBAR */
/* ========================================================= */

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


/* ========================================================= */
/* LINKS DEL SIDEBAR */
/* ========================================================= */

.sidebar-link {
    min-height: 47px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 15px;
    border-radius: 10px;
    color: #aebdd0;
    text-decoration: none;
    font-size: 14px;
    transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}


    /* ========================================================= */
    /* ICONO PRINCIPAL */
    /* ========================================================= */

    .sidebar-link > i:first-child {
        width: 20px;
        min-width: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 400;
        color: #8fa1b7;
        transition: color .2s ease, transform .2s ease;
    }


    /* ========================================================= */
    /* HOVER */
    /* ========================================================= */

    .sidebar-link:hover {
        color: #ffffff;
        background: rgba(255,255,255,.055);
        transform: translateX(2px);
    }

        .sidebar-link:hover > i:first-child {
            color: #35a5ff;
            transform: translateX(1px);
        }


    /* ========================================================= */
    /* ACTIVO */
    /* ========================================================= */

    .sidebar-link.active {
        color: #ffffff;
        background: linear-gradient( 90deg, rgba(0,120,255,.26), rgba(0,120,255,.08) );
        border: 1px solid rgba(0,140,255,.13);
        border-left: 3px solid #008cff;
        box-shadow: inset 0 0 25px rgba(0,110,255,.08), 0 5px 20px rgba(0,0,0,.12);
    }


        .sidebar-link.active > i:first-child {
            color: #25a8ff;
        }


    /* ========================================================= */
    /* FLECHA DERECHA */
    /* ========================================================= */

    .sidebar-link .ms-auto {
        width: auto;
        min-width: auto;
        color: #506176;
        font-size: 11px;
        transition: color .2s ease, transform .2s ease;
    }


    .sidebar-link:hover .ms-auto {
        color: #8da0b8;
        transform: translateX(2px);
    }


.sidebar-link.active .ms-auto {
    color: #25a8ff;
}

.sidebar-link-placeholder {
    cursor: default;
    opacity: .7;
}

    .sidebar-link-placeholder:hover {
        color: #aebdd0;
        background: transparent;
        transform: none;
    }

        .sidebar-link-placeholder:hover > i:first-child {
            color: #8fa1b7;
            transform: none;
        }

/* ========================================================= */
/* PARTE INFERIOR */
/* ========================================================= */

.sidebar-bottom {
    margin-top: auto;
    padding: 20px 0 16px;
}

.dashboard-shell.sidebar-is-collapsed .dashboard-sidebar {
    width: 84px;
    min-width: 84px;
    padding: 0 12px;
}

.dashboard-shell.sidebar-is-collapsed .dashboard-content {
    margin-left: 84px;
    width: calc(100% - 84px);
}

.dashboard-shell.sidebar-is-collapsed .dashboard-logo {
    justify-content: center;
    padding: 0;
}

.dashboard-shell.sidebar-is-collapsed .dashboard-logo > div:last-child,
.dashboard-shell.sidebar-is-collapsed .sidebar-title,
.dashboard-shell.sidebar-is-collapsed .sidebar-link > span,
.dashboard-shell.sidebar-is-collapsed .sidebar-link .ms-auto,
.dashboard-shell.sidebar-is-collapsed .collapse-sidebar span {
    display: none;
}

.dashboard-shell.sidebar-is-collapsed .sidebar-link,
.dashboard-shell.sidebar-is-collapsed .collapse-sidebar {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.dashboard-shell.sidebar-is-collapsed .sidebar-link.active {
    border-left-width: 1px;
}


.collapse-sidebar {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    color: #8fa1b7;
    cursor: pointer;
    font-size: 13px;
    transition: .2s ease;
}


    .collapse-sidebar:hover {
        color: #ffffff;
        background: rgba(255,255,255,.06);
        border-color: rgba(255,255,255,.12);
    }


    .collapse-sidebar i {
        font-size: 15px;
    }


/* ========================================================= */
/* CONTENIDO */
/* ========================================================= */

.dashboard-content {
    margin-left: 270px;
    width: calc(100% - 270px);
    min-height: 100vh;
    position: relative;
    z-index: 5;
}


/* ========================================================= */
/* TOPBAR */
/* ========================================================= */

.dashboard-topbar {
    height: 82px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    background: rgba(4,14,28,.82);
    border-bottom: 1px solid rgba(255,255,255,.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 50;
}


/* ========================================================= */
/* BOTÓN MOBILE */
/* ========================================================= */

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    margin-right: 11px;
    border-radius: 9px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    color: #ffffff;
    cursor: pointer;
}


/* ========================================================= */
/* BUSCADOR */
/* ========================================================= */

.dashboard-search {
    width: 470px;
    max-width: 100%;
    height: 45px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 15px;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.09);
    color: #71839a;
    position: relative;
    transition: .2s ease;
}


    .dashboard-search:focus-within {
        border-color: rgba(0,140,255,.35);
        box-shadow: 0 0 0 3px rgba(0,140,255,.06);
    }


    .dashboard-search i {
        font-size: 16px;
    }


    .dashboard-search input {
        width: 100%;
        background: transparent;
        border: none;
        outline: none;
        color: #ffffff;
        font-size: 13px;
    }


        .dashboard-search input::placeholder {
            color: #71839a;
        }


    .dashboard-search span {
        white-space: nowrap;
        color: #60728b;
        font-size: 11px;
    }

.global-search-results {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    left: 0;
    z-index: 120;
    overflow: hidden;
    padding: 7px;
    background: rgba(6, 19, 35, .98);
    border: 1px solid rgba(104, 180, 255, .2);
    border-radius: 12px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .34);
    backdrop-filter: blur(16px);
}

.global-search-results[hidden] {
    display: none !important;
}

.global-search-results a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: #c2d3e6;
    border-radius: 8px;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.global-search-results a:hover,
.global-search-results a:focus {
    color: #ffffff;
    background: rgba(30, 142, 255, .13);
    outline: none;
}

.global-search-results a > i {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    color: #67b8ff;
    background: rgba(20, 138, 255, .12);
    border-radius: 8px;
    font-size: .85rem;
}

.global-search-results a > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: inherit;
    font-size: .78rem;
    white-space: normal;
}

.global-search-results strong {
    color: inherit;
    font-size: .8rem;
}

.global-search-results small {
    margin-top: 2px;
    color: #788ba2;
    font-size: .69rem;
}


/* ========================================================= */
/* ACCIONES TOPBAR */
/* ========================================================= */

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}


.topbar-button {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    color: #8fa1b7;
    cursor: pointer;
    transition: .2s ease;
}

.topbar-button:focus-visible,
.topbar-profile:focus-visible {
    outline: 0;
    border-color: rgba(57, 159, 255, .72);
    box-shadow: 0 0 0 3px rgba(30, 143, 255, .15);
}


    .topbar-button:hover {
        color: #ffffff;
        background: rgba(255,255,255,.07);
        border-color: rgba(255,255,255,.12);
    }


/* ========================================================= */
/* NOTIFICACIONES */
/* ========================================================= */

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: #1677ff;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    border: 2px solid #061120;
}


/* ========================================================= */
/* PERFIL */
/* ========================================================= */

.topbar-profile {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
    margin-left: 4px;
    border-left: 1px solid rgba(255,255,255,.08);
    color: #ffffff;
}

button.topbar-profile {
    border: 0;
    background: transparent;
    text-align: left;
}

.topbar-profile:hover .profile-info strong,
.topbar-profile:hover > i {
    color: #ffffff;
}


.profile-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient( 135deg, #087cff, #743dff );
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(50,90,255,.18);
}


.profile-info {
    display: flex;
    flex-direction: column;
    min-width: 100px;
}


    .profile-info strong {
        color: #ffffff;
        font-size: 12px;
    }


    .profile-info small {
        color: #71839a;
        font-size: 10px;
        margin-top: 2px;
    }


.topbar-profile > i {
    color: #71839a;
    font-size: 11px;
}

.topbar-dropdown {
    width: min(330px, calc(100vw - 28px));
    padding: 7px;
    color: #c7d7e9;
    background: linear-gradient(145deg, rgba(10, 29, 51, .99), rgba(4, 15, 29, .99));
    border: 1px solid rgba(137, 190, 244, .17);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .38);
}

.topbar-dropdown-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px 13px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.topbar-dropdown-heading strong,
.topbar-dropdown-heading span {
    display: block;
}

.topbar-dropdown-heading strong {
    color: #f3f8ff;
    font-size: .84rem;
}

.topbar-dropdown-heading span {
    margin-top: 2px;
    color: #758aa2;
    font-size: .7rem;
}

.topbar-dropdown-heading > i {
    color: #70bdff;
}

.topbar-notification-item,
.topbar-menu-item,
.topbar-dropdown-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bdcde0;
    border-radius: 8px;
    text-decoration: none;
    transition: color .16s ease, background .16s ease;
}

.topbar-notification-item {
    padding: 10px 11px;
}

.topbar-notification-item > i {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    color: #ffc56c;
    background: rgba(255, 166, 52, .12);
    border-radius: 8px;
}

.topbar-notification-item span {
    min-width: 0;
}

.topbar-notification-item strong,
.topbar-notification-item small {
    display: block;
}

.topbar-notification-item strong {
    color: #eaf3fc;
    font-size: .77rem;
}

.topbar-notification-item small {
    overflow: hidden;
    margin-top: 2px;
    color: #758aa2;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-menu-item {
    padding: 10px 11px;
    font-size: .8rem;
}

.topbar-menu-item i {
    width: 18px;
    color: #7fc2ff;
    text-align: center;
}

.topbar-notification-item:hover,
.topbar-notification-item:focus,
.topbar-menu-item:hover,
.topbar-menu-item:focus {
    color: #ffffff;
    background: rgba(29, 142, 255, .12);
    outline: none;
}

.topbar-empty-state {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 20px 12px;
    color: #8eafcb;
    font-size: .78rem;
}

.topbar-empty-state i {
    color: #54ddb1;
    font-size: 1.1rem;
}

.topbar-dropdown-footer {
    justify-content: center;
    margin-top: 3px;
    padding: 10px;
    color: #75bbff;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .75rem;
    font-weight: 700;
}

.topbar-dropdown-footer:hover {
    color: #ffffff;
    background: rgba(29, 142, 255, .1);
}


/* ========================================================= */
/* CONTENIDO PRINCIPAL */
/* ========================================================= */

.dashboard-main {
    width: 100%;
    max-width: none;
    padding: 40px 46px 50px;
    margin: 0 auto;
}


/* ========================================================= */
/* ENCABEZADO */
/* ========================================================= */

.dashboard-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 30px;
}


    .dashboard-heading h1 {
        margin: 0;
        color: #ffffff;
        font-size: 44px;
        font-weight: 750;
        line-height: 1.1;
        letter-spacing: -1.5px;
    }

    .dashboard-heading p {
        margin: 9px 0 0;
        color: #71839a;
        font-size: 15px;
    }


/* ========================================================= */
/* SELECTOR DE FECHA */
/* ========================================================= */

.date-selector {
    height: 45px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-radius: 9px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);
    color: #b8c5d5;
    font-size: 13px;
    cursor: default;
}


    .date-selector i {
        color: #7f91a8;
    }


/* ========================================================= */
/* KPI GRID */
/* ========================================================= */

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}


/* ========================================================= */
/* CARD GENERAL */
/* ========================================================= */

.dashboard-card {
    background: linear-gradient( 145deg, rgba(10,24,43,.92), rgba(4,13,26,.92) );
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 13px;
    box-shadow: 0 10px 30px rgba(0,0,0,.16);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}


    .dashboard-card:hover {
        transform: translateY(-2px);
        border-color: rgba(255,255,255,.12);
        box-shadow: 0 15px 35px rgba(0,0,0,.22);
    }


/* ========================================================= */
/* KPI CARD */
/* ========================================================= */

.kpi-card {
    min-height: 220px;
    padding: 25px 26px;
    position: relative;
    overflow: hidden;
    background: linear-gradient( 145deg, rgba(10, 27, 48, .96), rgba(4, 14, 28, .96) );
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0,0,0,.18);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

    .kpi-card:hover {
        transform: translateY(-3px);
        border-color: rgba(255,255,255,.14);
        box-shadow: 0 18px 42px rgba(0,0,0,.25);
    }


/* ========================================================= */
/* KPI TOP */
/* ========================================================= */

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}


    .kpi-top > i {
        color: #506176;
        font-size: 18px;
    }


/* ========================================================= */
/* KPI ICON */
/* ========================================================= */

.kpi-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 21px;
}

    .kpi-icon i {
        font-size: 21px;
    }


/* ========================================================= */
/* COLORES KPI */
/* ========================================================= */

.kpi-blue {
    border-top: 1px solid rgba(0,140,255,.18);
}


    .kpi-blue .kpi-icon {
        color: #35a5ff;
        background: rgba(0,130,255,.10);
    }


    .kpi-blue::after {
        background: #008cff;
    }


.kpi-green {
    border-top: 1px solid rgba(0,220,160,.18);
}


    .kpi-green .kpi-icon {
        color: #25dca7;
        background: rgba(0,220,160,.09);
    }


    .kpi-green::after {
        background: #00dca0;
    }


.kpi-orange {
    border-top: 1px solid rgba(255,160,50,.18);
}


    .kpi-orange .kpi-icon {
        color: #ffad45;
        background: rgba(255,160,50,.09);
    }


    .kpi-orange::after {
        background: #ff9d28;
    }


.kpi-purple {
    border-top: 1px solid rgba(150,90,255,.18);
}


    .kpi-purple .kpi-icon {
        color: #ad7cff;
        background: rgba(140,80,255,.10);
    }


    .kpi-purple::after {
        background: #8d55ff;
    }


/* ========================================================= */
/* KPI TEXTO */
/* ========================================================= */

.kpi-label {
    color: #71839a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 6px;
}


.kpi-number {
    color: #ffffff;
    font-size: 40px;
    line-height: 1;
    font-weight: 750;
    letter-spacing: -1.5px;
    margin-bottom: 13px;
}


.kpi-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}


    .kpi-footer span {
        color: #71839a;
    }


    .kpi-footer strong {
        color: #31d39b;
        font-size: 12px;
    }


.kpi-subtitle {
    color: #506176;
    font-size: 11px;
    margin-top: 4px;
}


/* ========================================================= */
/* MINI GRÁFICO KPI */
/* ========================================================= */

.kpi-chart {
    position: absolute;
    right: 22px;
    bottom: 23px;
    width: clamp(70px, 25%, 120px);
    height: auto;
    aspect-ratio: 120 / 48;
    opacity: .9;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

/* Línea azul - Productos */
.kpi-blue .kpi-chart {
    color: #168cff;
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='48' viewBox='0 0 120 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 39 C10 39 10 36 18 36 C26 36 25 31 33 31 C41 31 41 27 49 27 C57 27 58 30 66 30 C74 30 73 24 81 24 C89 24 90 20 98 20 C106 20 107 13 118 7' fill='none' stroke='%23168cff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    filter: drop-shadow(0 0 5px rgba(22,140,255,.45));
}

/* Línea verde - Activos */
.kpi-green .kpi-chart {
    color: #00dca0;
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='48' viewBox='0 0 120 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 39 C10 39 10 35 18 35 C26 35 26 30 34 30 C42 30 42 25 50 25 C58 25 58 29 66 29 C74 29 74 24 82 24 C90 24 90 28 98 28 C106 28 107 20 118 7' fill='none' stroke='%2300dca0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    filter: drop-shadow(0 0 5px rgba(0,220,160,.45));
}

/* Línea naranja - Stock bajo */
.kpi-orange .kpi-chart {
    color: #ffae42;
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='48' viewBox='0 0 120 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 39 C10 39 10 37 18 37 C26 37 26 32 34 32 C42 32 42 34 50 34 C58 34 58 28 66 28 C74 28 74 30 82 30 C90 30 90 24 98 24 C106 24 107 17 118 8' fill='none' stroke='%23ffae42' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    filter: drop-shadow(0 0 5px rgba(255,174,66,.45));
}

/* Línea violeta - Ventas */
.kpi-purple .kpi-chart {
    color: #9a63ff;
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='48' viewBox='0 0 120 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 39 C10 39 10 37 18 37 C26 37 26 32 34 32 C42 32 42 28 50 28 C58 28 58 31 66 31 C74 31 74 26 82 26 C90 26 90 29 98 29 C106 29 107 19 118 7' fill='none' stroke='%239a63ff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    filter: drop-shadow(0 0 5px rgba(154,99,255,.45));
}

/* ========================================================= */
/* COLUMNAS */
/* ========================================================= */

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}


/* ========================================================= */
/* PANEL */
/* ========================================================= */

.dashboard-panel {
    background: linear-gradient( 145deg, rgba(7, 21, 38, .96), rgba(3, 12, 25, .96) );
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,.15);
}


/* ========================================================= */
/* HEADER PANEL */
/* ========================================================= */

.panel-header {
    min-height: 78px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

    .panel-header h2 {
        margin: 0;
        color: #ffffff;
        font-size: 19px;
        font-weight: 700;
        letter-spacing: -.3px;
    }


.panel-icon {
    font-size: 20px;
}


    .panel-icon.blue {
        color: #35a5ff;
    }


    .panel-icon.orange {
        color: #ffad45;
    }


/* ========================================================= */
/* TABLAS */
/* ========================================================= */

.dashboard-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    color: #c4d0df;
    font-size: 13px;
}

    .dashboard-table th {
        padding: 16px 20px;
        color: #60728b;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }

    .dashboard-table td {
        padding: 18px 20px;
        border-bottom: 1px solid rgba(255,255,255,.045);
        font-size: 13px;
    }


    .dashboard-table tbody tr {
        transition: background .15s ease;
    }


        .dashboard-table tbody tr:hover {
            background: rgba(255,255,255,.025);
        }


        .dashboard-table tbody tr:last-child td {
            border-bottom: none;
        }


/* ========================================================= */
/* ESTADOS */
/* ========================================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}


    .status-badge > span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }


.status-success {
    color: #24d69d;
    background: rgba(0,210,150,.09);
}


    .status-success > span {
        background: #24d69d;
        box-shadow: 0 0 7px rgba(36,214,157,.5);
    }


.status-danger {
    color: #ff6b7d;
    background: rgba(255,70,90,.09);
}


    .status-danger > span {
        background: #ff6b7d;
    }


/* ========================================================= */
/* FOOTER PANEL */
/* ========================================================= */

.panel-footer-link {
    padding: 15px 24px;
    border-top: 1px solid rgba(255,255,255,.045);
}


    .panel-footer-link a {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: #3d9eff;
        text-decoration: none;
        font-size: 12px;
        transition: .2s ease;
    }


        .panel-footer-link a:hover {
            color: #ffffff;
        }


.orange-link a {
    color: #ffad45;
}


    .orange-link a:hover {
        color: #ffffff;
    }


/* ========================================================= */
/* STOCK */
/* ========================================================= */

.stock-table td {
    vertical-align: middle;
}


.stock-product {
    display: flex;
    align-items: center;
    gap: 10px;
}


.stock-image {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,.045);
    color: #71839a;
    font-size: 16px;
}


.stock-product span {
    color: #dbe5f0;
    font-size: 12px;
}


.stock-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}


    .stock-number.critical {
        color: #ff6b7d;
        background: rgba(255,70,90,.10);
    }


    .stock-number.warning {
        color: #ffb454;
        background: rgba(255,170,60,.10);
    }


/* ========================================================= */
/* TABLA VACÍA */
/* ========================================================= */

.empty-table {
    padding: 44px 20px !important;
    text-align: center;
    color: #60728b;
    font-size: 12px;
}


    .empty-table i {
        margin-right: 6px;
        color: #2dd69e;
    }


/* ========================================================= */
/* ACCESOS RÁPIDOS */
/* ========================================================= */

.quick-panel {
    margin-bottom: 24px;
}


.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 22px;
}

.quick-card {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 18px;
    border-radius: 11px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.07);
    background: linear-gradient( 145deg, rgba(255,255,255,.035), rgba(255,255,255,.018) );
    color: #ffffff;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

    .quick-card:hover {
        color: #ffffff;
        transform: translateY(-2px);
        background: rgba(255,255,255,.055);
        border-color: rgba(255,255,255,.14);
        box-shadow: 0 10px 25px rgba(0,0,0,.15);
    }


    .quick-card > div:nth-child(2) {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }


    .quick-card strong {
        color: #ffffff;
        font-size: 13px;
    }


    .quick-card small {
        color: #60728b;
        font-size: 10px;
    }


    .quick-card > i:last-child {
        margin-left: auto;
        color: #506176;
        font-size: 12px;
    }


/* ========================================================= */
/* ICONOS ACCESOS RÁPIDOS */
/* ========================================================= */

.quick-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 19px;
}


.quick-blue .quick-icon {
    color: #35a5ff;
    background: rgba(0,130,255,.10);
}


.quick-green .quick-icon {
    color: #27d9a0;
    background: rgba(0,220,160,.09);
}


.quick-purple .quick-icon {
    color: #ad7cff;
    background: rgba(140,80,255,.10);
}


.quick-cyan .quick-icon {
    color: #35d7ff;
    background: rgba(0,190,255,.09);
}


.quick-orange .quick-icon {
    color: #ffad45;
    background: rgba(255,160,50,.09);
}


.quick-pink .quick-icon {
    color: #ff6fb5;
    background: rgba(255,80,160,.09);
}


/* ========================================================= */
/* FOOTER DASHBOARD */
/* ========================================================= */

.dashboard-footer {
    padding: 17px 5px 6px;
    color: #4d6077;
    font-size: 11px;
    text-align: center;
}

body.particles-disabled #dashboardParticles {
    display: none;
}

/* Variante clara, persistida por navegador. */
body.dashboard-light-mode {
    color: #14263a;
    background: #edf3fa;
}

body.dashboard-light-mode .dashboard-shell {
    background: radial-gradient(circle at 55% 5%, rgba(28, 125, 255, .15), transparent 33%), #eef4fb;
    color: #14263a;
}

body.dashboard-light-mode .dashboard-sidebar {
    background: linear-gradient(180deg, rgba(248, 251, 255, .98), rgba(231, 240, 250, .98));
    border-color: rgba(24, 58, 93, .12);
}

body.dashboard-light-mode .dashboard-topbar {
    background: rgba(247, 251, 255, .86);
    border-color: rgba(24, 58, 93, .1);
}

body.dashboard-light-mode .logo-title,
body.dashboard-light-mode .dashboard-heading h1,
body.dashboard-light-mode .profile-info strong {
    color: #11273e;
}

body.dashboard-light-mode .sidebar-link { color: #546a80; }
body.dashboard-light-mode .sidebar-link > i:first-child { color: #607993; }
body.dashboard-light-mode .sidebar-link:hover { color: #102840; background: rgba(17, 99, 180, .07); }
body.dashboard-light-mode .dashboard-search,
body.dashboard-light-mode .topbar-button,
body.dashboard-light-mode .date-selector { background: rgba(255, 255, 255, .7); border-color: rgba(24, 58, 93, .12); color: #5f7690; }
body.dashboard-light-mode .dashboard-search input { color: #162c43; }
body.dashboard-light-mode .dashboard-card,
body.dashboard-light-mode .dashboard-panel { background: linear-gradient(145deg, #ffffff, #f5f9fd); border-color: rgba(24, 58, 93, .12); box-shadow: 0 10px 30px rgba(29, 71, 111, .09); }
body.dashboard-light-mode .dashboard-panel h2,
body.dashboard-light-mode .dashboard-card .kpi-number { color: #152b42; }


/* ========================================================= */
/* SCROLLBAR SIDEBAR */
/* ========================================================= */

.dashboard-sidebar::-webkit-scrollbar {
    width: 5px;
}


.dashboard-sidebar::-webkit-scrollbar-track {
    background: transparent;
}


.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.08);
    border-radius: 10px;
}


/* ========================================================= */
/* ANIMACIONES */
/* ========================================================= */

@keyframes dashboardFadeIn {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.dashboard-main {
    animation: dashboardFadeIn .35s ease both;
}


.dashboard-card,
.dashboard-panel {
    animation: dashboardFadeIn .4s ease both;
}


/* ========================================================= */
/* RESPONSIVE - 1200px */
/* ========================================================= */

@media (max-width: 1200px) {

    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-chart {
        width: 100px;
        right: 17px;
        bottom: 18px;
    }
}


/* ========================================================= */
/* RESPONSIVE - 1000px */
/* ========================================================= */

@media (max-width: 1000px) {

    .dashboard-sidebar {
        width: 250px;
        min-width: 250px;
    }

    .dashboard-content {
        margin-left: 250px;
        width: calc(100% - 250px);
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .dashboard-search {
        width: 340px;
    }

    .dashboard-main {
        padding: 30px;
    }

    .kpi-chart {
        width: 90px;
        right: 15px;
        bottom: 16px;
    }
}


/* ========================================================= */
/* RESPONSIVE - 768px */
/* ========================================================= */

@media (max-width: 768px) {

    .dashboard-sidebar {
        width: 270px;
        min-width: 270px;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .dashboard-shell.sidebar-is-collapsed .dashboard-sidebar {
        width: 270px;
        min-width: 270px;
        padding: 0 18px;
    }

    .dashboard-shell.sidebar-is-collapsed .dashboard-content {
        margin-left: 0;
        width: 100%;
    }

    .dashboard-shell.sidebar-is-collapsed .dashboard-logo {
        justify-content: flex-start;
        padding: 0 8px;
    }

    .dashboard-shell.sidebar-is-collapsed .dashboard-logo > div:last-child,
    .dashboard-shell.sidebar-is-collapsed .sidebar-title,
    .dashboard-shell.sidebar-is-collapsed .sidebar-link > span,
    .dashboard-shell.sidebar-is-collapsed .sidebar-link .ms-auto,
    .dashboard-shell.sidebar-is-collapsed .collapse-sidebar span {
        display: initial;
    }

    .dashboard-shell.sidebar-is-collapsed .sidebar-link,
    .dashboard-shell.sidebar-is-collapsed .collapse-sidebar {
        justify-content: flex-start;
        padding-left: 15px;
        padding-right: 15px;
    }


        .dashboard-sidebar.open {
            transform: translateX(0);
        }


    .dashboard-content {
        margin-left: 0;
        width: 100%;
    }


    .mobile-menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }


    .dashboard-topbar {
        padding: 0 15px;
    }


    .dashboard-search {
        flex: 1;
        width: auto;
    }


        .dashboard-search span {
            display: none;
        }


    .profile-info,
    .topbar-profile > i {
        display: none;
    }


    .dashboard-main {
        padding: 28px 18px 35px;
    }


    .dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
    }


        .dashboard-heading h1 {
            font-size: 34px;
        }


        .dashboard-heading p {
            font-size: 14px;
        }


    .date-selector {
        align-self: flex-start;
    }
}


/* ========================================================= */
/* RESPONSIVE - 600px */
/* ========================================================= */

@media (max-width: 600px) {

    .dashboard-kpis {
        grid-template-columns: 1fr;
    }


    .quick-grid {
        grid-template-columns: 1fr;
    }


    .dashboard-heading h1 {
        font-size: 30px;
    }


    .panel-header {
        padding: 17px;
        align-items: flex-start;
        flex-direction: column;
    }


        .panel-header > a {
            margin-left: 32px;
        }


    .dashboard-table {
        min-width: 600px;
    }


    .table-responsive {
        overflow-x: auto;
    }


    .kpi-card {
        min-height: 195px;
    }

    .kpi-chart {
        width: 65px;
        right: 12px;
        bottom: 12px;
        opacity: .65;
    }
}


/* ========================================================= */
/* REDUCIR ANIMACIONES */
/* ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .dashboard-main,
    .dashboard-card,
    .dashboard-panel {
        animation: none;
    }


    .sidebar-link,
    .dashboard-card,
    .dashboard-panel,
    .quick-card {
        transition: none;
    }
}

/* Navegación administrativa móvil */
.dashboard-mobile-brand,
.dashboard-sidebar-close,
.dashboard-sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    body.dashboard-menu-open {
        overflow: hidden;
    }

    .dashboard-sidebar {
        z-index: 160;
        width: min(86vw, 310px);
        min-width: 0;
        padding-inline: 16px;
        color: var(--admin-text);
        background: linear-gradient(180deg, var(--admin-sidebar), var(--admin-bg));
        border-color: var(--admin-border);
        box-shadow: 24px 0 60px rgba(0, 0, 0, .34);
    }

    .dashboard-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 150;
        display: block;
        padding: 0;
        background: rgba(2, 8, 16, .68);
        border: 0;
        opacity: 0;
        transition: opacity .2s ease;
    }

    .dashboard-sidebar-backdrop[hidden] {
        display: none;
    }

    .dashboard-sidebar-backdrop.is-visible {
        opacity: 1;
    }

    .dashboard-sidebar-close {
        display: grid;
        width: 38px;
        height: 38px;
        margin-left: auto;
        flex: 0 0 38px;
        place-items: center;
        color: var(--admin-text);
        background: var(--admin-input-bg);
        border: 1px solid var(--admin-border);
        border-radius: 10px;
    }

    .dashboard-topbar {
        min-height: 68px;
        height: auto;
        padding: 10px 14px;
        gap: 9px;
        color: var(--admin-text);
        background: color-mix(in srgb, var(--admin-bg) 88%, transparent);
        border-color: var(--admin-border);
    }

    .mobile-menu-button {
        width: 40px;
        height: 40px;
        margin-right: 0;
        flex: 0 0 40px;
        color: var(--admin-text);
        background: var(--admin-input-bg);
        border-color: var(--admin-border);
    }

    .dashboard-mobile-brand {
        display: flex;
        min-width: 72px;
        flex-direction: column;
        align-items: center;
        color: var(--admin-text);
        line-height: 1;
        text-decoration: none;
    }

    .dashboard-mobile-brand strong {
        font-size: 1.25rem;
        letter-spacing: -.08em;
    }

    .dashboard-mobile-brand span {
        margin-top: 4px;
        color: var(--admin-text-muted);
        font-size: .43rem;
        font-weight: 800;
        letter-spacing: .16em;
    }

    .dashboard-search {
        min-width: 0;
        height: 40px;
        padding-inline: 12px;
        color: var(--admin-text-muted);
        background: var(--admin-input-bg);
        border-color: var(--admin-border);
    }

    .dashboard-search input {
        color: var(--admin-input-text);
    }

    .topbar-actions {
        gap: 3px;
    }

    .topbar-button,
    .topbar-profile {
        color: var(--admin-text);
    }

    .dashboard-main {
        padding: 22px 14px 32px;
    }
}

@media (max-width: 540px) {
    .dashboard-topbar {
        display: grid;
        grid-template-columns: 40px 1fr auto;
    }

    .dashboard-mobile-brand {
        justify-self: center;
    }

    .dashboard-search {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

    .topbar-actions {
        grid-column: 3;
        grid-row: 1;
    }

    .dashboard-heading h1 {
        font-size: clamp(1.7rem, 9vw, 2.1rem);
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kpi-card {
        min-height: 154px;
        padding: 17px;
    }

    .kpi-chart {
        display: none;
    }
}
