:root{--t:#42b7b5;--d:#123b5d;--b:#1686b0;--ink:#24384b;--mut:#718096;--line:#dce6eb}*{box-sizing:border-box}
.services-dashboard{background:#fff;color:var(--ink);font:14px 'Segoe UI',Arial}
.services-dashboard header{background:#fff;padding:22px 28px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap}
.services-dashboard h1{margin:0;color:var(--d);font-size:25px}
header p{color:var(--mut);margin:7px 0}.tag{background:#e8f7f6;color:#168c90;padding:10px;border-radius:12px;font-weight:bold}
.services-dashboard main{max-width:1500px;margin:auto;padding:20px}
.filters,.metrics,.grid{display:grid;gap:14px}.filters{grid-template-columns:1.2fr 1fr 1fr}
.panel,.metric{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:0 3px 12px #163b5d08}
.panel h3{margin:0 0 12px;color:var(--d);font-size:15px}.buttons{display:flex;flex-wrap:wrap;gap:7px}
.services-dashboard button,.services-dashboard select,.services-dashboard input{font:inherit;border:1px solid #cbdbe3;background:#fff;color:var(--d);padding:9px 12px;border-radius:9px;cursor:pointer}
.services-dashboard button.active,.services-dashboard button:hover{background:var(--t);color:white;border-color:var(--t)}select{width:100%}.metrics{grid-template-columns:repeat(4,1fr);margin:15px 0}.label{font-size:12px;color:var(--mut);font-weight:600}.value{font-size:26px;font-weight:800;color:var(--d);margin-top:8px}.metric small,.note{color:var(--mut)}.grid{grid-template-columns:1.65fr .75fr;margin-bottom:15px}.wide{grid-column:1/-1}.chart{height:300px;position:relative}.donut-chart{height:240px;max-width:100%;margin:0 auto}canvas{width:100%;height:100%}.trend-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px;margin:10px 0}.trend-legend-item{display:flex;align-items:flex-start;gap:7px;font-size:11px;color:#36516a;overflow-wrap:anywhere}.trend-legend-swatch{display:inline-block;flex:0 0 18px;height:3px;margin-top:6px;border-radius:2px}@media(max-width:750px){.trend-legend{grid-template-columns:1fr}}.pareto-tooltip{display:none;position:absolute;z-index:20;pointer-events:none;background:#123b5d;color:#fff;padding:9px 12px;border-radius:8px;font-size:12px;line-height:1.45;max-width:340px;box-shadow:0 5px 16px #123b5d35}.pareto-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 16px;margin:12px 0}.pareto-legend-item{display:flex;gap:8px;align-items:flex-start;font-size:12px;line-height:1.35;color:#52687a}.pareto-legend-num{flex:0 0 23px;background:#e8f7f6;color:#123b5d;border-radius:5px;text-align:center;font-weight:700;padding:3px 0}.pareto-legend-name{overflow-wrap:anywhere}.pareto-chart-scroll{height:500px;overflow-x:auto;overflow-y:hidden;position:relative}.pareto-chart-scroll canvas{height:470px!important;display:block}@media(max-width:750px){.pareto-legend{grid-template-columns:1fr}}.legend{display:flex;gap:12px;flex-wrap:wrap;color:var(--mut);font-size:12px}.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px}.tablewrap{overflow:auto;max-height:420px}table{border-collapse:collapse;width:100%;min-width:650px}th,td{padding:11px 10px;border-bottom:1px solid #edf1f4;text-align:left;font-size:13px}th{background:#f0f7f8;color:var(--d);position:sticky;top:0}td.num,th.num{text-align:right}tbody tr:hover{background:#f7fbfc}.note{font-size:12px;margin-top:10px}.topline{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.topline select{width:auto;min-width:150px}@media(max-width:900px){.filters,.grid{grid-template-columns:1fr}.metrics{grid-template-columns:repeat(2,1fr)}}@media(max-width:520px){.services-dashboard main{padding:10px}.metrics{grid-template-columns:1fr 1fr}.value{font-size:21px}}

/* Integración visual RedSalva */
.main-content .services-dashboard{max-width:100%;margin:0 auto;padding:0}
.services-dashboard header{margin:0 0 14px;border-radius:12px}
.services-dashboard main{padding:0}
.services-dashboard .filters{margin-bottom:12px}
.services-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;margin:0 0 14px;background:#fff;border:1px solid #dce6f2;border-radius:12px;color:#718096;font-size:11px}
.services-action-buttons{display:flex;gap:8px;flex-wrap:wrap}
.services-action-buttons button{height:38px;padding:0 14px;border-radius:8px;font:600 11px 'Poppins',sans-serif;display:inline-flex;align-items:center;gap:7px;cursor:pointer}
.services-action-buttons svg{width:14px;height:14px}
.action-primary{border:1px solid #58b9b5;background:#58b9b5;color:#fff}
.action-outline{border:1px solid #58b9b5;background:#fff;color:#287f89}
.services-status,.services-error{padding:9px 13px;margin-bottom:12px;border-radius:8px;font-size:11px}
.services-status{background:#eef8f8;color:#287f89}
.services-error{background:#fff0f0;color:#a33}
.services-dashboard .filters .panel{box-shadow:0 2px 9px rgba(25,50,80,.04)}
.services-dashboard .panel{box-shadow:0 2px 9px rgba(25,50,80,.04)}
@media(max-width:700px){.services-actions{align-items:flex-start;flex-direction:column}.services-action-buttons{width:100%}.services-action-buttons button{flex:1;justify-content:center}}

/* Estilos integrados en la página para conservar el dashboard de referencia. */


/* Ajuste visual: tendencia mensual más compacta */
.services-dashboard .trend-chart{
    height:245px;
    min-height:245px;
}
@media(max-width:750px){
    .services-dashboard .trend-chart{
        height:220px;
        min-height:220px;
    }
}


/* Pareto: leyenda opcional y porcentajes acumulados legibles */
.pareto-legend-controls{
    display:flex;
    justify-content:flex-end;
    margin:10px 0 8px;
}
.pareto-legend-toggle{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:7px 13px;
    border:1px solid #cfe2e6;
    border-radius:8px;
    background:#f7fbfc;
    color:#287f89;
    font:600 11px 'Poppins',sans-serif;
    cursor:pointer;
    transition:background .15s,border-color .15s;
}
.pareto-legend-toggle:hover{
    background:#eaf7f7;
    border-color:#58b9b5;
}
.pareto-legend[hidden]{display:none!important}
.pareto-legend:not([hidden]){
    margin-top:8px;
}


/* Ajustes compactos de filtros y acciones del módulo */
.services-dashboard .filters{
    grid-template-columns:minmax(0,1.18fr) minmax(220px,.88fr) minmax(220px,.88fr);
    align-items:stretch;
    gap:12px;
}
.services-dashboard .filters .panel{
    min-width:0;
    padding:14px 16px;
}
.services-dashboard .filters .buttons{
    gap:6px;
}
.services-dashboard .filters .buttons button{
    padding:7px 10px;
    min-height:34px;
    font-size:12px;
    white-space:nowrap;
}
.services-dashboard .filters select{
    width:100%;
    height:38px;
    padding:7px 10px;
    font-size:12px;
}
.services-dashboard .filters .note{
    margin-top:8px;
    font-size:11px;
}

/* Acciones en una sola línea; Consultar conserva el protagonismo turquesa. */
.services-dashboard .services-actions{
    flex-wrap:nowrap;
    min-width:0;
}
.services-dashboard .services-action-buttons{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    white-space:nowrap;
}
.services-dashboard .services-action-buttons button{
    flex:0 0 auto;
    white-space:nowrap;
}
.services-dashboard .services-action-buttons .action-primary{
    background:#58b9b5;
    border:1px solid #58b9b5;
    color:#fff;
}
.services-dashboard .services-action-buttons .action-primary:hover{
    background:#369f9d;
    border-color:#369f9d;
    color:#fff;
}
.services-dashboard .services-action-buttons .action-outline{
    background:#fff;
    border:1px solid #58b9b5;
    color:#287f89;
}
.services-dashboard .services-action-buttons .action-outline:hover{
    background:#eef9f8;
    border-color:#369f9d;
    color:#176f73;
}

@media(max-width:1050px){
    .services-dashboard .filters{
        grid-template-columns:minmax(0,1.1fr) minmax(190px,.9fr) minmax(190px,.9fr);
    }
}
@media(max-width:800px){
    .services-dashboard .filters{
        grid-template-columns:1fr 1fr;
    }
    .services-dashboard .filters .panel:first-child{
        grid-column:1/-1;
    }
    .services-dashboard .services-actions{
        align-items:flex-start;
        flex-direction:column;
    }
    .services-dashboard .services-action-buttons{
        width:100%;
        flex-wrap:wrap;
    }
}
@media(max-width:520px){
    .services-dashboard .filters{
        grid-template-columns:1fr;
    }
    .services-dashboard .filters .panel:first-child{
        grid-column:auto;
    }
    .services-dashboard .services-action-buttons button{
        flex:1 1 auto;
        justify-content:center;
    }
}


/* =========================================================
   ANCHO UNIFICADO CON EL REPORTE DE VENTAS POR DIA Y HORA
   El dashboard utiliza todo el ancho disponible del main-content.
   ========================================================= */
.main-content.services-page{
    padding:24px 26px!important;
    width:auto;
    max-width:none;
}
.main-content.services-page .services-dashboard{
    width:100%;
    max-width:none;
    margin:0;
}
.main-content.services-page .services-dashboard header{
    padding:0 0 18px;
    margin:0 0 14px;
    border:0;
    border-radius:0;
}
.main-content.services-page .services-dashboard main{
    width:100%;
    max-width:none;
    margin:0;
    padding:0;
}
@media(max-width:600px){
    .main-content.services-page{
        padding:20px 14px!important;
    }
}

/* Control de leyenda Pareto: visible como opción, lista oculta al cargar */
.pareto-legend-toggle:focus-visible{
    outline:2px solid #1686b0;
    outline-offset:2px;
}
