/* Xionico TrendMap - estilos (login + app con sidebar) */
* { font-family: 'Roboto', sans-serif; box-sizing: border-box; }

/* ---- Login / auth ---- */
body.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

.auth-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    /* cover mantiene la proporción (sin distorsión); repeat-x para el bucle del parallax */
    background-size: cover;
    background-repeat: repeat-x;
    background-position: 0 0;
    animation: auth-bg-parallax 50s linear infinite;
}
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,71,161,0.7) 0%, rgba(22,101,192,0.6) 50%, rgba(30,136,229,0.5) 100%);
    pointer-events: none;
}
/* Parallax: imagen hacia la izquierda; desplazamiento en vw para que haya movimiento con cover */
@keyframes auth-bg-parallax {
    from { background-position: 0 0; }
    to   { background-position: -100vw 0; }
}

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: calc(100vh - 60px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 50px;
    padding-bottom: 0;
}

.promo-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: white;
    padding-right: 50px;
    padding-top: 8vh;
}

.promo-logo-wrapper { margin-bottom: 32px; }
.promo-logo { width: 190px; height: 190px; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.5)); }
.promo-logo.promo-logo-white { filter: brightness(0) invert(1) drop-shadow(0 3px 3px rgba(0,0,0,0.5)); }
.main-headline { font-size: 58px; font-weight: 700; line-height: 1.1; margin-bottom: 15px; text-transform: uppercase; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.main-headline .period { color: #bbdefb; }
.sub-headline { font-size: 22px; font-weight: 300; margin-bottom: 20px; opacity: 0.95; }
.description { font-size: 15px; line-height: 1.5; max-width: 500px; opacity: 0.9; }

.login-section { flex: 0 0 450px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.login-card {
    background: white;
    border-radius: 30px;
    padding: 0;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}
.login-card-header { padding: 20px; text-align: center; }
.login-card-header .card-logo { width: 48px; height: 48px; margin-top: 30px; }
.company-label { text-align: center; font-size: 24px; font-weight: 600; color: #3c4043; margin-bottom: 24px; padding: 0 40px; }
.login-card form { padding: 0 40px 20px; }
.login-form-group { margin-bottom: 24px; display: flex; align-items: center; border-bottom: 1px solid #e0e0e0; }
.login-form-group i { flex: 0 0 44px; color: #757575; font-size: 22px; }
.login-form-group input { flex: 1; border: none; padding: 15px 12px; font-size: 14px; background: transparent; }
.login-btn {
    width: 100%; background: #1976d2; color: white; border: none; padding: 18px;
    border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 16px;
}
.login-btn:hover { background: #1565c0; }
.login-errors { margin-bottom: 16px; font-size: 14px; color: #c62828; list-style: none; padding: 0; }
.register-link { text-align: center; margin-top: 16px; font-size: 14px; color: #757575; }

/* Mensaje amigable cuando falla CSRF (sesión expirada, etc.) */
.csrf-failure-message { padding: 0 40px 32px; text-align: center; }
.csrf-failure-icon { font-size: 48px; color: #f98b1a; margin-bottom: 16px; display: block; }
.csrf-failure-title { font-size: 18px; font-weight: 600; color: #3c4043; margin: 0 0 12px 0; }
.csrf-failure-text { font-size: 14px; color: #5f6368; line-height: 1.5; margin: 0 0 24px 0; }
.csrf-failure-btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.register-link a { color: #1976d2; text-decoration: none; }
.register-link a:hover { text-decoration: underline; }

.login-track-card {
    background: white;
    border-radius: 30px;
    padding: 24px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    text-align: center;
}
.login-track-text { margin: 0 0 16px 0; font-size: 15px; color: #5f6368; }
.login-track-btn {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    background: #e3f2fd;
    color: #1967d2;
    border: 1px solid #90caf9;
    cursor: pointer;
    box-sizing: border-box;
}
.login-track-btn:hover { background: #bbdefb; border-color: #1976d2; color: #1565c0; }

.footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.2); padding: 15px; text-align: center;
    color: white; font-size: 14px;
}
.footer a { color: white; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-separator { opacity: 0.7; margin: 0 8px; }

@media (max-width: 992px) {
    .login-container { flex-direction: column; padding: 30px 20px; align-items: center; }
    .promo-section { text-align: center; padding-right: 0; }
    .main-headline { font-size: 48px; }
}
@media (max-width: 600px) {
    .promo-section { display: none; }
    .login-section { flex: 1; }
}

/* ---- App (sidebar + main) ---- */
body.app-page { background: #f0f2f5; min-height: 100vh; margin: 0; }

.app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
    background: #fff; box-shadow: 1px 0 0 #e8e8e8; z-index: 1000;
    display: flex; flex-direction: column; transition: width 0.25s ease;
    overflow: hidden;
    box-sizing: border-box;
}
.app-sidebar.sidebar-collapsed { width: 72px; }
.sidebar-header {
    flex-shrink: 0; min-width: 0;
    padding: 20px 16px 16px; border-bottom: 1px solid #e8e8e8;
    display: flex; align-items: center; justify-content: flex-start;
}
.sidebar-header .sidebar-logo { width: 32px; height: 32px; margin-right: 12px; flex-shrink: 0; }
.sidebar-header .sidebar-logo img { width: 32px; height: 32px; display: block; }
.sidebar-header .sidebar-title {
    color: #3c4043; font-size: 17px; font-weight: 600; letter-spacing: 0.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0; flex: 1;
}
.sidebar-collapsed .sidebar-header { justify-content: center; padding: 16px 0; }
.sidebar-collapsed .sidebar-header .sidebar-logo { margin-right: 0; }
.sidebar-collapsed .sidebar-header .sidebar-title.full-title { display: none; }
.sidebar-nav { flex: 1; min-width: 0; padding: 6px 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav .sidebar-link {
    display: flex; align-items: center; min-width: 0; padding: 18px 16px; margin: 0 8px; border-radius: 8px;
    color: #5f6368; text-decoration: none; font-size: 14px; font-weight: 500;
}
.sidebar-nav .sidebar-link:hover { background: #f1f3f4; color: #3c4043; }
.sidebar-nav .sidebar-link.active { background: #e8f0fe; color: #1967d2; }
.sidebar-nav .sidebar-link i { flex: 0 0 40px; font-size: 22px; color: inherit; min-width: 0; }
.sidebar-nav .sidebar-link .nav-text {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}
.sidebar-collapsed .sidebar-nav .sidebar-link {
    justify-content: center; align-items: center; width: auto; min-width: 48px; box-sizing: border-box;
    padding: 14px 8px; margin: 0 8px; min-height: 48px;
}
.sidebar-collapsed .sidebar-nav .sidebar-link .nav-text { display: none; }
.sidebar-collapsed .sidebar-nav .sidebar-link i { flex: none; font-size: 22px; }

/* Menú colapsable (grupos y subitems) */
.sidebar-menu-group { margin: 2px 0; }
.sidebar-menu-group-header {
    display: flex; align-items: center; width: 100%; min-width: 0;
    padding: 18px 16px; margin: 0 8px; border-radius: 8px; border: none;
    background: none; color: #5f6368; font-size: 14px; font-weight: 500;
    cursor: pointer; text-align: left; font-family: inherit;
    box-sizing: border-box;
}
.sidebar-menu-group-header:hover { background: #f1f3f4; color: #3c4043; }
.sidebar-menu-group-header i:first-of-type { flex: 0 0 32px; font-size: 22px; color: inherit; min-width: 0; }
.sidebar-menu-group-header .nav-text {
    flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-menu-group-header .sidebar-chevron {
    flex: 0 0 20px; font-size: 20px; transition: transform 0.2s ease;
    min-width: 20px;
}
.sidebar-menu-group.open .sidebar-chevron { transform: rotate(180deg); }
.sidebar-menu-group-content {
    display: none; overflow: hidden; padding-left: 0;
}
.sidebar-menu-group.open .sidebar-menu-group-content { display: block; }
.sidebar-sublink {
    display: block; padding: 15px 20px 15px 52px; margin: 0 8px; border-radius: 6px;
    color: #5f6368; text-decoration: none; font-size: 13px; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-sublink:hover { background: #f1f3f4; color: #3c4043; }
.sidebar-sublink.active { background: #e8f0fe; color: #1967d2; font-weight: 500; }
@media (max-width: 768px) {
    .sidebar-sublink { padding: 12px 20px 20px 52px; }
}
.sidebar-collapsed .sidebar-menu-group-header {
    justify-content: center; align-items: center; width: auto; min-width: 48px; box-sizing: border-box;
    padding: 14px 8px; margin: 0 8px; min-height: 48px; text-align: center;
}
.sidebar-collapsed .sidebar-menu-group-header .nav-text { display: none !important; }
.sidebar-collapsed .sidebar-menu-group-header .sidebar-chevron { display: none !important; }
.sidebar-collapsed .sidebar-menu-group-header i:first-of-type { flex: none; font-size: 22px; }
.sidebar-collapsed .sidebar-menu-group-content { display: none !important; }

.main-wrap { margin-left: 280px; min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.25s ease; }
.main-wrap.sidebar-collapsed { margin-left: 72px; }
.top-nav {
    height: 64px; background: #fff; border-bottom: 1px solid #e8e8e8;
    display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.top-nav-left { display: flex; align-items: center; gap: 12px; }
.top-nav #sidebar-toggle { cursor: pointer; padding: 8px; color: #5f6368; text-decoration: none; }
.top-nav .page-title { font-size: 20px; font-weight: 600; color: #3c4043; }
.top-nav .user-menu-wrap { position: relative; }
.top-nav .user-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: #e8f0fe; color: #1967d2;
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px;
    cursor: pointer; border: none;
}
.top-nav .user-avatar:hover { background: #d2e3fc; }
.top-nav .user-dropdown {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 8px;
    min-width: 180px; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border: 1px solid #e8e8e8; padding: 8px 0; z-index: 1002;
}
.top-nav .user-dropdown.open { display: block; }
.top-nav .user-dropdown a {
    display: flex; align-items: center; padding: 10px 16px; color: #3c4043; text-decoration: none;
    font-size: 14px;
}
.top-nav .user-dropdown a:hover { background: #f1f3f4; }
.top-nav .user-dropdown a i { margin-right: 12px; font-size: 20px; color: #5f6368; }
.top-nav .user-dropdown .user-dropdown-form { padding: 0; margin: 0; }
.top-nav .user-dropdown .user-dropdown-form button {
    width: 100%; display: flex; align-items: center; padding: 10px 16px;
    background: none; border: none; cursor: pointer; font-size: 14px; color: #3c4043;
    font-family: inherit;
}
.top-nav .user-dropdown .user-dropdown-form button:hover { background: #f1f3f4; }
.top-nav .user-dropdown .user-dropdown-form button i { margin-right: 12px; font-size: 20px; color: #5f6368; }
.main-content { flex: 1; min-width: 0; background: #f0f2f5; display: flex; flex-direction: column; min-height: 0; }
.main-body { padding: 32px 40px; width: 100%; box-sizing: border-box; }
.page-mapa-calor .main-body {
    padding-left: 16px; padding-right: 16px;
    flex: 1; min-height: 0; display: flex; flex-direction: column;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

@media only screen and (max-width: 992px) {
    .main-wrap { margin-left: 0 !important; }
    .main-wrap.sidebar-collapsed { margin-left: 0 !important; }
    .app-sidebar {
        width: 280px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.25s ease, box-shadow 0.25s ease;
        box-shadow: none;
    }
    .app-sidebar.sidebar-collapsed { transform: translateX(-100%); }
    .app-sidebar:not(.sidebar-collapsed) {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .sidebar-overlay.visible { display: block; opacity: 1; }
    .top-nav .page-title { display: none !important; }
}
@media (max-width: 768px) {
    .main-body { padding: 20px 16px; overflow-x: hidden; }
}

/* Home cards */
.home-wrap { width: 100%; }
.home-greeting { margin-bottom: 28px; }
.home-greeting .hello { font-size: 24px; font-weight: 700; color: #3c4043; margin: 0 0 4px 0; }
.home-greeting .welcome { font-size: 15px; color: #5f6368; margin: 0 0 16px 0; }
.home-greeting .today { font-size: 18px; font-weight: 500; color: #1967d2; margin: 0; }
.home-cards .row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.home-cards .col { width: 33.333%; padding: 0 12px; margin-bottom: 24px; }
@media (max-width: 992px) { .home-cards .col { width: 50%; } }
@media (max-width: 600px) { .home-cards .col { width: 100%; } }
.home-card {
    background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8; padding: 24px; height: 100%; display: flex; flex-direction: column;
}
.home-card .card-icon-wrap {
    width: 48px; height: 48px; border-radius: 10px; background: #e8f0fe;
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.home-card .card-icon-wrap i { font-size: 24px; color: #1967d2; }
.home-card .card-title { font-size: 18px; font-weight: 600; color: #3c4043; margin: 0 0 6px 0; display: block; }
.home-card .card-desc { font-size: 13px; color: #5f6368; line-height: 1.5; margin: 0 0 16px 0; flex: 1; }
.home-card .card-action a { font-weight: 600; font-size: 13px; color: #1967d2; text-decoration: none; }
.home-card .card-action a:hover { color: #1557b0; }
a.home-card-link {
    text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
a.home-card-link:hover .card-title { color: #1967d2; }
a.home-card-link .card-action { font-weight: 600; font-size: 13px; color: #1967d2; }
a.home-card-link:hover .card-action { color: #1557b0; }

/* Resumen de operaciones: gráfico circular (entregas + devoluciones + pendientes) */
.home-card-resumen .card-desc { flex: 0; margin-bottom: 16px; }
.resumen-entregas-chart { display: flex; justify-content: center; align-items: center; padding: 8px 0; }
.resumen-chart-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    --deg-entregas: calc(var(--pct-entregas, 0) * 3.6deg);
    --deg-devoluciones: calc(var(--pct-devoluciones, 0) * 3.6deg);
    --deg-end: calc(var(--deg-entregas) + var(--deg-devoluciones));
    background: conic-gradient(
        #1967d2 0deg var(--deg-entregas),
        #e65100 var(--deg-entregas) var(--deg-end),
        #e8ecf1 var(--deg-end) 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.resumen-chart-inner {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px #fff;
}
.resumen-chart-num {
    font-size: 20px;
    font-weight: 700;
    color: #3c4043;
    line-height: 1.2;
}
.resumen-chart-sep { font-weight: 400; color: #9aa0a6; margin: 0 1px; }
.resumen-chart-label {
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.resumen-porcentajes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 13px;
    color: #5f6368;
}
.resumen-pct-cumplidas strong { color: #1967d2; }
.resumen-pct-devoluciones strong { color: #e65100; }
.resumen-card-action { display: flex; justify-content: center; }
.btn-resumen-detalle {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #1967d2;
    background: #fff;
    color: #1967d2;
    cursor: pointer;
}
.btn-resumen-detalle:hover { background: #e8f0fe; }

/* Modal detalle resumen de operaciones */
.resumen-detalle-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.resumen-detalle-modal.hidden { display: none; }
.resumen-detalle-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.resumen-detalle-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
}
.resumen-detalle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
}
.resumen-detalle-title { margin: 0; font-size: 18px; font-weight: 600; color: #3c4043; }
.resumen-detalle-close {
    width: 36px; height: 36px; border: none; background: none; font-size: 24px; color: #5f6368;
    cursor: pointer; line-height: 1; border-radius: 8px;
}
.resumen-detalle-close:hover { background: #f1f3f4; color: #3c4043; }
.resumen-detalle-body { padding: 24px; }
.resumen-detalle-list {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 24px;
    align-items: baseline;
    font-size: 14px;
}
.resumen-detalle-list dt { color: #5f6368; font-weight: 500; }
.resumen-detalle-list dd { margin: 0; font-weight: 600; color: #3c4043; text-align: right; }
.resumen-detalle-sep {
    margin: 20px 0 16px 0;
    border: none;
    border-top: 1px solid #e8e8e8;
}

/* Configuración */
.settings-title { font-size: 24px; font-weight: 700; color: #3c4043; margin: 0 0 4px 0; }
.settings-subtitle { font-size: 14px; color: #5f6368; margin: 0 0 24px 0; }
.config-card {
    background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
.config-card h2 { font-size: 18px; font-weight: 600; color: #1f2933; margin: 0 0 8px 0; }
.config-card p { font-size: 13px; color: #6b7280; margin: 0 0 16px 0; }
.config-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
.config-grid .full-width { grid-column: 1 / -1; }
.config-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.detail-card .config-actions { justify-content: flex-start; }
.detail-dl { margin: 0 0 24px 0; }
.detail-dl dt { font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 16px; margin-bottom: 4px; }
.detail-dl dt:first-of-type { margin-top: 0; }
.detail-dl dd { margin: 0; font-size: 16px; color: #1f2933; }
.detail-dl dd a { color: #1967d2; text-decoration: none; }
.detail-dl dd a:hover { text-decoration: underline; }
.input-field { margin-bottom: 8px; }
.input-field input { width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid #9e9e9e; font-size: 14px; }
.input-field input:focus { outline: none; border-bottom-color: #1976d2; }
.input-field label { font-size: 12px; color: #9e9e9e; display: block; margin-bottom: 4px; }
.input-checkbox-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.input-checkbox-wrap input[type="checkbox"] { width: auto; margin: 0; }
.input-checkbox-wrap span { font-size: 14px; color: #3c4043; }
.btn-primary { background: #1967d2 !important; color: white; padding: 10px 20px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; }
.btn-secondary { background: #e2e8f0; color: #475569; padding: 10px 20px; border-radius: 10px; border: 1px solid #cbd5e1; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-danger { background: #b91c1c; color: white; padding: 10px 20px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-danger:hover { background: #991b1b; }
@media (max-width: 992px) { .config-grid { grid-template-columns: 1fr; } }

/* ---- Lista (búsqueda + paginación) ---- */
.list-page-title { font-size: 24px; font-weight: 700; color: #3c4043; margin: 0 0 24px 0; }
.list-page-subtitle { font-size: 14px; color: #5f6368; margin: 0 0 24px 0; }
.list-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    margin-bottom: 20px;
}
.list-toolbar .btn-add { margin-left: auto; }
.list-toolbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.list-toolbar-actions--productos .btn-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: box-shadow 0.2s ease, filter 0.2s ease;
}
.list-toolbar-actions--productos .btn-toolbar:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    filter: brightness(1.05);
}
.list-toolbar-actions--productos .btn-toolbar .material-icons {
    font-size: 20px;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.list-toolbar-actions--productos .btn-toolbar span {
    line-height: 1;
}
/* Botones solo icono (Importar, Exportar): cuadrados, colores exactos */
.list-toolbar-actions--productos .btn-toolbar.btn-toolbar-icon {
    padding: 10px;
    min-width: 40px;
    min-height: 40px;
    gap: 0;
    justify-content: center;
}
.list-toolbar-actions--productos .btn-import {
    background: #f98b1a;
    color: #fff;
}
.list-toolbar-actions--productos .btn-import:hover { background: #e57d0f; color: #fff; }
.list-toolbar-actions--productos .btn-export {
    background: #23883a;
    color: #fff;
}
.list-toolbar-actions--productos .btn-export:hover { background: #1e7430; color: #fff; }
.list-toolbar-actions--productos .btn-toolbar.btn-primary {
    background: #217ffb;
    color: #fff;
}
.list-toolbar-actions--productos .btn-toolbar.btn-primary:hover { background: #1a6ad9; color: #fff; }
/* NUEVO PRODUCTO: mismo estilo y alineación que Importar/Exportar (no usar .btn-crud-new genérico) */
.list-toolbar-actions--productos .btn-toolbar.btn-add,
.list-toolbar-actions--productos .btn-toolbar.btn-crud-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 0;
    text-transform: none;
    letter-spacing: normal;
}
.list-toolbar-actions--productos .btn-toolbar.btn-crud-new .material-icons {
    font-size: 20px;
    color: inherit;
}

/* Rubros: mismos estilos exactos que Productos (base, sombra, hover, iconos, colores) */
.list-toolbar-actions--rubros .btn-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: box-shadow 0.2s ease, filter 0.2s ease;
}
.list-toolbar-actions--rubros .btn-toolbar:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    filter: brightness(1.05);
}
.list-toolbar-actions--rubros .btn-toolbar .material-icons {
    font-size: 20px;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.list-toolbar-actions--rubros .btn-toolbar span {
    line-height: 1;
}
.list-toolbar-actions--rubros .btn-toolbar.btn-toolbar-icon {
    padding: 10px;
    min-width: 40px;
    min-height: 40px;
    gap: 0;
    justify-content: center;
}
.list-toolbar-actions--rubros .btn-import {
    background: #f98b1a;
    color: #fff;
}
.list-toolbar-actions--rubros .btn-import:hover { background: #e57d0f; color: #fff; }
.list-toolbar-actions--rubros .btn-export {
    background: #23883a;
    color: #fff;
}
.list-toolbar-actions--rubros .btn-export:hover { background: #1e7430; color: #fff; }
.list-toolbar-actions--rubros .btn-toolbar.btn-primary {
    background: #217ffb;
    color: #fff;
}
.list-toolbar-actions--rubros .btn-toolbar.btn-primary:hover { background: #1a6ad9; color: #fff; }
.list-toolbar-actions--rubros .btn-toolbar.btn-add,
.list-toolbar-actions--rubros .btn-toolbar.btn-crud-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 0;
    text-transform: none;
    letter-spacing: normal;
}
.list-toolbar-actions--rubros .btn-toolbar.btn-crud-new .material-icons {
    font-size: 20px;
    color: inherit;
}
/* Controles de formulario en toolbar y formularios (mismo aspecto que /ordenes/) */
.form-input,
.list-toolbar input[type="text"],
.list-toolbar input[type="number"],
.list-toolbar input[type="date"],
.list-toolbar input[type="search"] {
    padding: 10px 12px; border: 1px solid #dadce0; border-radius: 8px; font-size: 14px;
    box-sizing: border-box;
}
.form-input:focus,
.list-toolbar input[type="text"]:focus,
.list-toolbar input[type="number"]:focus,
.list-toolbar input[type="date"]:focus { outline: none; border-color: #1967d2; box-shadow: 0 0 0 2px rgba(25, 103, 210, 0.2); }
.form-select,
.list-toolbar select {
    padding: 10px 12px; border: 1px solid #dadce0; border-radius: 8px; font-size: 14px;
    background: #fff; min-height: 42px; box-sizing: border-box;
}
.form-select:hover,
.list-toolbar select:hover { border-color: #b0b0b0; }
.form-select:focus,
.list-toolbar select:focus { outline: none; border-color: #1967d2; box-shadow: 0 0 0 2px rgba(25, 103, 210, 0.2); }
/* Enlaces que actúan como botón primario/secundario */
a.btn-primary { text-decoration: none; display: inline-block; }
a.btn-secondary { text-decoration: none; display: inline-block; }
a.btn-danger { text-decoration: none; display: inline-block; }
.list-toolbar .btn-primary { padding: 10px 20px; border-radius: 10px; font-size: 14px; border: none; cursor: pointer; font-weight: 600; }
.list-search-wrap {
    flex: 1; min-width: 220px; max-width: 400px;
    display: flex; align-items: center;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
    padding: 0 14px; height: 44px;
}
.list-search-wrap:focus-within { border-color: #1967d2; box-shadow: 0 0 0 2px rgba(25, 103, 210, 0.2); }
.list-search-icon { color: #9e9e9e; font-size: 22px; margin-right: 10px; }
.list-search-input {
    flex: 1; border: none; padding: 0; font-size: 14px; background: transparent;
}
.list-search-input:focus { outline: none; }
.productos-search-form { flex: 1; min-width: 0; max-width: 420px; margin: 0 20px; }
.productos-search-wrap { width: 100%; cursor: text; }
.rubros-search-form,
.users-search-form { flex: 1; min-width: 0; max-width: 420px; margin: 0 12px; }
.rubros-search-wrap,
.users-search-wrap { width: 100%; cursor: text; }
.productos-search-wrap .list-search-input::placeholder { color: #9e9e9e; }
.list-count { font-size: 13px; color: #5f6368; margin-left: 12px; white-space: nowrap; }
.list-count-update { display: none; }
.list-card {
    background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8; overflow: hidden;
}
.list-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.list-table th,
.list-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.list-table th { font-weight: 600; color: #64748b; font-size: 12px; text-transform: uppercase; background: #f8fafc; }
.list-table tbody tr:hover { background: #f8fafc; }
.list-table tbody tr:last-child td { border-bottom: none; }
.list-col-actions { width: 80px; text-align: center; }
.list-col-icon { width: 52px; text-align: center; vertical-align: middle; }
/* Columna de icono de registro en listas General (Rubros, Productos) */
.list-table-col-icon { width: 40px; padding: 14px 6px 14px 16px; text-align: left; vertical-align: middle; }
.list-table-col-icon + td { padding-left: 6px; }
.list-table-row-icon { font-size: 20px; color: #5f6368; vertical-align: middle; }
.list-row-icon-wrap { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #e8eaed; border-radius: 8px; }
.list-row-icon { font-size: 20px; color: #5f6368; }
.list-icon-link { text-decoration: none; color: inherit; }
.list-icon-link:hover .list-row-icon-wrap { background: #dadce0; }
.list-icon-link:hover .list-row-icon { color: #1967d2; }
.list-name-link { text-decoration: none; color: #1967d2; font-weight: 500; }
.list-name-link:hover { text-decoration: underline; }
.list-link { color: #1967d2; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: 6px; }
.list-link:hover { color: #1557b0; }
.list-link .material-icons { font-size: 20px; }
.list-table .list-empty { text-align: center; padding: 48px 16px; color: #5f6368; }
.list-table .list-empty .material-icons { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.list-badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.list-badge-activo { background: #dcfce7; color: #166534; }
.list-badge-pendiente { background: #fef3c7; color: #92400e; }
.list-badge-finalizado { background: #e5e7eb; color: #4b5563; }

.list-pagination {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
    padding: 20px 16px; border-top: 1px solid #f1f5f9;
}
.list-pagination-btn {
    padding: 8px 14px; font-size: 14px; color: #1967d2; text-decoration: none; border-radius: 8px;
    border: 1px solid #e2e8f0; background: #fff;
}
.list-pagination-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.list-pagination-pages { display: flex; gap: 4px; }
.list-pagination-num {
    display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
    padding: 0 10px; font-size: 14px; color: #475569; text-decoration: none; border-radius: 8px;
}
.list-pagination-num:hover { background: #e8f0fe; color: #1967d2; }
.list-pagination-num.active { background: #1967d2; color: #fff; }
.list-pagination-ellipsis {
    display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 36px;
    font-size: 14px; color: #94a3b8; user-select: none; padding: 0 4px;
}

/* CRUD cuerpo a ancho completo (ej. Usuarios del Sistema) */
.crud-page-wrap {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .crud-page-wrap { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; }
}
.crud-page-wrap .list-card--crud {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8;
    overflow: hidden;
    padding: 0;
}
.crud-page-wrap .list-toolbar--crud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 24px 20px;
    margin-bottom: 0;
    border-bottom: 1px solid #f1f5f9;
}
.crud-page-wrap .list-page-title--crud {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #3c4043;
}
.crud-page-wrap .btn-crud-new {
    text-decoration: none;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    background: #1967d2;
    color: #fff;
}
.crud-page-wrap .btn-crud-new:hover { background: #1557b0; color: #fff; }
.crud-page-wrap .list-table--crud { width: 100%; }
.crud-page-wrap .list-col-actions--btns {
    align-items: center;
}
.crud-page-wrap .btn-action {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.crud-page-wrap .btn-action-edit {
    background: #1967d2;
    color: #fff;
}
.crud-page-wrap .btn-action-edit:hover { background: #1557b0; color: #fff; }
.crud-page-wrap .btn-action-delete {
    background: #b91c1c;
    color: #fff;
}
.crud-page-wrap .btn-action-delete:hover { background: #991b1b; color: #fff; }
.crud-page-wrap .list-roles-placeholder { color: #5f6368; }
@media (max-width: 768px) {
    .list-toolbar:not(.list-toolbar--search-row) { flex-direction: column; align-items: stretch; }
    .list-toolbar-search-row {
        display: flex;
        flex: 1 1 100%;
        gap: 12px;
        align-items: center;
        min-width: 0;
    }
    .list-toolbar-search-row .form-input { flex: 1; min-width: 0; max-width: none !important; }
    .list-toolbar-search-row button[type="submit"] { flex-shrink: 0; }
    .list-search-wrap { max-width: none; height: 47px; min-height: 47px; padding: 0 18px; }
    .list-search-input { font-size: 16px; min-height: 22px; }
    .list-search-icon { font-size: 26px; }
    .list-table { font-size: 13px; }
    .list-table th, .list-table td { padding: 10px 12px; }
}

/* Reportes de tendencias (por rubro, por producto) */
.trends-report .list-table--report { font-size: 14px; }
.trends-report .text-right { text-align: right; }
.trends-report .trend-up { color: #166534; font-weight: 600; }
.trends-report .trend-down { color: #b91c1c; font-weight: 600; }
.badge-tendencia {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.badge-tendencia--sube { background: #dcfce7; color: #166534; }
.badge-tendencia--baja { background: #fee2e2; color: #b91c1c; }
.badge-tendencia--estable { background: #e5e7eb; color: #4b5563; }
.report-footer-note { margin-top: 20px; font-size: 13px; color: #5f6368; }
.report-footer-note p { margin: 0; }

/* Mapa de calor */
.heatmap-report .heatmap-card { padding: 24px; }
.heatmap-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 20px;
}
.heatmap-control-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 6px;
}
.heatmap-control-group .heatmap-select { min-width: 220px; }
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #5f6368;
}
.heatmap-legend-bar {
    display: inline-block;
    width: 120px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, rgb(25,230,210), rgb(230,25,210));
    background: linear-gradient(to right, #e8f0fe, #1967d2);
}
.heatmap-container { overflow-x: auto; margin-bottom: 16px; }
.heatmap-table {
    width: 100%;
    max-width: 640px;
    border-collapse: collapse;
    font-size: 14px;
}
.heatmap-table th, .heatmap-table td {
    border: 1px solid #e8e8e8;
    padding: 10px 12px;
    text-align: center;
}
.heatmap-table thead th { background: #f8fafc; font-weight: 600; color: #3c4043; }
.heatmap-table .heatmap-row-label { text-align: left; background: #f8fafc; font-weight: 500; }
.heatmap-table .heatmap-cell { min-width: 56px; font-weight: 600; transition: background-color 0.15s ease; }
.heatmap-caption { font-size: 13px; color: #5f6368; margin: 0; }

/* Mapa Córdoba (mapa real + heatmap) */
.mapa-cordoba-page { max-width: none; width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mapa-cordoba-page .page-module-intro { margin-bottom: 20px; }
.mapa-cordoba-card { padding: 24px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mapa-cordoba-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 20px;
}
.mapa-cordoba-controls .heatmap-control-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 6px;
}
.mapa-cordoba-map {
    width: 100%;
    min-width: 300px;
    flex: 1;
    min-height: 320px;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    background: #e8e8e8;
}
.page-mapa-calor .mapa-cordoba-map { height: 100%; }
.mapa-cordoba-map.leaflet-container { z-index: 0; }
.mapa-cordoba-estado { font-size: 13px; margin-top: 8px; min-height: 1.2em; }
.mapa-cordoba-page .heatmap-caption { margin-top: 12px; }
.mapa-cordoba-controls .heatmap-date { min-width: 140px; }
.heat-label-icon { background: none !important; border: none !important; }
.heat-label-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 28px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    pointer-events: none;
    letter-spacing: 0.02em;
    box-sizing: border-box;
}

/* Páginas de módulo (funcionalidades) */
.page-module { max-width: 960px; }
.page-module.mapa-cordoba-page { max-width: none; width: 100%; }
.page-trends-report .main-body { width: 100%; max-width: none; box-sizing: border-box; }
.page-trends-report .main-content { min-width: 0; }
.page-module.trends-report { max-width: none; width: 100%; box-sizing: border-box; }
.page-module.trends-report .list-card { width: 100%; max-width: 100%; box-sizing: border-box; }
.page-module.trends-report .list-table { width: 100%; }
.page-module.trends-report .report-footer-note { width: 100%; box-sizing: border-box; }
.page-module-intro { font-size: 14px; color: #5f6368; margin: 0 0 24px 0; line-height: 1.6; }
.page-module-section {
    background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8; padding: 20px 24px; margin-bottom: 16px;
}
.page-module-section h2 { font-size: 16px; font-weight: 600; color: #3c4043; margin: 0 0 8px 0; }
.page-module-section p { font-size: 13px; color: #5f6368; margin: 0; line-height: 1.5; }
.page-module-section .placeholder { margin-top: 12px; padding: 16px; background: #f8fafc; border-radius: 8px; font-size: 13px; color: #64748b; }

/* Mensajes flash */
.main-body .alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.main-body .alert.success { background: #dcfce7; color: #166534; }
.main-body .alert.error { background: #fee2e2; color: #b91c1c; }

/* Toast (notificaciones flotantes) */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}
.toast {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.toast--visible {
    opacity: 1;
    transform: translateX(0);
}
.toast.toast--success {
    background: #166534;
    color: #fff;
}
.toast.toast--error {
    background: #b91c1c;
    color: #fff;
}

/* Card informativo colapsable (páginas subitem) */
.info-card-collapsible { padding: 0; overflow: hidden; margin-bottom: 24px; }
.info-card-collapsible .info-card-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: none; border: none; cursor: pointer;
    font-size: 18px; font-weight: 600; color: #3c4043; text-align: left; font-family: inherit;
}
.info-card-collapsible .info-card-toggle:hover { background: #f8fafc; }
.info-card-collapsible .info-card-toggle .info-card-chevron { transition: transform 0.2s ease; color: #5f6368; }
.info-card-collapsible.info-card-expanded .info-card-chevron { transform: rotate(180deg); }
.info-card-collapsible .info-card-body { display: none; padding: 0 24px 24px 24px; }
.info-card-collapsible.info-card-expanded .info-card-body { display: block; }
.info-card-body .info-section-title { font-size: 16px; font-weight: 600; color: #3c4043; margin: 20px 0 10px 0; }
.info-card-body p { font-size: 14px; line-height: 1.6; color: #5f6368; margin: 0 0 12px 0; }
.info-card-body .info-detail-list { margin: 0 0 16px 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: #5f6368; }
.info-card-body .info-detail-list li { margin-bottom: 6px; }

/* Botón de información junto al título y modal de explicación */
.page-info-trigger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin-left: 10px; vertical-align: middle;
    border: 1px solid #dadce0; border-radius: 50%; background: #fff;
    color: #5f6368; cursor: pointer; line-height: 1; padding: 0;
    -webkit-appearance: none; appearance: none;
}
.page-info-trigger .material-icons { font-size: 20px; }
.page-info-trigger:hover { background: #f1f3f4; color: #1967d2; border-color: #1967d2; }
.page-info-trigger:focus { outline: 2px solid #1967d2; outline-offset: 2px; }
/* Contenido solo para el modal: no mostrar en página */
.page-info-content {
    display: none !important;
    position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}
.page-info-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.page-info-modal.hidden { display: none; }
.page-info-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.page-info-modal-box {
    position: relative; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 520px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.page-info-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid #e8e8e8; flex-shrink: 0; }
.page-info-modal-title { margin: 0; font-size: 18px; font-weight: 600; color: #3c4043; }
.page-info-modal-close { width: 36px; height: 36px; border: none; background: none; font-size: 24px; color: #5f6368; cursor: pointer; line-height: 1; border-radius: 8px; }
.page-info-modal-close:hover { background: #f1f3f4; color: #3c4043; }
.page-info-modal-body { padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #5f6368; }
.page-info-modal-body p { margin: 0 0 12px 0; }
.page-info-modal-body p:last-child { margin-bottom: 0; }
.page-info-modal-body strong { color: #3c4043; }
.page-info-modal-body .list-page-subtitle { font-size: 14px; font-weight: 600; color: #3c4043; margin: 0 0 12px 0; }

/* Modal Importar Productos */
.import-productos-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.import-productos-modal.hidden { display: none; }
.import-productos-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
.import-productos-modal-box {
    position: relative; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 520px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.import-productos-modal-header { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid #e8e8e8; flex-shrink: 0; }
.import-productos-modal-icon { font-size: 28px; color: #e65100; flex-shrink: 0; }
.import-productos-modal-title { margin: 0; font-size: 18px; font-weight: 600; color: #3c4043; flex: 1; }
.import-productos-modal-close { margin-left: auto; width: 36px; height: 36px; border: none; background: none; font-size: 24px; color: #5f6368; cursor: pointer; line-height: 1; border-radius: 8px; }
.import-productos-modal-close:hover { background: #f1f3f4; color: #3c4043; }
.import-productos-modal-body { padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #5f6368; }
.import-productos-modal-body p { margin: 0 0 12px 0; }
.import-productos-modal-body ul { margin: 0 0 16px 0; padding-left: 20px; }
.import-productos-modal-body strong { color: #3c4043; }
.import-productos-btn-template { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.import-productos-checkbox-wrap { display: block; margin-bottom: 16px; cursor: pointer; }
.import-productos-checkbox-wrap input { margin-right: 8px; }
.import-productos-file-wrap { margin-bottom: 20px; }
.import-productos-file-label { display: block; font-weight: 600; color: #3c4043; margin-bottom: 8px; }
.import-productos-file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.import-productos-file-input {
    position: absolute; width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; z-index: -1;
}
.import-productos-file-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
    background: #e2e8f0; color: #475569; border: 1px solid #cbd5e1;
    transition: background 0.2s, border-color 0.2s;
}
.import-productos-file-btn:hover { background: #f1f5f9; border-color: #94a3b8; color: #334155; }
.import-productos-file-name { color: #5f6368; font-size: 13px; }
.import-productos-result { margin-bottom: 16px; padding: 12px; border-radius: 8px; }
.import-productos-result.hidden { display: none; }
.import-productos-result-ok { background: #dcfce7; color: #166534; }
.import-productos-result-error { background: #fee2e2; color: #b91c1c; }
.import-productos-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.import-productos-actions .btn-primary { display: inline-flex; align-items: center; gap: 6px; }

/* Modal Exportar Productos */
.export-productos-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.export-productos-modal.hidden { display: none; }
.export-productos-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
.export-productos-modal-box {
    position: relative; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 520px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.export-productos-modal-header {
    display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid #e8e8e8; flex-shrink: 0;
}
.export-productos-modal-icon { font-size: 28px; color: #23883a; }
.export-productos-modal-title { margin: 0; font-size: 18px; font-weight: 600; color: #3c4043; text-transform: none; letter-spacing: normal; }
.export-productos-modal-close { margin-left: auto; width: 36px; height: 36px; border: none; background: none; font-size: 24px; color: #5f6368; cursor: pointer; line-height: 1; border-radius: 8px; }
.export-productos-modal-close:hover { background: #f1f3f4; color: #3c4043; }
.export-productos-modal-body { padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #3c4043; }
.export-productos-pregunta { margin: 0 0 20px 0; font-weight: 500; }
.export-productos-info {
    background: #f0fdf4; border: 1px solid #86efac; border-radius: 10px; padding: 16px 20px; margin-bottom: 20px;
}
.export-productos-info p { margin: 0 0 8px 0; color: #166534; }
.export-productos-info-title { display: flex; align-items: center; gap: 8px; font-weight: 600 !important; }
.export-productos-info-title .material-icons { font-size: 20px; color: #166534; }
.export-productos-info ul { margin: 0; padding-left: 20px; color: #166534; }
.export-productos-info li { margin-bottom: 4px; }
.export-productos-filtros-label { margin: 0 0 8px 0; font-weight: 600; color: #3c4043; }
.export-productos-filtro-tag { display: inline-block; background: #217ffb; color: #fff; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; }
.export-productos-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
.export-productos-btn-excel { display: inline-flex; align-items: center; gap: 8px; background: #23883a !important; }
.export-productos-btn-excel:hover { background: #1e7430 !important; color: #fff; }

/* Modal Importar Rubros (misma estructura que Productos) */
.import-rubros-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.import-rubros-modal.hidden { display: none; }
.import-rubros-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
.import-rubros-modal-box {
    position: relative; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 520px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.import-rubros-modal-header { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid #e8e8e8; flex-shrink: 0; }
.import-rubros-modal-icon { font-size: 28px; color: #e65100; flex-shrink: 0; }
.import-rubros-modal-title { margin: 0; font-size: 18px; font-weight: 600; color: #3c4043; flex: 1; }
.import-rubros-modal-close { margin-left: auto; width: 36px; height: 36px; border: none; background: none; font-size: 24px; color: #5f6368; cursor: pointer; line-height: 1; border-radius: 8px; }
.import-rubros-modal-close:hover { background: #f1f3f4; color: #3c4043; }
.import-rubros-modal-body { padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #5f6368; }
.import-rubros-modal-body p { margin: 0 0 12px 0; }
.import-rubros-modal-body ul { margin: 0 0 16px 0; padding-left: 20px; }
.import-rubros-modal-body strong { color: #3c4043; }
.import-rubros-btn-template { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.import-rubros-checkbox-wrap { display: block; margin-bottom: 16px; cursor: pointer; }
.import-rubros-checkbox-wrap input { margin-right: 8px; }
.import-rubros-file-wrap { margin-bottom: 20px; }
.import-rubros-file-label { display: block; font-weight: 600; color: #3c4043; margin-bottom: 8px; }
.import-rubros-file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.import-rubros-file-input {
    position: absolute; width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; z-index: -1;
}
.import-rubros-file-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
    background: #e2e8f0; color: #475569; border: 1px solid #cbd5e1;
    transition: background 0.2s, border-color 0.2s;
}
.import-rubros-file-btn:hover { background: #f1f5f9; border-color: #94a3b8; color: #334155; }
.import-rubros-file-name { color: #5f6368; font-size: 13px; }
.import-rubros-result { margin-bottom: 16px; padding: 12px; border-radius: 8px; }
.import-rubros-result.hidden { display: none; }
.import-rubros-result-ok { background: #dcfce7; color: #166534; }
.import-rubros-result-error { background: #fee2e2; color: #b91c1c; }
.import-rubros-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.import-rubros-actions .btn-primary { display: inline-flex; align-items: center; gap: 6px; }

/* Modal Exportar Rubros */
.export-rubros-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.export-rubros-modal.hidden { display: none; }
.export-rubros-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); cursor: pointer; }
.export-rubros-modal-box {
    position: relative; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 520px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.export-rubros-modal-header {
    display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid #e8e8e8; flex-shrink: 0;
}
.export-rubros-modal-icon { font-size: 28px; color: #23883a; }
.export-rubros-modal-title { margin: 0; font-size: 18px; font-weight: 600; color: #3c4043; text-transform: none; letter-spacing: normal; }
.export-rubros-modal-close { margin-left: auto; width: 36px; height: 36px; border: none; background: none; font-size: 24px; color: #5f6368; cursor: pointer; line-height: 1; border-radius: 8px; }
.export-rubros-modal-close:hover { background: #f1f3f4; color: #3c4043; }
.export-rubros-modal-body { padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #3c4043; }
.export-rubros-pregunta { margin: 0 0 20px 0; font-weight: 500; }
.export-rubros-info {
    background: #f0fdf4; border: 1px solid #86efac; border-radius: 10px; padding: 16px 20px; margin-bottom: 20px;
}
.export-rubros-info p { margin: 0 0 8px 0; color: #166534; }
.export-rubros-info-title { display: flex; align-items: center; gap: 8px; font-weight: 600 !important; }
.export-rubros-info-title .material-icons { font-size: 20px; color: #166534; }
.export-rubros-info ul { margin: 0; padding-left: 20px; color: #166534; }
.export-rubros-info li { margin-bottom: 4px; }
.export-rubros-filtros-label { margin: 0 0 8px 0; font-weight: 600; color: #3c4043; }
.export-rubros-filtro-tag { display: inline-block; background: #217ffb; color: #fff; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; }
.export-rubros-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
.export-rubros-btn-excel { display: inline-flex; align-items: center; gap: 8px; background: #23883a !important; }
.export-rubros-btn-excel:hover { background: #1e7430 !important; color: #fff; }

/* ---- Monitoreo de vehículos (mapa Leaflet) ---- */
.monitoreo-page-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px - 64px);
    min-height: 400px;
    overflow: hidden;
}
.monitoreo-page-wrap .list-page-title { margin-bottom: 12px; flex-shrink: 0; }
.monitoreo-card {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8;
}
.monitoreo-toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.monitoreo-toolbar .list-search-wrap { margin: 0; max-width: 320px; }
.monitoreo-toolbar .list-count { margin-left: auto; font-size: 13px; color: #5f6368; }
#map-monitoreo {
    flex: 1;
    min-height: 400px;
    width: 100%;
    background: #e8e8e8;
    position: relative;
}
.monitoreo-loading {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #5f6368;
    font-weight: 500;
}
.monitoreo-loading.hidden { display: none; }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; }
.leaflet-popup-content strong { display: block; margin-bottom: 4px; }
.vehiculo-marker-wrap { display: flex; flex-direction: column; align-items: center; }
.vehiculo-toolbox {
    background: #fff;
    color: #1a1a1a;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 3px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    border: 1px solid #e0e0e0;
    margin-bottom: 2px;
}
.vehiculo-marker {
    background: #1967d2;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.vehiculo-marker.highlight { background: #c62828; transform: scale(1.2); }
.vehiculo-marker-wrap:has(.vehiculo-marker.highlight) .vehiculo-toolbox { border-color: #c62828; background: #ffebee; }

/* ---- Developers: Data Models ---- */
.dm-wrap { display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 400px; }
.dm-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-shrink: 0; }
.dm-toolbar label,
.erd-version-label { font-size: 14px; color: #5f6368; font-weight: 500; }
.dm-toolbar select,
.erd-version-select {
    padding: 8px 12px; border-radius: 8px; border: 1px solid #dadce0; font-size: 14px; min-width: 120px;
    background: #fff; color: #3c4043; font-family: inherit; cursor: pointer;
}
.dm-toolbar select:hover,
.erd-version-select:hover { border-color: #b0b0b0; }
.dm-toolbar select:focus,
.erd-version-select:focus { outline: none; border-color: #1967d2; box-shadow: 0 0 0 2px rgba(25, 103, 210, 0.2); }
.dm-main { display: flex; gap: 24px; flex: 1; min-height: 0; }
.dm-models-list { width: 280px; flex-shrink: 0; background: #fff; border: 1px solid #e8e8e8; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.dm-models-list h3 { margin: 0; padding: 14px 16px; font-size: 13px; font-weight: 600; color: #5f6368; text-transform: uppercase; letter-spacing: 0.04em; background: #f8fafc; border-bottom: 1px solid #e8e8e8; }
.dm-models-scroll { overflow-y: auto; flex: 1; padding: 8px; }
.dm-model-item { display: block; width: 100%; padding: 10px 12px; text-align: left; border: none; border-radius: 8px; font-size: 14px; font-family: inherit; cursor: pointer; background: transparent; color: #3c4043; margin-bottom: 2px; }
.dm-model-item:hover { background: #e8f0fe; color: #1967d2; }
.dm-model-item.active { background: #1967d2; color: #fff; }
.dm-model-item .app { font-size: 11px; color: #9aa0a6; margin-left: 4px; }
.dm-model-item.active .app { color: rgba(255,255,255,0.85); }
.dm-detail { flex: 1; min-width: 0; background: #fff; border: 1px solid #e8e8e8; border-radius: 12px; padding: 20px 24px; overflow: auto; }
.dm-detail-placeholder { color: #9aa0a6; font-size: 14px; text-align: center; padding: 40px 20px; }
.dm-detail h2 { margin: 0 0 6px 0; font-size: 18px; color: #3c4043; }
.dm-detail .dm-detail-desc { margin: 0 0 10px 0; font-size: 14px; color: #5f6368; line-height: 1.5; }
.dm-detail .dm-detail-app { font-size: 13px; color: #5f6368; margin-bottom: 16px; }
.dm-fields-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dm-fields-table th, .dm-fields-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.dm-fields-table th { font-weight: 600; color: #64748b; font-size: 12px; text-transform: uppercase; }
.dm-fields-table td { color: #3c4043; }
.dm-fields-table code { font-size: 13px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
@media (max-width: 768px) { .dm-main { flex-direction: column; } .dm-models-list { width: 100%; max-height: 220px; } }

/* ---- Developers: ERD ---- */
.erd-wrap { display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 400px; }
.erd-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-shrink: 0; flex-wrap: wrap; }
.erd-toolbar-sep { width: 1px; height: 24px; background: #e0e0e0; margin: 0 4px; }
.erd-zoom-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #dadce0; border-radius: 8px; background: #fff; cursor: pointer; font-size: 18px; color: #3c4043; }
.erd-zoom-btn:hover { background: #f1f5f9; border-color: #1967d2; color: #1967d2; }
.erd-zoom-reset-btn { width: auto; min-width: 72px; padding: 0 12px; font-size: 14px; }
.erd-zoom-label { font-size: 14px; color: #5f6368; }
.erd-container { flex: 1; min-height: 0; border: 1px solid #e8e8e8; border-radius: 12px; background: #fafafa; overflow: auto; position: relative; }
.erd-inner { transform-origin: 0 0; transition: transform 0.1s ease-out; padding: 24px; min-width: min-content; min-height: min-content; }
.erd-inner .mermaid { display: flex; justify-content: center; align-items: flex-start; }
.erd-inner svg { max-width: none; }

/* ---- Trendmap (informe de tendencias) ---- */
.page-trendmap .main-body { width: 100%; max-width: none; box-sizing: border-box; }
.page-trendmap .main-content { min-width: 0; }
.trendmap-page { width: 100%; max-width: 100%; padding-bottom: 32px; box-sizing: border-box; }
.trendmap-empty { padding: 40px 24px; text-align: center; color: #5f6368; }
.trendmap-header { margin-bottom: 28px; width: 100%; }
.trendmap-title { font-size: 24px; font-weight: 600; color: #3c4043; margin: 0 0 4px 0; }
.trendmap-periodo { font-size: 14px; color: #5f6368; margin: 0; }
.trendmap-section { width: 100%; margin-bottom: 32px; background: #fff; border-radius: 12px; border: 1px solid #e8e8e8; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); box-sizing: border-box; }
.trendmap-section-title { font-size: 18px; font-weight: 600; color: #3c4043; margin: 0 0 16px 0; display: flex; align-items: center; gap: 8px; }
.trendmap-section-title .material-icons { font-size: 22px; color: #5f6368; }
.trendmap-subtitulo { font-size: 14px; color: #5f6368; margin: 0 0 12px 0; line-height: 1.5; }
.trendmap-sintesis { font-size: 14px; line-height: 1.7; color: #3c4043; margin: 0; }
.trendmap-ytd { font-size: 14px; margin: 0 0 12px 0; color: #5f6368; }
.trendmap-ytd strong { color: #3c4043; }
.trendmap-ficha-grid { display: grid; gap: 12px; }
.trendmap-ficha-item { font-size: 14px; line-height: 1.5; color: #3c4043; }
.trendmap-ficha-item strong { color: #1a73e8; }
.trendmap-ficha-variables ul { margin: 8px 0 0 20px; padding: 0; }
.trendmap-ficha-variables li { margin-bottom: 4px; }
.trendmap-macro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.trendmap-chart-card { background: #f8fafc; border-radius: 10px; padding: 16px; }
.trendmap-chart-card h3 { font-size: 14px; font-weight: 600; color: #3c4043; margin: 0 0 6px 0; }
.trendmap-chart-fuente { font-size: 12px; color: #5f6368; margin: 0 0 4px 0; }
.trendmap-chart-nota { font-size: 12px; color: #5f6368; margin: 0 0 12px 0; line-height: 1.4; }
.trendmap-chart-wrap { position: relative; height: 180px; width: 100%; min-width: 0; }
.trendmap-chart-wrap.trendmap-chart-wide { height: 220px; }
.trendmap-two-col { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-bottom: 32px; width: 100%; }
.trendmap-zona-boxes { display: flex; gap: 16px; flex-wrap: wrap; }
.trendmap-zona-box { background: #f8fafc; border-radius: 10px; padding: 16px 20px; min-width: 140px; text-align: center; }
.trendmap-zona-label { display: block; font-size: 12px; color: #5f6368; margin-bottom: 6px; }
.trendmap-zona-val { font-size: 22px; font-weight: 700; }
.trendmap-zona-val.positive { color: #166534; }
.trendmap-zona-val.negative { color: #b91c1c; }
.trendmap-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.trendmap-table th, .trendmap-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.trendmap-table th { font-weight: 600; color: #64748b; font-size: 12px; text-transform: uppercase; }
.trendmap-table .num-variacion.positive { color: #166534; font-weight: 600; }
.trendmap-table .num-variacion.negative { color: #b91c1c; font-weight: 600; }
.trendmap-table-note { font-size: 12px; color: #9ca3af; margin: 10px 0 0 0; }
.trendmap-table-familias .num-variacion { font-weight: 600; }
.trendmap-subfamilias-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.trendmap-subfamilia-card { background: #f8fafc; border-radius: 10px; padding: 16px; }
.trendmap-subfamilia-card h3 { font-size: 14px; font-weight: 600; color: #3c4043; margin: 0 0 8px 0; }
.trendmap-subfamilia-nota { font-size: 12px; color: #5f6368; margin: 0 0 10px 0; line-height: 1.4; }
.trendmap-subfamilia-list { list-style: none; margin: 0; padding: 0; }
.trendmap-subfamilia-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #e8e8e8; gap: 12px; }
.trendmap-subfamilia-list li:last-child { border-bottom: none; }
.trendmap-subfamilia-name { color: #3c4043; }
.trendmap-subfamilia-var { font-weight: 600; flex-shrink: 0; }
.trendmap-subfamilia-var.positive { color: #166534; }
.trendmap-subfamilia-var.negative { color: #b91c1c; }
.trendmap-categorias { margin-bottom: 24px; }
.trendmap-categorias-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.trendmap-cat-title { font-size: 16px; font-weight: 600; margin: 0 0 12px 0; }
.trendmap-cat-title.positive { color: #166534; }
.trendmap-cat-title.negative { color: #b91c1c; }
.trendmap-cat-list { margin: 0; padding-left: 22px; font-size: 14px; line-height: 1.8; color: #3c4043; }
@media (max-width: 768px) { .trendmap-categorias-grid { grid-template-columns: 1fr; } .trendmap-macro-grid { grid-template-columns: 1fr; } }
