/* ============================================================================
   VARIABLES DE DISEÑO - TEMA MODERNO OSCURO (Referencia: Curico.CL)
   ============================================================================ */
:root {
    /* COLORES PRIMARIOS */
    --primary: #a855f7;
    --primary-dark: #9333ea;
    --primary-light: #c084fc;

    /* COLORES SECUNDARIOS */
    --secondary: #64748b;
    --secondary-light: #94a3b8;

    /* COLORES SEMÁNTICOS */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* COLORES PARA KPI CARDS - ICONOS */
    --kpi-purple: #a855f7;
    --kpi-green: #10b981;
    --kpi-orange: #f97316;
    --kpi-blue: #3b82f6;

    /* FONDOS - TEMA OSCURO */
    --bg-primary: #0a0a0a;
    --bg-secondary: #131313;
    --bg-tertiary: #1e1e1e;
    --bg-light: #2a2a2a;
    --bg-white: #ffffff;

    /* TEXTOS - TEMA OSCURO */
    --text-primary: #f2f2f2;
    --text-secondary: #999999;
    --text-tertiary: #666666;
    --text-light: #cbd5e1;

    /* BORDES - TEMA OSCURO */
    --border-color: #2a2a2a;
    --border-light: #1a1a1a;

    /* SIDEBAR */
    --sidebar-bg: linear-gradient(135deg, #131313 0%, #0a0a0a 100%);
    --sidebar-text: #f2f2f2;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-hover: #2a2a2a;

    /* SOMBRAS */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);

    /* BORDER RADIUS */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* TRANSICIONES */
    --transition: all 0.2s ease-in-out;
}

/* ============================================================================
   RESET Y BASE
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: 0.01em;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body > .app-topbar {
    flex-shrink: 0;
    width: 100%;
}

body > .app-layout {
    flex-grow: 1;
}

body > .app-footer {
    flex-shrink: 0;
    width: 100%;
}

/* ============================================================================
   LAYOUT PRINCIPAL
   ============================================================================ */
.app-layout {
    display: flex;
    flex-grow: 1;
    width: 100%;
    overflow-x: hidden;
}

.app-sidebar {
    width: 256px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    overflow: hidden;
}

.app-sidebar.collapsed {
    width: 80px;
}

.app-sidebar.collapsed .nav-item span {
    display: none;
}

.app-sidebar.collapsed .nav-chevron {
    display: none;
}

.app-sidebar.collapsed .nav-item > a {
    justify-content: center;
    padding: 0.75rem;
}

.app-sidebar.collapsed .nav-item > a i:first-child {
    margin-right: 0;
}

.app-sidebar.collapsed .nav-submenu {
    display: none !important;
}


.nav-menu {
    flex-grow: 1;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-section-title {
    padding: 1rem 1rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.nav-section-title:first-child {
    margin-top: 0;
}

.nav-section-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.5rem;
    margin-bottom: 2rem;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-item-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--bg-white);
}

.nav-item-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, rgba(168, 85, 247, 0.8) 100%);
    color: var(--bg-white);
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(168, 85, 247, 0.25);
}

.nav-item-icon {
    font-size: 1.125rem;
    min-width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-label {
    font-size: 0.9rem;
}

/* Estilos para secciones de menú */
.nav-section {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-section:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.nav-section-title {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0.75rem 0 0.375rem 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.plan-card {
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-lg);
    padding: 0.875rem;
    margin-bottom: 0.75rem;
}

.plan-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.25rem 0;
}

.plan-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    line-height: 1.3;
}

.plan-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--primary);
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.plan-button:hover {
    background: rgba(168, 85, 247, 0.15);
}

/* Estilos para los iconos de Lucide en el menú */
.nav-item>a [data-lucide] {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
}

.app-topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-shrink: 0;
    box-shadow: none;
    border-top: none;
    width: 100%;
}

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

.btn-menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-menu-toggle:hover {
    background: var(--bg-tertiary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 1 auto;
}

.topbar-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.topbar-icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.topbar-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.topbar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
    border-radius: var(--radius-lg);
}

.topbar-brand:hover {
    opacity: 0.8;
}

.topbar-brand-logo {
    max-height: 40px;
    max-width: 150px;
    object-fit: contain;
}

.topbar-brand-placeholder {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1.25rem;
}

.topbar-search {
    display: none;
}

.topbar-search input {
    display: none;
}

.topbar-search input::placeholder {
    display: none;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.topbar-user:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1;
}

.app-content {
    flex-grow: 1;
    overflow: visible;
    padding: 1.25rem;
    background: var(--bg-primary);
}

/* ============================================================================
   PÁGINA - HEADER Y CONTENIDO
   ============================================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.page-header>div:first-child {
    flex-grow: 1;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================================================
   TARJETAS Y CONTENEDORES
   ============================================================================ */
.card {
    height: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(168, 85, 247, 0.3);
}

.card-header {
    padding: 0 0 1rem 0;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-content {
    padding: 1.5rem 0 0 0;
    overflow: hidden;
}

/* ============================================================================
   GRID DE KPI
   ============================================================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.3);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--info));
}

.kpi-card.purple {
    --kpi-color: var(--kpi-purple);
}

.kpi-card.green {
    --kpi-color: var(--kpi-green);
}

.kpi-card.orange {
    --kpi-color: var(--kpi-orange);
}

.kpi-card.blue {
    --kpi-color: var(--kpi-blue);
}

.kpi-card::before {
    background: var(--kpi-color);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.kpi-card.purple .kpi-icon {
    background: rgba(168, 85, 247, 0.12);
    color: var(--kpi-purple);
}

.kpi-card.green .kpi-icon {
    background: rgba(16, 185, 129, 0.12);
    color: var(--kpi-green);
}

.kpi-card.orange .kpi-icon {
    background: rgba(249, 115, 22, 0.12);
    color: var(--kpi-orange);
}

.kpi-card.blue .kpi-icon {
    background: rgba(59, 130, 246, 0.12);
    color: var(--kpi-blue);
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.kpi-trend {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--success);
}

.kpi-trend.negative {
    color: var(--danger);
}

/* ============================================================================
   GRILLAS DE LAYOUT
   ============================================================================ */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid-2col {
        grid-template-columns: 1fr;
    }
}

.chart-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ============================================================================
   TABLAS
   ============================================================================ */
.table-wrapper {
    overflow-x: hidden;
    border-radius: var(--radius-xl);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: rgba(26, 26, 26, 0.5);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
    background: var(--bg-tertiary);
}

.table tbody tr:hover {
    background: rgba(168, 85, 247, 0.08);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.15);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================================
   BOTONES
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transition: left 0.3s ease;
    pointer-events: none;
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    color: var(--bg-primary);
    border-color: #16a34a;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--bg-primary);
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
    background: rgba(76, 111, 255, 0.08);
    border-color: var(--primary-dark);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.25rem;
}

/* Icon buttons - override all other button styles */
.btn.btn-icon,
.btn.btn-icon-sm {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-shadow: none;
}

.btn.btn-icon::before,
.btn.btn-icon-sm::before {
    display: none !important;
}

.btn.btn-icon {
    padding: 0.5rem;
}

.btn.btn-icon-sm {
    padding: 0.5rem;
    gap: 0;
    min-width: 36px;
    min-height: 36px;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: var(--radius-md);
}

.btn.btn-icon-sm i {
    font-size: 1rem !important;
    line-height: 1 !important;
    width: 1em !important;
    height: 1em !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn.btn-icon-sm i::before {
    font-size: 1rem !important;
    width: auto !important;
    height: auto !important;
}

/* Font Awesome icon overrides for buttons */
.btn.btn-icon-sm .fa-solid::before {
    font-size: 1rem !important;
}

.btn.btn-icon-sm .fa-fw {
    width: 1em !important;
}

.btn.btn-icon:hover:not(:disabled),
.btn.btn-icon-sm:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--primary) !important;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3) !important;
    transition: all 0.2s ease-in-out !important;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

/* ============================================================================
   FORMULARIOS
   ============================================================================ */
.form-group {
    margin-bottom: 1.125rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-color: 1px solid #191c24;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.form-control:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--danger);
    background-color: rgba(239, 68, 68, 0.02);
}

.form-control.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f2f2f2' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
    padding-right: 2.25rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.375rem;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.375rem;
    display: none;
}

.invalid-feedback.d-block {
    display: block;
}

.form-help {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.375rem;
}

/* ============================================================================
   ALERTAS Y NOTIFICACIONES
   ============================================================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.08);
    border-color: var(--success);
    color: #166534;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
    color: #7f1d1d;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--warning);
    color: #78350f;
}

.alert-info {
    background: rgba(56, 189, 248, 0.08);
    border-color: var(--info);
    color: #0c4a6e;
}

/* ============================================================================
   GRID Y LAYOUT UTILITARIOS
   ============================================================================ */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.row-cards {
    gap: 1.5rem;
    row-gap: 1.25rem;
}

.col-md-1 {
    flex: 0 0 calc(8.333% - 0.75rem);
}

.col-md-2 {
    flex: 0 0 calc(16.666% - 0.75rem);
}

.col-md-3 {
    flex: 0 0 calc(25% - 0.75rem);
}

.col-md-4 {
    flex: 0 0 calc(33.333% - 0.75rem);
}

.col-md-5 {
    flex: 0 0 calc(41.666% - 0.75rem);
}

.col-md-6 {
    flex: 0 0 calc(50% - 0.75rem);
}

.col-md-7 {
    flex: 0 0 calc(58.333% - 0.75rem);
}

.col-md-8 {
    flex: 0 0 calc(66.666% - 0.75rem);
}

.col-md-9 {
    flex: 0 0 calc(75% - 0.75rem);
}

.col-md-10 {
    flex: 0 0 calc(83.333% - 0.75rem);
}

.col-md-11 {
    flex: 0 0 calc(91.666% - 0.75rem);
}

.col-md-12 {
    flex: 0 0 calc(100% - 0.75rem);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.input-group-text {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group .form-control {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.d-flex {
    display: flex;
}

.d-inline {
    display: inline;
}

.d-block {
    display: block;
}

.d-inline-flex {
    display: inline-flex;
}

/* ============================================================================
   UTILIDADES
   ============================================================================ */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.text-muted-foreground {
    color: var(--text-secondary);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-info {
    color: var(--info);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

.my-2 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.my-3 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.gap-0 {
    gap: 0;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 0.75rem;
}

.gap-3 {
    gap: 1.5rem;
}

.gap-4 {
    gap: 2rem;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.rounded {
    border-radius: var(--radius-lg);
}

.h-100 {
    height: 100%;
}

.w-100 {
    width: 100%;
}

.flex-grow-1 {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: start;
}

.align-items-end {
    align-items: end;
}

.justify-content-start {
    justify-content: start;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.justify-content-between {
    justify-content: space-between;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: end;
}

.text-start {
    text-align: start;
}

.text-muted {
    color: var(--text-secondary);
}

.small {
    font-size: 0.85rem;
}

.h4 {
    font-size: 1.25rem;
    font-weight: 700;
}

.h5 {
    font-size: 1.125rem;
    font-weight: 700;
}

.me-1 {
    margin-right: 0.5rem;
}

.me-2 {
    margin-right: 1rem;
}

.me-3 {
    margin-right: 1.5rem;
}

.bg-light {
    background: var(--bg-light);
}

.bg-dark {
    background: var(--bg-primary);
}

.text-dark {
    color: var(--text-primary);
}

/* Collapse (from Bootstrap) */
.collapse {
    display: none;
}

.collapse.show {
    display: block;
}

/* ============================================================================
   TABLE UTILITIES
   ============================================================================ */
.table-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.table-th-right {
    text-align: right;
}

.table-td-right {
    text-align: right;
}

.table-td-center {
    text-align: center;
}

/* ============================================================================
   TEXT UTILITIES
   ============================================================================ */
.text-font-weight-600 {
    font-weight: 600;
}

.text-font-weight-500 {
    font-weight: 500;
}

.max-width-250 {
    max-width: 250px;
}

.input-search {
    max-width: 250px;
}

/* ============================================================================
   ICON UTILITIES
   ============================================================================ */
.icon-xs {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-sm {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-md {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-xl {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   LAYOUT UTILITIES (Adicionales)
   ============================================================================ */
.font-mono {
    font-family: monospace;
}

.btn-group-inline {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

.form-inline {
    display: contents;
}

.card-paginator {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
}

.login-card .card-header {
    background: transparent;
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    border: none;
    display: block;
}

.login-card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.login-card-subtitle {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.login-content {
    padding: 2rem 1.5rem;
}

.login-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.login-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.login-checkbox label {
    margin-left: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-button {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
}

/* ============================================================================
   BADGES Y ETIQUETAS
   ============================================================================ */
.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(56, 189, 248, 0.1);
    color: var(--info);
}

/* ============================================================================
   DASHBOARD - KPI CARDS
   ============================================================================ */
.kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    width: 100%;
    max-width: 100%;
}

.kpi-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 0.9rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.kpi-icon-wrapper {
    width: 40px;
    height: 40px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-icon-wrapper.green {
    background: rgba(16, 185, 129, 0.15);
}

.kpi-icon-wrapper.orange {
    background: rgba(249, 115, 22, 0.15);
}

.kpi-icon-wrapper.blue {
    background: rgba(59, 130, 246, 0.15);
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.kpi-trend {
    display: none;
}

/* ============================================================================
   DASHBOARD - LAYOUT SECTIONS
   ============================================================================ */
.dashboard-grid-2col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    width: 100%;
    max-width: 100%;
}

.dashboard-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    width: 100%;
    max-width: 100%;
}

.chart-container {
    min-height: 220px;
}

.card-title-icon {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================================================
   DASHBOARD - PRODUCT LIST
   ============================================================================ */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.product-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

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

.product-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.product-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-amount {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================================
   DASHBOARD - ACTIVITIES
   ============================================================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.activity-amount {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
    margin: 0.25rem 0 0 0;
}

/* ============================================================================
   PAGE HEADER DATE RANGE
   ============================================================================ */
.page-header-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================================
   FORM SELECT STYLED
   ============================================================================ */
.form-select-inline {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.form-select-inline:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================================================
   LINK STYLED
   ============================================================================ */
.link-primary {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
}

.link-primary:hover {
    text-decoration: underline;
    color: var(--primary-light);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 1024px) {
    .dashboard-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   ESTILOS DEL MENÚ JERÁRQUICO CON ACORDEÓN
   ============================================================================ */
.nav-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item>a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.nav-item>a:hover {
    background-color: var(--sidebar-hover);
    color: var(--text-primary);
}

.nav-item.active>a {
    background-color: rgba(168, 85, 247, 0.15);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
    padding-left: calc(1rem - 3px);
}

.nav-item.has-submenu>a {
    cursor: pointer;
}

.nav-item.has-submenu.active-parent>a {
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.nav-item>a i:first-child {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
}

.nav-chevron {
    margin-left: auto !important;
    transition: transform 0.3s ease, color 0.2s ease;
    color: var(--secondary-light);
    font-size: 0.9rem !important;
}

.nav-item.has-submenu>a .nav-chevron {
    transform: rotate(0deg);
}

.nav-item.has-submenu.active-parent>a .nav-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Submenu */
.nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.2);
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.nav-submenu .nav-item>a {
    padding-left: 2.75rem;
    font-size: 0.85rem;
    color: var(--secondary-light);
    border-left: none;
}

.nav-submenu .nav-item>a:hover {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
}

.nav-submenu .nav-item.active>a {
    background-color: rgba(168, 85, 247, 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: calc(2.75rem - 3px);
    font-weight: 500;
}

.nav-submenu .nav-submenu {
    background-color: transparent;
}

.nav-submenu .nav-submenu .nav-item>a {
    padding-left: 4.25rem;
    font-size: 0.8rem;
    color: var(--secondary-light);
}

.nav-submenu .nav-submenu .nav-item.active>a {
    padding-left: calc(4.25rem - 3px);
}

.nav-submenu .nav-item>a i:first-child {
    font-size: 0.9rem;
}

/* Ocultar scrollbar */
.app-sidebar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-sidebar::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 240px;
    }

    .nav-item>a {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }

    .nav-submenu .nav-item>a {
        padding-left: 2.5rem;
    }

    .nav-submenu .nav-item.active>a {
        padding-left: calc(2.5rem - 3px);
    }

    .nav-submenu .nav-submenu .nav-item>a {
        padding-left: 4rem;
    }

    .nav-submenu .nav-submenu .nav-item.active>a {
        padding-left: calc(4rem - 3px);
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-search {
        flex: 1;
    }

    .app-content {
        padding: 1rem;
    }

    .page-actions {
        width: 100%;
        flex-direction: column;
    }

    .page-actions>* {
        width: 100%;
    }

    .dashboard-grid-2col {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-auto {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .app-sidebar {
        width: 200px;
    }

    .nav-item>a {
        padding: 0.6rem 0.65rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .nav-item>a i:first-child {
        width: 1rem;
        font-size: 0.9rem;
    }

    .nav-submenu .nav-item>a {
        padding-left: 2.25rem;
    }

    .nav-submenu .nav-item.active>a {
        padding-left: calc(2.25rem - 3px);
    }

    .nav-submenu .nav-submenu .nav-item>a {
        padding-left: 3.75rem;
    }

    .nav-submenu .nav-submenu .nav-item.active>a {
        padding-left: calc(3.75rem - 3px);
    }
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.footer-info {
    width: 100%;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.footer-version {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.7;
}


/* ============================================================================
   FORM SECTIONS
   ============================================================================ */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================================
   TEMPLATES - DRAG AND DROP
   ============================================================================ */

/* Bloques en editor */
.template-block-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.template-block-card {
    padding: 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.template-block-card:hover {
    border-color: var(--primary-color);
}

.template-block-card.dragging {
    opacity: 0.5;
}

.template-block-card.drag-over {
    border-top: 2px solid var(--primary-color);
}

.template-block-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.template-block-drag {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.template-block-drag:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.template-block-meta {
    flex: 1;
}

.template-block-switch {
    flex-shrink: 0;
}

.template-block-card-body {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Galerías de templates */
.template-wrapper {
    display: flex;
    flex-direction: column;
}

.template-gallery {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.template-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    transition: all 0.2s;
}

.template-item:hover {
    background: rgba(76, 111, 255, 0.02);
}

.template-item.dragging {
    opacity: 0.5;
    background: rgba(76, 111, 255, 0.05);
}

.template-item.drag-over {
    border-top: 2px solid var(--primary);
    padding-top: calc(1rem - 2px);
}

.template-item-drag {
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.template-drag-handle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0.25rem;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.2s;
}

.template-drag-handle:hover {
    color: var(--primary);
}

.template-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.template-item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.template-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.template-item-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* Template item actions - clean simple styles */
.template-item-actions {
    display: flex !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

/* Buttons dentro de actions usan .btn.btn-icon-sm que ya está definido arriba */
.template-item-actions form {
    display: contents;
}

/* ============================================================================
   CORONA DASHBOARD STYLES
   ============================================================================ */

/* Badge discount/offer styles */
.badge-discount {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: var(--bg-white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
}

.badge-discount.warning {
    background: var(--warning);
    color: var(--bg-primary);
}

.badge-discount.success {
    background: var(--success);
    color: var(--bg-white);
}

/* Report card with discount */
.report-card {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

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

/* Stat cards for reports */
.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--primary);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-card-icon.orange {
    background: rgba(249, 115, 22, 0.15);
    color: var(--warning);
}

.stat-card-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.stat-card-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.stat-card-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Enhanced table styling */
.table-enhanced {
    width: 100%;
    border-collapse: collapse;
}

.table-enhanced thead {
    background: rgba(168, 85, 247, 0.08);
}

.table-enhanced th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-enhanced td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.table-enhanced tbody tr {
    transition: var(--transition);
}

.table-enhanced tbody tr:hover {
    background: rgba(168, 85, 247, 0.05);
}

.table-enhanced tbody tr:last-child td {
    border-bottom: none;
}

/* Report section title */
.report-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    margin-top: 2rem;
}

.report-section-title:first-child {
    margin-top: 0;
}

/* Filter bar styles */
.filter-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-bar .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.filter-bar .form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
}

.filter-bar .form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* Currency values - highlighted */
.currency-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.currency-value.success {
    color: var(--success);
}

.currency-value.danger {
    color: var(--danger);
}

.currency-value.warning {
    color: var(--warning);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1rem;
    margin: 0;
}

/* Grid spacings for reports */
.report-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.report-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.report-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Card section wrapper */
.card-section {
    margin-bottom: 2.5rem;
}

.card-section:last-child {
    margin-bottom: 0;
}

/* Badge de actualizaciones pendientes */
.topbar-updates-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-lg);
    color: var(--danger);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.topbar-updates-badge:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.topbar-updates-badge i {
    font-size: 1rem;
    animation: pulse 2s infinite;
}

.topbar-updates-badge .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.topbar-updates-badge .text {
    font-size: 0.85rem;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .topbar-updates-badge .text {
        display: none;
    }
}
