/* ========== Monster Outdoor - Design System (Monitor-EXWeb Reference) ========== */

:root {
    --primary-color: #F07400;
    --secondary-color: #333333;
    --primary-gradient: linear-gradient(135deg, #F07400, #00b4ff);
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #242424;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #444444;
    --border-glow: rgba(240, 116, 0, 0.3);
    --input-bg: #3a3a3a;
    --topbar-height: 60px;
    --page-header-height: 35px;
}

/* ========== Light Mode ========== */
.light-mode {
    --bg-primary: #BFBFBF;
    --bg-secondary: #ffffff;
    --bg-card: #f8f8fa;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.85);
    --secondary-color: #e8eaed;
    --text-primary: #333333;
    --text-secondary: #888888;
    --border-color: #e0e0e0;
    --border-glow: rgba(240, 116, 0, 0.2);
    --input-bg: #ffffff;
}

.light-mode .topbar-menu {
    background-color: #333333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.light-mode .menu-link {
    color: #ffffff;
}

.light-mode .submenu {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.light-mode .submenu-link {
    color: var(--text-primary);
}

.light-mode .topbar-icon-btn {
    color: #ffffff;
}

.light-mode .hamburger-btn span {
    background-color: #ffffff;
}

.light-mode .chart-container canvas {
    filter: none;
}

/* ========== Global Reset ========== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* ========== Gradient Scrollbars ========== */
*::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

*::-webkit-scrollbar-track {
    background: var(--input-bg) !important;
    border-radius: 3px !important;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #F07400, #00b4ff) !important;
    border-radius: 3px !important;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff8c1a, #1ac4ff) !important;
}

/* ========== App Container ========== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.unauthorized {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== Page Body ========== */
.page-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background-color: var(--bg-primary);
}

.page-container { padding: 10px; }

/* ========== TopBar Menu ========== */
.topbar-menu {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background-color: var(--secondary-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    z-index: 2;
}

.topbar-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
}

.topbar-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: invert(1) hue-rotate(180deg);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    z-index: 2;
}

/* ========== Navigation Menu (Absolute Center) ========== */
.topbar-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    z-index: 1;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.menu-item {
    position: relative;
    height: 60px;
    display: flex;
    align-items: center;
}

.menu-link {
    color: #ffffff;
    text-decoration: none;
    padding: 0 14px;
    display: flex;
    align-items: center;
    height: 100%;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.menu-link:hover {
    color: var(--primary-color);
}

.menu-link.active-link {
    color: var(--primary-color);
}

/* ========== Submenu (Dropdown) ========== */
.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d2d2d;
    min-width: 185px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-radius: 0 0 10px 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid #444444;
    border-top: 2px solid var(--primary-color);
}

.menu-item:hover > .submenu {
    opacity: 1;
    visibility: visible;
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.submenu-link:hover {
    background-color: rgba(240, 116, 0, 0.12);
    color: var(--primary-color);
    padding-left: 22px;
}

.submenu-link svg,
.submenu-link .submenu-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.submenu-link:hover svg,
.submenu-link:hover .submenu-icon {
    opacity: 1;
}

/* ========== TopBar Icons & Buttons ========== */
.topbar-icon-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    border-radius: 8px;
    color: #ffffff;
}

.topbar-icon-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.topbar-icon-btn svg {
    width: 20px;
    height: 20px;
}

.topbar-user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.topbar-version {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ========== Theme Toggle ========== */
.theme-toggle-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.theme-toggle-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
    transform: rotate(15deg);
}

/* ========== Hamburger Button (Mobile) ========== */
.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: white;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* ========== Spinner Modal ========== */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.spinner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #F07400, #ff9a3c, #00b4ff, #F07400);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
    animation: spin 0.8s linear infinite;
    filter: drop-shadow(0 0 12px rgba(240, 116, 0, 0.3));
}

.spinner-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Export Modal ========== */
.export-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.export-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 36px;
    width: 480px;
    max-width: 92vw;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: exportModalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(240, 116, 0, 0.08);
}

/* Linea gradient superior */
.export-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 16px 16px 0 0;
}

@keyframes exportModalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.export-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(240, 116, 0, 0.1);
    border: 1px solid rgba(240, 116, 0, 0.2);
}

.export-modal-icon svg {
    width: 26px;
    height: 26px;
    color: var(--primary-color);
}

.export-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.export-modal-subtitle {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--text-secondary);
}

/* Barra de progreso animada */
.export-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--input-bg);
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0 12px;
}

.export-progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 0.4s ease;
    position: relative;
}

.export-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Spinner inline para indeterminado */
.export-spinner-inline {
    display: flex;
    justify-content: center;
    margin: 16px 0 12px;
}

.export-spinner-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #F07400, #ff9a3c, #00b4ff, #F07400);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    animation: spin 0.8s linear infinite;
    filter: drop-shadow(0 0 8px rgba(240, 116, 0, 0.25));
}

.export-msg {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 6px;
    min-height: 20px;
    transition: opacity 0.2s ease;
}

/* Estado completado */
.export-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    animation: exportSuccessPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.export-success-icon svg {
    width: 28px;
    height: 28px;
    color: #22c55e;
}

@keyframes exportSuccessPop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.export-done-msg {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 18px;
}

.export-download-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.export-download-links .btn-execute {
    justify-content: center;
    text-align: center;
    width: 100%;
}

/* ========== PPT Template Dropdown ========== */
.ppt-template-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
}

.ppt-template-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 2px solid #D04423;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(208, 68, 35, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    min-width: 200px;
    max-height: 260px;
    overflow-y: auto;
    animation: dropdownFadeIn 0.2s ease-out;
}

.ppt-template-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppt-template-item:first-child {
    border-radius: 8px 8px 0 0;
}

.ppt-template-item:last-child {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.ppt-template-item:hover {
    background: linear-gradient(135deg, #D04423 0%, #B7362A 100%);
    color: white;
}

.ppt-template-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.ppt-template-item:hover svg {
    opacity: 1;
}

.export-modal .btn-close-modal {
    padding: 8px 28px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-modal .btn-close-modal:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

/* ========== Inicio Page ========== */
.inicio-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    -webkit-user-select: none;
    user-select: none;
}

/* Card Hero - Data Driven */
.card-hero {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem 3rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.card-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.25rem 0;
    letter-spacing: -0.5px;
}

/* Quitar marco de focus que Blazor pone al navegar */
.card-hero-title:focus,
.card-hero-title:focus-visible {
    outline: none;
    box-shadow: none;
}

.card-hero-title .text-orange {
    color: var(--primary-color);
}

.card-hero-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
    max-width: 800px;
}

.card-hero-text .highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.card-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    margin-bottom: 1rem;
    padding: 6px 16px;
    background: rgba(240, 116, 0, 0.1);
    border: 1px solid rgba(240, 116, 0, 0.25);
    border-radius: 20px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Card Dashboard */
.card-dashboard {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.card-dashboard-header-gradient {
    background: var(--primary-gradient);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
}

.card-dashboard-title-gradient {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-dashboard-title-gradient svg {
    flex-shrink: 0;
}

.card-dashboard > .dashboard-container {
    padding: 1.5rem 2rem;
}

/* ========== Custom Dropdown ========== */
.custom-dropdown-container {
    position: relative;
}

.custom-dropdown-input {
    cursor: pointer;
    user-select: none;
    padding-right: 2.5rem !important;
}

.dropdown-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    stroke: var(--primary-color);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.dropdown-arrow.open {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-height: 260px;
    overflow-y: auto;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-dropdown-item {
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.875rem;
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-dropdown-item:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.custom-dropdown-item.highlighted {
    background-color: rgba(240, 116, 0, 0.12);
    color: var(--primary-color);
}

.modern-input.compact {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    padding-right: 2.5rem;
}

/* ========== Dashboard (Embedded & Standalone) ========== */
.dashboard-container { width: 100%; }
.dashboard-container h2 { margin-bottom: 20px; }

.dash-filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group-wide {
    min-width: 360px;
}

/* Legacy select styling (for pages not yet converted to custom dropdowns) */
.filter-group select,
.filter-group input[type="text"] {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 160px;
    appearance: none;
    -webkit-appearance: none;
}

.filter-group select:hover,
.filter-group input[type="text"]:hover {
    border-color: var(--primary-color);
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.1);
}

.btn-execute {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-execute:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 116, 0, 0.35);
}

.btn-execute:active {
    transform: translateY(0);
}

.btn-execute:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Small variant for inline/toolbar buttons */
.btn-execute.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
}

/* Export button color variants */
.btn-excel {
    background: linear-gradient(135deg, #217346 0%, #185C37 100%);
}
.btn-excel:hover {
    box-shadow: 0 6px 16px rgba(33, 115, 70, 0.4);
}

.btn-ppt {
    background: linear-gradient(135deg, #D04423 0%, #B7362A 100%);
}
.btn-ppt:hover {
    box-shadow: 0 6px 16px rgba(208, 68, 35, 0.4);
}

.btn-zip {
    background: linear-gradient(135deg, #E6A817 0%, #C98F0A 100%);
    color: #1a1a1a;
}
.btn-zip:hover {
    box-shadow: 0 6px 16px rgba(230, 168, 23, 0.4);
}

.btn-audiencia {
    background: linear-gradient(135deg, #00b4ff 0%, #0090cc 100%);
}
.btn-audiencia:hover {
    box-shadow: 0 6px 16px rgba(0, 180, 255, 0.4);
}

/* Ancho uniforme para botones de exportación/acción */
.btn-excel, .btn-ppt, .btn-zip, .btn-audiencia {
    min-width: 180px;
    justify-content: center;
}

/* Row of exactly 3 equal columns - responsive with auto-fit */
.dashboard-row-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.dash-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.35s ease;
}

.dash-card:hover {
    transform: translateY(-6px) scale(1.015);
    border-color: rgba(240, 116, 0, 0.4);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(240, 116, 0, 0.1),
        0 0 20px rgba(240, 116, 0, 0.08);
}

.dash-card h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash-card-header h4 {
    margin-bottom: 0;
}

.dash-subtitle {
    font-size: 11px;
    color: var(--text-muted, #888);
    font-weight: 400;
    font-style: italic;
}

.dash-legend {
    display: flex;
    gap: 12px;
}

.dash-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.dash-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

/* ========== Chart Canvas ========== */
.dash-card canvas {
    width: 100% !important;
    max-height: 220px;
}

/* ========== SOI Table ========== */
.soi-table {
    margin-top: 10px;
    font-size: 12px;
}

.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* ========== Tables ========== */
.table-simple {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-simple th {
    background: var(--bg-secondary);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-simple td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.table-simple tr:hover td {
    background: rgba(240, 116, 0, 0.06);
}

/* ========== Status Badges ========== */
.status-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    display: inline-block;
}

.status-badge.status-delivered {
    background-color: rgba(48, 209, 88, 0.15);
    color: #30d158;
    border: 1px solid rgba(48, 209, 88, 0.3);
}

.status-badge.status-pending {
    background-color: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
    border: 1px solid rgba(255, 159, 10, 0.3);
}

.status-badge.status-processing {
    background-color: rgba(0, 122, 255, 0.15);
    color: #007aff;
    border: 1px solid rgba(0, 122, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

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

/* ========== Buttons ========== */
.btn-primary-gradient {
    padding: 0.5rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 116, 0, 0.3);
}

.btn-secondary-gradient {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* ========== Modern Inputs ========== */
.modern-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
}

.modern-input:hover {
    border-color: var(--primary-color);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.1);
}

.modern-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.modern-select:hover {
    border-color: var(--primary-color);
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.1);
}

/* ========== Calendar Overlay ========== */
.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.calendar-panel {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    max-height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(240, 116, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1101;
    animation: calendarSlideDown 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes calendarSlideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gradient glow line at top of panel */
.calendar-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    z-index: 1;
    animation: glowPulse 1.5s ease-out;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 20px rgba(240, 116, 0, 0.8), 0 0 40px rgba(0, 180, 255, 0.5); }
    100% { box-shadow: 0 0 6px rgba(240, 116, 0, 0.25), 0 0 12px rgba(0, 180, 255, 0.1); }
}

.calendar-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.calendar-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-panel-title svg {
    color: var(--primary-color);
}

.calendar-close-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-close-btn:hover {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
    border-color: rgba(255, 69, 58, 0.3);
}

.calendar-panel-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.calendar-update-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(240, 116, 0, 0.08);
    border: 1px solid rgba(240, 116, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.calendar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: cardStaggerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.calendar-card:nth-child(1)  { animation-delay: 0.06s; }
.calendar-card:nth-child(2)  { animation-delay: 0.10s; }
.calendar-card:nth-child(3)  { animation-delay: 0.14s; }
.calendar-card:nth-child(4)  { animation-delay: 0.18s; }
.calendar-card:nth-child(5)  { animation-delay: 0.22s; }
.calendar-card:nth-child(6)  { animation-delay: 0.26s; }
.calendar-card:nth-child(7)  { animation-delay: 0.30s; }
.calendar-card:nth-child(8)  { animation-delay: 0.34s; }
.calendar-card:nth-child(9)  { animation-delay: 0.38s; }
.calendar-card:nth-child(10) { animation-delay: 0.42s; }
.calendar-card:nth-child(11) { animation-delay: 0.46s; }
.calendar-card:nth-child(12) { animation-delay: 0.50s; }

@keyframes cardStaggerIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.calendar-card:hover {
    border-color: rgba(240, 116, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ---- Closing Animations ---- */
.calendar-overlay.closing {
    animation: fadeOut 0.35s ease-out 0.2s both;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.calendar-panel.closing {
    animation: calendarSlideUp 0.4s cubic-bezier(0.55, 0, 1, 0.45) 0.15s both;
}

.calendar-panel.closing::before {
    animation: glowFlash 0.3s ease-out both;
}

@keyframes glowFlash {
    from { box-shadow: 0 0 6px rgba(240, 116, 0, 0.25), 0 0 12px rgba(0, 180, 255, 0.1); }
    to { box-shadow: 0 0 25px rgba(240, 116, 0, 0.9), 0 0 50px rgba(0, 180, 255, 0.6); }
}

@keyframes calendarSlideUp {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-100%); }
}

.calendar-panel.closing .calendar-card {
    animation: cardStaggerOut 0.28s cubic-bezier(0.55, 0, 1, 0.45) both;
}

@keyframes cardStaggerOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-18px) scale(0.92); }
}

/* Reverse stagger: last card disappears first */
.calendar-panel.closing .calendar-card:nth-child(12) { animation-delay: 0.00s; }
.calendar-panel.closing .calendar-card:nth-child(11) { animation-delay: 0.02s; }
.calendar-panel.closing .calendar-card:nth-child(10) { animation-delay: 0.04s; }
.calendar-panel.closing .calendar-card:nth-child(9)  { animation-delay: 0.06s; }
.calendar-panel.closing .calendar-card:nth-child(8)  { animation-delay: 0.08s; }
.calendar-panel.closing .calendar-card:nth-child(7)  { animation-delay: 0.10s; }
.calendar-panel.closing .calendar-card:nth-child(6)  { animation-delay: 0.12s; }
.calendar-panel.closing .calendar-card:nth-child(5)  { animation-delay: 0.14s; }
.calendar-panel.closing .calendar-card:nth-child(4)  { animation-delay: 0.16s; }
.calendar-panel.closing .calendar-card:nth-child(3)  { animation-delay: 0.18s; }
.calendar-panel.closing .calendar-card:nth-child(2)  { animation-delay: 0.20s; }
.calendar-panel.closing .calendar-card:nth-child(1)  { animation-delay: 0.22s; }

.calendar-card-header {
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    color: #fff;
    background: var(--primary-gradient);
}

.calendar-card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.calendar-entry.delivered {
    border-left-color: #30d158;
}

.calendar-entry.pending-entry {
    border-left-color: #ff9f0a;
}

.calendar-entry-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-entry-quincena {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.calendar-entry-date {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.calendar-entry-status {
    flex-shrink: 0;
}

/* ========== Autocomplete ========== */
.autocomplete-container {
    position: relative;
}

.autocomplete-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    transition: all 0.3s ease;
}

.autocomplete-input:hover {
    border-color: var(--primary-color);
}

.autocomplete-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.1);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.autocomplete-item:hover {
    background: var(--primary-color);
    color: white;
}

.autocomplete-logo {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 4px;
    object-fit: contain;
    background: #fff;
    flex-shrink: 0;
}

/* ========== Data Tabs ========== */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 16px;
}

.tab-item {
    padding: 8px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    font-weight: 500;
}

.tab-item:hover { color: var(--text-primary); }

.tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ========== Industria / Rankings ========== */
.industria-container { max-width: 1400px; margin: 0 auto; }

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ranking-table th {
    background: var(--bg-secondary);
    padding: 8px 10px;
    text-align: right;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.ranking-table th:first-child { text-align: left; }

.ranking-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.ranking-table td:first-child { text-align: left; }

.ranking-table tr:hover td {
    background: rgba(240, 116, 0, 0.06);
}

.ranking-scrollable {
    max-height: 500px;
    overflow-y: auto;
}

/* ========== Chat AI ========== */
.chat-container { max-width: 800px; margin: 0 auto; }

.chat-messages {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 16px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.chat-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    max-width: 85%;
}

.chat-msg.user {
    background: var(--primary-gradient);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-input-bar {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.3s ease;
}

.chat-input:hover { border-color: var(--primary-color); }

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.1);
}

.btn-secondary {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ========== Mobile Responsive ========== */
@media (max-width: 768px) {
    .topbar-menu {
        padding: 0 1rem;
    }

    .hamburger-btn {
        display: block;
    }

    .topbar-nav {
        position: fixed;
        top: var(--topbar-height);
        left: -100%;
        transform: none;
        width: 100%;
        height: calc(100vh - var(--topbar-height));
        background-color: var(--secondary-color);
        flex-direction: column;
        justify-content: flex-start;
        padding: 1.5rem 0;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .topbar-nav.active {
        left: 0;
        transform: none;
    }

    .menu-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .menu-item {
        height: auto;
        flex-direction: column;
    }

    .menu-link {
        height: auto;
        padding: 12px 20px;
        width: 100%;
    }

    .submenu {
        position: static;
        transform: none;
        width: 100%;
        opacity: 1;
        visibility: visible;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border: none;
        border-radius: 0;
        border-top: none;
        background-color: rgba(0, 0, 0, 0.2);
    }

    .menu-item.active .submenu {
        max-height: 500px;
    }

    .page-body {
        padding: 1rem;
    }

    .card-hero {
        padding: 1.5rem;
    }

    .card-hero-title {
        font-size: 1.4rem;
    }

    .card-dashboard-header-gradient {
        padding: 0.75rem 1rem;
    }

    .card-dashboard-title-gradient {
        font-size: 0.9rem;
    }

    .card-dashboard > .dashboard-container {
        padding: 1rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

/* ========================================================================== */
/* CONTENEDOR PRINCIPAL ALL PAGES                                             */
/* ========================================================================== */

.main-content:has(.contenedor-page) {
    padding: 0 !important;
}

.page-body:has(.contenedor-page) {
    padding: 0 !important;
    overflow: hidden !important;
}

.contenedor-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
    width: 100%;
    padding: 0.5rem;
    overflow: hidden;
    background: var(--bg-primary);
}

.contenedor-page .contenedor-panel {
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.contenedor-page .contenedor-header {
    margin: 0 0 0.75rem 0;
    padding: 0.5rem 0.5rem;
    flex-shrink: 0;
}

.contenedor-page .contenedor-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.header-icon-gradient {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon-gradient svg {
    width: 18px;
    height: 18px;
    color: white;
}

.contenedor-page .camara-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.75rem;
    flex: 1;
    min-height: 0;
    background-color: var(--bg-primary);
    border-radius: 6px;
}

/* ========================================================================== */
/* RESPONSIVE - CONTENEDOR PRINCIPAL                                          */
/* ========================================================================== */

@media (max-width: 768px) {
    .contenedor-page {
        gap: 0.75rem;
        height: calc(100vh - var(--topbar-height));
        min-height: calc(100vh - var(--topbar-height));
        max-height: calc(100vh - var(--topbar-height));
        overflow: hidden;
    }

    .contenedor-page .contenedor-panel {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .contenedor-page .contenedor-header {
        flex-shrink: 0;
    }

    .contenedor-page .camara-body {
        flex: 1;
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .contenedor-page {
        height: calc(100vh - var(--topbar-height));
        min-height: calc(100vh - var(--topbar-height));
        max-height: calc(100vh - var(--topbar-height));
        overflow: hidden;
    }

    .contenedor-page .contenedor-panel {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .contenedor-page .contenedor-header {
        flex-shrink: 0;
    }

    .contenedor-page .camara-body {
        flex: 1;
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
}

/* ========================================================================== */
/* MINI CALENDAR - Grid Date Picker                                          */
/* ========================================================================== */

.date-picker-container {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.modern-date-display {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 140px;
}

.modern-date-display:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(240, 116, 0, 0.2);
}

.calendar-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--primary-color);
    pointer-events: none;
}

.mini-cal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
}

.fecha-picker-wrapper {
    position: relative;
}

.fecha-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    margin-top: 4px;
    animation: miniCalFadeIn 0.2s ease-out;
}

@keyframes miniCalFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mini-calendar {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    width: 280px;
    user-select: none;
}

.mini-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    background: var(--primary-gradient);
    color: white;
}

.mini-calendar-header .nav-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}

.mini-calendar-header .nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.mini-calendar-header .mes-anio {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    flex: 1;
}

.mini-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 8px 8px 4px;
    gap: 2px;
}

.mini-calendar-weekdays span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.mini-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 4px 8px 10px;
    gap: 2px;
}

.dia-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    margin: 0 auto;
}

.dia-btn:hover:not(.empty):not(.selected) {
    background-color: rgba(240, 116, 0, 0.12);
    color: var(--primary-color);
}

.dia-btn.empty {
    cursor: default;
    pointer-events: none;
}

.dia-btn.selected {
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(240, 116, 0, 0.35);
}

.dia-btn.disabled-date {
    color: var(--text-secondary);
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================================================== */
/* RESPONSIVE - WidgetParametros filter bar                                   */
/* ========================================================================== */

.param-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.param-search-box {
    position: relative;
    min-width: 200px;
    flex: 1;
    max-width: 500px;
}

/* ========================================================================== */
/* RESPONSIVE - Chart containers                                              */
/* ========================================================================== */

.chart-container-wt {
    height: 400px;
}

/* ========================================================================== */
/* RESPONSIVE - Mapa container                                                */
/* ========================================================================== */

.mapa-container {
    min-height: 300px;
    position: relative;
    z-index: 0;
}

/* ========================================================================== */
/* RESPONSIVE - 992px breakpoint (tablets landscape)                          */
/* ========================================================================== */

@media (max-width: 992px) {
    .filter-group-wide {
        min-width: 280px;
    }
}

/* ========================================================================== */
/* RESPONSIVE - 576px breakpoint (mobile portrait)                            */
/* ========================================================================== */

@media (max-width: 576px) {
    .page-body {
        padding: 0.5rem;
    }

    .dash-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group-wide {
        min-width: unset;
        width: 100%;
    }

    .ranking-table {
        font-size: 10px;
    }

    .ranking-table th {
        font-size: 9px;
        padding: 6px 6px;
    }

    .ranking-table td {
        padding: 4px 6px;
    }

    .param-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .param-search-box {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    .chart-container-wt {
        height: 40vh;
        min-height: 200px;
    }

    .table-WT1 {
        font-size: x-small;
    }

    .font-head-wt1 {
        font-size: x-small;
    }

    .font-body-wt1 {
        font-size: x-small;
    }
}

/* ========================================================================== */
/* RESPONSIVE - 768px breakpoint additions                                    */
/* ========================================================================== */

@media (max-width: 768px) {
    .chart-container-wt {
        height: 50vh;
        min-height: 250px;
    }

    .mapa-container {
        min-height: 300px;
    }

    .mapa-container .map-wrap {
        height: 50vh !important;
        min-height: 300px;
    }

    /* Table scroll indicator gradient */
    .table-responsive-wt1 {
        background:
            linear-gradient(to right, var(--bg-card) 30%, transparent),
            linear-gradient(to left, var(--bg-card) 30%, transparent),
            linear-gradient(to right, rgba(240,116,0,0.15), transparent 20px),
            linear-gradient(to left, rgba(240,116,0,0.15), transparent 20px);
        background-position: left center, right center, left center, right center;
        background-repeat: no-repeat;
        background-size: 20px 100%, 20px 100%, 20px 100%, 20px 100%;
        background-attachment: local, local, scroll, scroll;
    }

    /* Monitoreo widgets stack vertically */
    .monitoreo-widgets-row {
        flex-direction: column !important;
    }

    .monitoreo-widgets-row > * {
        width: 100% !important;
        flex: unset !important;
    }
}

/* ========================================================================== */
/* COMPETENCIA - Search Grid (12 inputs, 4 columns)                           */
/* ========================================================================== */

.comp-search-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.comp-search-grid .param-search-box {
    min-width: unset;
    max-width: unset;
    flex: unset;
}

@media (max-width: 992px) {
    .comp-search-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .comp-search-grid {
        grid-template-columns: 1fr;
    }
}
