@import url('https://fonts.googleapis.com/css2?family=Playwrite+AU+QLD:wght@100..400&family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2:wght@400..800&family=Zain:wght@200;300;400;700;800;900&display=swap');

:root{
  --green:#2e7d32; --green-700:#1b5e20; --green-100:#e8f5e9;
  --text:#1e293b; --muted:#64748b; --bg:#f6f7fb; --white:#fff; --border:#e2e8f0;
  --warn:#f59e0b; --danger:#dc2626; --ok:#10b981; --blue:#2563eb; --blue-700:#1d4ed8;
  --shadow:0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
  --radius:12px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0; font:14px/1.4 "Work Sans",system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial; color:var(--text); background:var(--bg)}

/* Topbar (+15%) */
.topbar{position:sticky; top:0; z-index:10; display:flex; align-items:center; justify-content:space-between; padding:14px 16px; background:var(--green); color:#fff; box-shadow:var(--shadow)}
.topbar__left,.topbar__center,.topbar__right{display:flex; align-items:center; gap:12px}

/* Marca */
.brand{display:flex; align-items:center; gap:8px; font-weight:700; background:transparent; border:none; color:#fff; cursor:pointer; text-decoration:none}
.brand__logo{width:30px; height:30px; display:block; object-fit:contain}
.brand__name {
  font-family: "Zain", sans-serif;
  font-weight:800; /* NO CAMBIAR */
  font-size:38px; letter-spacing:.2px; color:#fff;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}

/* Buscador */
.topbar__search input{width:360px; max-width:45vw; padding:10px 14px; border:none; border-radius:10px; outline:none; background:var(--green-700); color:#eaf7ea}

/* Pills */
.pill{display:inline-block; padding:6px 10px; border-radius:999px; font-size:12px; background:rgba(255,255,255,.2); margin-right:8px}
.pill--ok{background:#059669; color:#ecfdf5}
.pill--info{background:#dbeafe; color:#1e40af}

.header-actions {margin-bottom: 15px;}

/* Usuario */
.user{display:flex; align-items:center; gap:8px}
.user__avatar{width:32px; height:32px; border-radius:999px; border:2px solid rgba(255,255,255,.4); object-fit:cover}
.user__meta{line-height:1} .user__name{font-weight:600} .user__role{font-size:12px; opacity:.9}

/* Layout */
.layout{display:grid; grid-template-columns:260px 1fr; min-height:calc(100vh - 56px)}
.sidebar{background:#fff; border-right:1px solid var(--border); padding:16px; display:flex; flex-direction:column; justify-content:space-between}
.menu__group{margin:10px 0 6px; font-size:12px; text-transform:uppercase; color:var(--muted)}
.menu__item{display:block; padding:10px 12px; border-radius:10px; color:#0f172a; text-decoration:none}
.menu__item i{width:16px; margin-right:6px; color:#64748b}
.menu__item:hover{background:var(--bg)} .menu__item.active{background:var(--green-100); color:var(--green); font-weight:600}
.icon-plus{display:inline-block; width:18px; text-align:center; font-weight:800; color:#fff; background:var(--green); border-radius:6px; margin-right:6px}
.sidebar__simulator{margin-top:16px; padding:10px; border:1px dashed var(--border); border-radius:10px; background:#fafafa}

main#app{padding:20px}

/* Cards & Grids */
.card{background:#fff; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; margin-bottom:18px;margin-top:20px;}
.card__title{margin:0 0 12px; font-size:16px}
.grid{display:grid; gap:14px}
.grid--2{grid-template-columns:1fr 1fr} .grid--3{grid-template-columns:1fr 1fr 1fr} .grid--4{grid-template-columns:repeat(4,1fr)} .grid--5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width:1100px){.grid--4{grid-template-columns:1fr 1fr}}
/* Línea original comentada para no interferir */
/* @media (max-width:900px){.layout{grid-template-columns:72px 1fr} .menu__group{display:none} .sidebar__simulator{display:none}} */
@media (max-width:720px){.grid--3{grid-template-columns:1fr 1fr} .grid--2{grid-template-columns:1fr}}

/* KPI */
.kpi{background:linear-gradient(180deg,#fff,#f7fafc); border:1px solid var(--border); border-radius:12px; padding:14px}
.kpi__label{font-size:12px; color:var(--muted)} .kpi__value{font-size:22px; font-weight:700}
.kpi__delta{font-size:12px} .kpi__delta--up{color:var(--ok)} .kpi__delta--down{color:var(--danger)}

/* Tabla */
.table{width:100%; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid var(--border); border-radius:12px; overflow:hidden;}
.table th,.table td{padding:10px 12px; border-bottom:1px solid var(--border)}
.table th{background:#fafafa; text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.3px; color:var(--muted)}
.table tr:last-child td{border-bottom:none}
.table .status{padding:4px 8px; border-radius:999px; font-size:12px; display:inline-block}
.status--open{background:#fef3c7; color:#92400e}
.status--active{background:#dcfce7; color:#065f46}
.status--stopped{background:#e2e8f0; color:#334155}
.status--approved{background:#dbeafe; color:#1e40af}
.status--scheduled{background:#dbeafe; color:#1e40af}
.status--sent{background:#e9d5ff; color:#6d28d9}

/* Form modernos */
.form{display:grid; gap:12px}
.form .row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.form label{font-size:12px; color:var(--muted)}
.form input[type="text"], .form input[type="url"], .form input[type="email"], .form input[type="search"], .form input[type="datetime-local"], .form input[type="time"], .form input[type="date"], .form select, .form textarea{
  width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:#fff; outline:none; transition: box-shadow .15s ease, border-color .15s ease
}
.form textarea{min-height:96px; resize:vertical}
/* .form input:focus, .form select:focus, .form textarea:focus{border-color:#93c5fd; box-shadow:0 0 0 4px rgba(37,99,235,.1)} */
/* Estilo moderno para todos los inputs al estar seleccionados (focus) */
.form input:focus, 
.form input[type="password"]:focus, 
.form select:focus, 
.form textarea:focus {
    border-color: #2563eb; /* Un azul más intenso */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); /* El "resplandor" */
}
.help{font-size:12px; color:var(--muted)}
.error{font-size:12px; color:var(--danger); display:none}
.input--invalid{border-color:var(--danger); background:#fff1f2}

/* Botones */
.btn{background:var(--green); color:#fff; border:none; border-radius:10px; padding:10px 14px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px; font-weight:600}
.btn:hover{background:#27692b} .btn:disabled{background:#9ca3af; cursor:not-allowed}
.btn--secondary{background:#e2e8f0; color:#0f172a}
.btn--ghost{background:transparent; border:1px solid var(--border); color:#0f172a}
.btn--icon{background:transparent; color:#111827; border:none; cursor:pointer}
.btn--danger{background:var(--danger)} .btn--warn{background:var(--warn); color:#111827}
.btn-approve{background:var(--blue)} .btn-approve:hover{background:var(--blue-700)}
.header-actions .btn{text-decoration:none}

/* Tooltip */
.tooltip{position:relative; cursor:help}
.tooltip:hover::after{
    content:attr(data-tip); 
    position:absolute; 
    left:50%; 
    transform:translateX(-50%);
    top:100%; 
    margin-top:5px;
    background:#111827; 
    color:#fff; 
    font-size:12px; 
    padding:6px 8px; 
    border-radius:6px; 
    white-space:nowrap; 
    box-shadow:var(--shadow);
    z-index:1000;
    pointer-events:none;
}
.tooltip:hover::before{
    content:''; 
    position:absolute; 
    left:50%; 
    transform:translateX(-50%);
    top:100%; 
    border:4px solid transparent; 
    border-bottom-color:#111827;
    z-index:1001;
    pointer-events:none;
}

/* Modal */
/* Modal */
.modal{position:fixed; inset:0; background:rgba(0,0,0,.28); display:flex; align-items:center; justify-content:center; z-index:200}
.hidden{display:none}
.modal__dialog{width:min(830px,95vw); background:#fff; border-radius:12px; box-shadow:var(--shadow); overflow:hidden; z-index:201; position:relative}
.modal__header,.modal__footer{padding:12px 16px; background:#fafafa; border-bottom:1px solid var(--border)}
.modal__footer{border-top:1px solid var(--border); border-bottom:none; display:flex; justify-content:flex-end; gap:8px}
.modal__body{padding:16px}

/* Badges & Alerts */
.badge{background:rgba(255,255,255,.15); padding:2px 6px; border-radius:999px; font-size:12px}
.badge--role{background:#eef2ff; color:#3730a3}
.badge--limit{background:#fff7ed; color:#9a3412}
.badge--env{background:rgba(255,255,255,.15); color:#fff}
.alert{padding:10px 12px; border-radius:10px; border:1px solid}
.alert--ok{background:#ecfdf5; border-color:#86efac; color:#065f46}
.alert--warn{background:#fffbeb; border-color:#fcd34d; color:#92400e}
.alert--err{background:#fef2f2; border-color:#fecaca; color:#991b1b}

/* Spinner */
.spinner{display:inline-block; width:16px; height:16px; border:2px solid #e5e7eb; border-top-color:#111827; border-radius:50%; animation:spin 1s linear infinite; vertical-align:middle; margin-right:8px}
@keyframes spin{to{transform:rotate(360deg)}}

/* Métricas */
.filters{ display:grid; grid-template-columns: repeat(12, 1fr); gap:12px; align-items:end; margin-bottom:16px; }
.filters .filter{ grid-column: span 3; }
.filters .filter--q{ grid-column: span 4; }
.filters .filter--btn{ grid-column: span 2; }
.form-dates{ display:flex; gap:10px; align-items:end; }
.is-hidden{ display:none !important; }
.tabs{ display:flex; gap:6px; margin:12px 0; }
.tab{ padding:8px 12px; border:1px solid var(--border); border-radius:999px; background:#fff; color:#0f172a; cursor:pointer; font:600 13px "Work Sans",sans-serif; }
.tab.active{ background:var(--green-100); color:var(--green); }
.chart{ background:#fff; border:1px solid var(--border); border-radius:14px; padding:14px; min-height:180px; }
.chart--small{ min-height:120px; }
.heatmap{ display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.heatmap div{ height:28px; border-radius:6px; background:#e2e8f0; }
.legend{ font-size:12px; color:var(--muted); display:flex; gap:8px; align-items:center; }
.legend .box{ width:14px; height:14px; border-radius:4px; background:#e2e8f0; display:inline-block; }
.export{ display:flex; justify-content:flex-end; }

/* Footer */
.app-footer {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 20px; background:var(--white); border-top:1px solid var(--border);
  font-size:13px; color:var(--muted);
}
.footer-left { display:flex; align-items:center; gap:10px; }
.footer-slogan { font-size:14px; color:var(--text); font-weight:500; }
.footer-slogan img.footer-logo { height:1.6em; vertical-align:middle; margin:0 6px; }
.footer-right small { color: var(--muted); }


/* =================================== */
/* ESTILOS NUEVO DASHBOARD             */
/* =================================== */

/* Estilos para los KPIs con iconos */
.kpi__label {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre el icono y el texto */
}

/* Bloque de "Atención Requerida" */
.action-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.action-item:last-child {
    border-bottom: none;
}
.btn--sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Animación de pulso para los botones de acción */
.btn--pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 103, 222, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(37, 103, 222, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 103, 222, 0); }
}

/* Bloque de "Todo al día" */
.success-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #f0f9eb; /* Verde muy claro */
    border-left: 5px solid #65a30d; /* Verde oscuro */
    padding: 20px;
}
.success-box__icon {
    font-size: 2.5rem;
    animation: pop-in 0.5s ease-out;
}
.success-box__text h4 {
    margin: 0 0 4px 0;
    color: #3f6212;
}
.success-box__text p {
    margin: 0;
    color: #578022;
}
@keyframes pop-in {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* =================================== */
/* MEJORAS VISUALES LISTAS           */
/* =================================== */
.table .cell-center {
    text-align: center;
    vertical-align: middle;
}
.table .actions-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}
/* Hacemos que los formularios dentro del grupo no afecten el layout */
.actions-group form {
    margin: 0;
}

/* Estilo para los iconos en los títulos de las tarjetas */
.card__title i {
    color: var(--green);
    margin-right: 8px; /* Espacio entre el icono y el texto */
    font-size: 0.9em;  /* Hacemos el icono un poco más pequeño que el texto */
    opacity: 0.8;
}

/* Estilo para que el input de password se vea bien */
/* .form input[type="password"] {
    width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:#fff; outline:none; transition: box-shadow .15s ease, border-color .15s ease;
}
 */
 /* Estilo para los inputs normales (no seleccionados) */
.form input,
.form select,
.form textarea,
.form input[type="password"] {
    width: 100%; 
    padding: 12px 14px; 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    background: #fff; 
    outline: none; 
    transition: box-shadow .15s ease, border-color .15s ease;
}
/* Estilos para el nuevo menú de usuario desplegable */
.user-menu { position: relative; }
.user-menu__button { display: flex; align-items: center; gap: 8px; background: transparent; border: none; color: white; cursor: pointer; padding: 4px; border-radius: 8px; }
.user-menu__button:hover { background: rgba(255,255,255,0.1); }
.user-menu__dropdown { display: none; position: absolute; top: 100%; right: 0; background: white; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; min-width: 160px; z-index: 20; }
.user-menu:hover .user-menu__dropdown { display: block;}
.user-menu__dropdown a, .user-menu__dropdown button { display: block; width: 100%; padding: 10px 14px; text-align: left; color: var(--text); background: none; border: none; font-size: 14px; text-decoration: none; cursor: pointer; }
.user-menu__dropdown a:hover, .user-menu__dropdown button:hover { background: var(--bg);font-weight: bold; }
/* Ajustes para el botón de login */
.btn--login {
    justify-content: center; /* Centra el texto horizontalmente */
    padding-top: 13px;       /* Aumenta el padding superior */
    padding-bottom: 13px;    /* Aumenta el padding inferior */
}
/* =================================== */
/* ESTILOS PARA MODAL DE BÚSQUEDA      */
/* =================================== */
.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.search-results-list li a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
.search-results-list li a:hover {
    background-color: var(--bg);
}
.search-results-list h4 {
    margin-top: 16px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--muted);
}
.search-results-list h4:first-child {
    margin-top: 0;
}
/* =================================== */
/* MEJORAS AL MODAL                    */
/* =================================== */

/* Hacemos que la cabecera del modal sea un contenedor flexible */
.modal__header {
    display: flex;
    justify-content: space-between; /* Empuja el título a la izquierda y el botón a la derecha */
    align-items: center;
}

/* Quitamos el margen automático del título para que no interfiera */
.modal__header h3 {
    margin: 0;
}

/* Estilo del botón de cierre */
.modal__header .btn--icon {
    padding: 4px 8px; /* Hacemos el área de click un poco más grande */
}

/* =================================== */
/* CONTROLES DE DÍAS DE LA SEMANA      */
/* =================================== */
.days-selector {
    display:flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px; /* ✅ Solo la separación entre elementos */
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    margin-top: 4px;
}


.day-checkbox {
    display: flex;
    align-items: center;
    gap: 4px; /* Separación de 4px entre checkbox y texto */
    white-space: nowrap;
}

.day-checkbox input[type="checkbox"] {
    display: block;
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.day-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    user-select: none;
    line-height: 1;
}

.day-checkbox input:checked + .day-label {
    font-weight: 600;
    color: var(--green);
}

.day-label:hover {
    color: var(--green);
}

@media (max-width: 768px) {
    .days-selector {
        gap: 8px;
        padding: 10px;
    }
    
    .day-label {
        font-size: 13px;
    }
}

/* =================================== */
/* MEJORAS MOBILE-FIRST (NUEVA)        */
/* =================================== */

/* Topbar mejorado para móviles */
@media (max-width: 900px) {
    .topbar {
        padding: 8px 12px 8px 8px; /* ✅ Menos padding izquierdo, normal derecho */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 110;
    }
    
    /* Ajustar el body para el topbar fijo */
    body {
        padding-top: 56px;
    }
    
    .topbar__left {
        display: flex;
        align-items: center;
        gap: 8px; /* ✅ Menos gap para mover sandwich más a la izquierda */
    }
        /* Ajustar spacing del lado derecho */
    .topbar__right {
        padding-right: 3px; /* ✅ Separación del borde derecho */
    }
    
    /* Mover el botón hamburguesa más a la izquierda */
    .menu-toggle {
        margin-left: -4px; /* ✅ 4px hacia la izquierda */
    }
    /* Ocultar buscador en móvil */
    .topbar__search {
        display: none !important;
    }
    
    /* Simplificar pills a texto simple */
    .topbar__right .pill {
        display: none; /* Ocultar pills individuales */
    }
    
    /* Mostrar solo el texto simple */
    .topbar__status-text {
        display: block !important;
        white-space: nowrap;
        font-size: 12px;
        color: rgba(255,255,255,0.9);
        font-weight: 500;
    }
}

/* Layout móvil mejorado */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr; /* Solo una columna en móvil */
        position: relative;
    }
        .sidebar::-webkit-scrollbar {
        width: 4px;
    }
    
    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .sidebar::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.3);
        border-radius: 2px;
    }
    
/* Sidebar como overlay en móvil */
.sidebar {
    position: fixed;
    left: -260px; /* Oculto por defecto */
    top: 56px; /* Después del topbar */
    width: 260px;
    height: calc(100vh - 56px);
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto; /* ✅ PERMITIR SCROLL VERTICAL EN MÓVIL */
    
    /* Scrollbar discreta para móvil también */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.0) transparent;
}
    
    /* Sidebar visible cuando tiene la clase 'open' */
    .sidebar.open {
        left: 0;
    }
    
    /* Overlay para cerrar sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 56px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 56px);
        background: rgba(0,0,0,0.5);
        z-index: 99;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Main ocupa toda la pantalla */
    main#app {
        width: 100%;
        padding: 16px;
    }
    
    /* Botón hamburguesa funcional */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: white;
        border-radius: 8px;
        transition: background 0.2s ease;
    }
    
    .menu-toggle:hover {
        background: rgba(255,255,255,0.1);
    }
    
.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: white;
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 1px;
    transform-origin: center;
}

/* Asegurar que el contenedor del botón esté bien */
.menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: white;
    border-radius: 8px;
    transition: background 0.2s ease;
    padding: 8px;
}
    
    /* Animación del botón hamburguesa */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Desktop mantiene diseño actual */
@media (min-width: 901px) {
    .menu-toggle {
        display: none !important; /* Ocultar hamburguesa en desktop */
    }
    
    .topbar__status-text {
        display: none !important; /* Ocultar texto simple en desktop */
    }
}

/* =================================== */
/* CORRECCIONES ADICIONALES            */
/* =================================== */

/* Sidebar fijo en desktop 
@media (min-width: 901px) {
    .sidebar {
        position: fixed !important;
        top: 56px;
        left: 0;
        width: 260px;
        height: calc(100vh - 56px);
        overflow-y: auto;
        z-index: 10;
    }
    
    
    main#app {
        margin-left: 260px;
        width: calc(100% - 260px);
    }
    
   
    .layout {
        position: relative;
    }
}
*/

/* Mejoras generales al botón hamburguesa */
.menu-toggle span:first-child {
    margin-top: 0;
}

.menu-toggle span:last-child {
    margin-bottom: 0;
}

/* Mejorar las animaciones del hamburguesa */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* =================================== */
/* CORRECCIÓN SIDEBAR FIJO DESKTOP     */
/* =================================== */

/* Desktop: Layout y sidebar fijo */
@media (min-width: 901px) {
    /* Topbar fijo */
    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        height: 56px;
    }
    
    /* Layout con margen superior para el topbar fijo */
.layout {
    margin-top: 56px;
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 56px);
    position: relative;
}
    
/* Sidebar completamente fijo */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 260px;
    height: calc(100vh - 56px);
    overflow-y: auto; /* ✅ SIN SCROLL EN SIDEBAR */
    z-index: 50;
    background: #fff;
    border-right: 1px solid var(--border);
    
    /* Ocultar scrollbar del sidebar también */
    scrollbar-width:thin;
    scrollbar-color: rgba(0,0,0,0) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}
    

/* Main centrado y con fondo blanco */
main#app {
    margin-left: 20px;
    padding: 40px 60px;
    width: auto;
    background: #fff;
    min-height: calc(100vh - 56px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Removemos overflow-y y height fijo para permitir scroll natural */
}

/* Contenedor interno para el contenido */
main#app > * {
    width: 100%;
    max-width: 1000px; /* Ancho máximo del contenido */
}

/* Para pantallas muy anchas, agregar más margen lateral */
@media (min-width: 1600px) {
    main#app {
        padding: 40px 100px;
    }
    
    main#app > * {
        max-width: 1200px;
    }
}
    
    /* Contenedor de fondo blanco para toda el área de contenido */
    .layout::after {
        content: '';
        position: fixed;
        top: 56px;
        left: 260px;
        right: 0;
        bottom: 0;
        background: #fff;
        z-index: -1;
    }
    
    /* Asegurar que el body no tenga márgenes que interfieran */
    body:not(.login-page) {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        background: var(--bg);
    }
}

/* =================================== */
/* MEJORAS PARA LOGIN EN MÓVIL         */
/* =================================== */

@media (max-width: 900px) {
    /* Contenedor de login más grande en móvil */
    .login-container,
    .login-box,
    .auth-container {
        width: 95% !important;
        max-width: 400px !important;
        margin: 20px auto !important;
        padding: 30px 20px !important;
        min-height: auto !important;
    }
    
    /* Formulario de login más espacioso */
    .login-form,
    .auth-form {
        width: 100%;
    }
    
    /* Campos de input más grandes */
    .login-form input,
    .auth-form input {
        padding: 12px 16px !important;
        font-size: 16px !important; /* Evita zoom en iOS */
        min-height: 48px !important;
        margin-bottom: 16px !important;
    }
    
    /* Botones más grandes y táctiles */
    .login-form button,
    .auth-form button,
    .btn-login {
        padding: 12px 24px !important;
        font-size: 16px !important;
        min-height: 48px !important;
        width: 100% !important;
        margin-top: 16px !important;
    }
    
    /* Logo más grande en móvil */
    .login-logo,
    .auth-logo {
        max-width: 120px !important;
        margin-bottom: 24px !important;
    }
    
    /* Título más legible */
    .login-title,
    .auth-title {
        font-size: 24px !important;
        margin-bottom: 24px !important;
    }
}

/* Ocultar contadores y ayudas del asuntoen móvil */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .subject-counter {
        display: none !important;
    }
}

/* === MEJORAS DASHBOARD MÉTRICAS === */
.filters {
    display: flex; /* Usamos Flexbox para mejor adaptabilidad */
    flex-wrap: wrap; /* Permitimos que los elementos se muevan a la siguiente línea */
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
}
.filters .form-control {
    margin: 0;
    flex-grow: 1; /* Permite que los elementos crezcan para ocupar espacio */
    min-width: 150px; /* Ancho mínimo para cada filtro */
}
.filters .filter--q {
    flex-grow: 2; /* Damos más espacio al campo de búsqueda */
}
/* Agregar al final del archivo, después de la línea 900+ */

/* =================================== */
/* CHECKBOXES CON LABELS MEJORADOS      */
/* =================================== */

/* Contenedor del checkbox + label */
.form-control label {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre checkbox y texto */
    margin: 0;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.4;
}

/* Checkbox específico dentro de labels */
.form-control label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0; /* No se encoge */
    cursor: pointer;
}

/* Texto del label */
.form-control label input[type="checkbox"] + * {
    flex: 1;
    margin: 0;
}

/* Estado hover para mejorar UX */
.form-control label:hover {
    color: var(--green);
}

/* Estado checked para destacar */
.form-control label input[type="checkbox"]:checked + * {
    font-weight: 500;
    color: var(--green);
}

/* Asegurar que no interfiera con otros elementos */
.form-control label.day-label {
    /* Mantener el estilo específico de días de la semana */
    display: block;
    gap: unset;
}

/* Responsive: Ajustes para móvil */
@media (max-width: 768px) {
    .form-control label {
        gap: 6px;
        font-size: 14px;
    }
    
    .form-control label input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
}

/* ✅ NUEVO: Estilos para el Dashboard Inteligente */
.kpi--clickable {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi--clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.task-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    transition: background-color 0.2s;
}
.task-list li a:hover {
    background-color: #f1f5f9;
}
.task-list li a span {
    font-weight: 600;
    color: var(--green-600);
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
    transition: all 0.2s;
}
.quick-action-btn:hover {
    background-color: #fff;
    border-color: var(--green-500);
    color: var(--green-600);
}
.quick-action-btn i {
    width: 20px;
    text-align: center;
}

.system-health-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.system-health-list li {
    display: flex;
    align-items: center;
    gap: 16px;
}
.system-health-list li i {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.system-health-list li .icon--ok { color: #16a34a; background-color: #f0fdf4; }
.system-health-list li .icon--warn { color: #ca8a04; background-color: #fefce8; }
.system-health-list li .icon--danger { color: #dc2626; background-color: #fee2e2; }
.system-health-list li div {
    display: flex;
    flex-direction: column;
}
.system-health-list li strong {
    font-weight: 500;
    color: #1e293b;
}
.system-health-list li span {
    font-size: 0.875rem;
    color: #64748b;
}

/* ===== Pagination (Conversiones & Ventas) ===== */
.sales-pagination{
  margin-top:16px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  font-size:12px;
}
.sales-pager{
  display:flex;
  align-items:center;
  gap:4px;
  background:#f8fafc;
  padding:6px 10px;
  border:1px solid #e2e8f0;
  border-radius:12px;
}
.sales-pager__nav{
  background:#fff;
  border:1px solid #d1d5db;
  width:34px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  cursor:pointer;
  transition:.15s;
  color:#0f172a;
  font-size:14px;
}
.sales-pager__nav:hover:not(:disabled){
  background:#f1f5f9;
  border-color:#cbd5e1;
}
.sales-pager__nav:disabled{
  opacity:.4;
  cursor:not-allowed;
  background:#f9fafb;
}
.sales-pager__pages{
  display:flex;
  align-items:center;
  gap:4px;
}
.sales-pager__page{
  min-width:34px;
  height:32px;
  padding:0 10px;
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:8px;
  font-weight:500;
  cursor:pointer;
  transition:.15s;
  color:#0f172a;
}
.sales-pager__page:hover{
  background:#f1f5f9;
  border-color:#cbd5e1;
}
.sales-pager__page.is-active{
  background:var(--green, #16a34a);
  border-color:var(--green, #16a34a);
  color:#fff;
  box-shadow:0 0 0 1px rgba(255,255,255,.6) inset;
}
.sales-pager__gap{
  padding:0 6px;
  color:#64748b;
  user-select:none;
}
.sales-pager__info{
  color:#64748b;
  font-size:12px;
  padding:4px 0;
}

/* Dark hover contrast (opcional si se usa modo oscuro en el futuro) */
@media (hover:hover){
  .sales-pager__page.is-active:hover{
    filter:brightness(.95);
  }
}
/* ===== /Pagination ===== */