/* Medidas compartidas para las vistas autenticadas. La paleta permanece en
   las hojas de cada componente; aquí solo se define su geometría. */
body[data-role] .page,
body[data-role] .page.page-corporate,
body[data-role] #programadorApp {
    box-sizing:border-box;
    width:100%;
    max-width:var(--layout-max-width);
    margin-inline:auto;
    padding-inline:var(--layout-gutter);
    min-width:0;
}
html body.mon-cuenta-shell .page.page-corporate:has(#pvDashboard) { width:100%; max-width:var(--layout-max-width); margin-inline:auto; padding-inline:var(--layout-gutter); }
body[data-role] .page :is(.dash-stat-row,.corp-kpis,.tickets-kpis,.mon-admin-kpis,.pan-indicadores,.pv-kpi-grid) {
    gap:var(--layout-card-gap) !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
}
body[data-role] .page .cat-stats { gap:var(--layout-card-gap); grid-template-columns:repeat(3,minmax(0,1fr)); }
body[data-role] .page :is(.dash-stat,.corp-kpi,.ticket-kpi,.pv-kpi) {
    box-sizing:border-box;
    height:auto !important;
    min-height:var(--layout-kpi-min-height) !important;
    padding:var(--layout-card-padding) !important;
    border-radius:var(--layout-card-radius) !important;
}
body[data-role] .page .cat-stat { min-height:var(--layout-secondary-min-height); padding:var(--layout-card-padding); border-radius:var(--layout-card-radius); }
body[data-role] .page :is(.cat-group-card,.pv-card,.corp-table-card,.ticket-listing,.obs-tabla-wrap) { border-radius:var(--layout-card-radius); }
body[data-role] .page :is(.cat-stats,.tickets-kpis,.pv-kpi-grid) { margin-bottom:var(--layout-section-gap); }
/* Los indicadores antiguos posicionan las etiquetas de forma absoluta. Se
   reservan líneas en flujo para que las descripciones largas puedan crecer. */
body[data-role] .page :is(.dash-stat,.corp-kpi,.ticket-kpi) { padding-bottom:var(--layout-card-padding) !important; }
/* Tickets colocaba el icono fuera del flujo, por lo que la descripción
   comenzaba encima del número; conservarlo en flujo reserva su espacio. */
body.lista-page[data-role] .page .tickets-kpis .ticket-kpi .dash-stat-icon,
body[data-role] .page .rpt-kpis .dash-stat .dash-stat-icon,
body[data-role] .page :is(.mon-admin-kpis,.pan-indicadores) .dash-stat .dash-stat-icon {
    position:relative !important; top:0 !important; left:0 !important;
}
body[data-role] .page :is(.dash-stat,.corp-kpi,.ticket-kpi) :is(.dash-stat-label,.corp-kpi-label) {
    top:20px !important; left:90px !important; max-width:calc(100% - 110px) !important;
    white-space:normal !important; overflow:visible !important; line-height:1.2 !important;
}
body[data-role] .page :is(.dash-stat,.corp-kpi,.ticket-kpi) :is(.dash-stat-value,.corp-kpi-num) { top:48px !important; left:90px !important; font-size:30px !important; }
body.lista-page[data-role] .page .tickets-kpis .dash-stat-icon .dash-stat-value { top:28px !important; left:72px !important; }
body[data-role] .page .rpt-kpis .dash-stat-icon .dash-stat-value { top:28px !important; left:72px !important; font-size:clamp(22px,2vw,30px) !important; }
body[data-role] .page :is(.mon-admin-kpis,.pan-indicadores) .dash-stat-icon .dash-stat-value { top:28px !important; left:72px !important; }
body[data-role] .page :is(.dash-stat,.corp-kpi,.ticket-kpi) :is(.dash-stat-hint,.corp-kpi-hint) {
    position:relative !important; display:flex !important; align-items:flex-start; gap:7px; top:auto !important; bottom:auto !important; left:auto !important;
    margin-top:48px; max-width:calc(100% - 40px) !important; white-space:normal !important; overflow:visible !important; line-height:1.3 !important;
}
body[data-role] .page :is(.dash-stat,.corp-kpi,.ticket-kpi) :is(.dash-stat-spark,.ticket-kpi-spark,.mon-kpi-spark,.pan-kpi-spark,.rpt-kpi-spark) { top:88px !important; bottom:auto !important; height:20px !important; }
/* En punto de venta y monitoreo del observador las gráficas ya forman parte
   de una cuadrícula: se conserva ese flujo y se separa el texto inferior. */
body[data-role] .page :is(.pv-kpi,.obs-monitor-kpi) { height:auto; min-height:var(--layout-kpi-min-height); }
body[data-role] .page :is(.pv-kpi-bottom,.obs-monitor-kpi-foot) { min-width:0; margin-top:8px; }
body[data-role] .page :is(.pv-kpi-bottom,.obs-monitor-kpi-hint) { white-space:normal; overflow-wrap:anywhere; }
/* Punto de venta: misma jerarquía de icono, cifra, gráfica y detalle del panel administrador. */
body[data-role] .page #pvDashboard .pv-kpi { display:grid; grid-template-rows:auto auto 1fr; gap:8px; min-height:180px !important; overflow:visible; }
body[data-role] .page #pvDashboard .pv-kpi-top { display:grid; grid-template-columns:60px minmax(0,1fr); gap:14px; align-items:start; }
body[data-role] .page #pvDashboard .pv-kpi-icon { width:60px; height:60px; border-radius:18px; }
body[data-role] .page #pvDashboard .pv-kpi-icon .icon { width:28px; height:28px; }
body[data-role] .page #pvDashboard .pv-kpi-main { gap:0; min-width:0; }
body[data-role] .page #pvDashboard .pv-kpi-main b { font-size:13px; line-height:1.2; overflow-wrap:anywhere; }
body[data-role] .page #pvDashboard .pv-kpi-main strong { display:block; margin:22px 0 0 20px; font-size:30px; line-height:1; }
body[data-role] .page #pvDashboard .pv-spark { min-width:0; min-height:24px; margin:0; }
body[data-role] .page #pvDashboard .pv-spark svg { height:24px; }
body[data-role] .page #pvDashboard .pv-spark-empty { height:auto; min-height:24px; }
body[data-role] .page #pvDashboard .pv-kpi-bottom { align-self:end; min-width:0; margin:0; gap:7px; font-size:12px; line-height:1.3; }
body[data-role] .page #pvDashboard .pv-kpi-bottom i { flex:none; }
body[data-role] .page #pvDashboard .pv-kpi-bottom em { width:34px; height:34px; flex:none; }
/* Notificación: diálogo compacto sin truncar mensajes largos. */
body .notif-popup { box-sizing:border-box; width:min(400px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); padding:20px; border-radius:14px; }
body .notif-popup .notif-popup-head { margin-bottom:6px; }
body .notif-popup .notif-popup-icon { width:38px; height:38px; margin-bottom:6px; }
body .notif-popup .notif-popup-icon .icon { width:19px; height:19px; }
body .notif-popup .notif-popup-kicker { font-size:10px; }
body .notif-popup .notif-popup-title { font-size:15px; line-height:1.35; }
body .notif-popup .notif-popup-text { box-sizing:border-box; margin:8px 0; padding:9px 11px; font-size:12px; line-height:1.4; }
body .notif-popup .notif-popup-actor { margin:4px 0 10px; font-size:11px; }
body .notif-popup .notif-popup-actions { gap:8px; }
body .notif-popup .notif-popup-actions .btn { min-height:36px; flex:1 1 110px; padding:0 12px; font-size:12px; }
body .notif-popup .notif-popup-foot { margin-top:9px; font-size:10px; }
/* Los SVG se estiran con cada tarjeta: el trazo no debe estirarse con ellos. */
body[data-role] .page :is(.dash-stat-spark,.ticket-kpi-spark,.mon-kpi-spark,.pan-kpi-spark,.rpt-kpi-spark,.pv-spark,.obs-monitor-kpi-chart) svg { shape-rendering:geometricPrecision; }
body[data-role] .page :is(.dash-stat-spark,.ticket-kpi-spark,.mon-kpi-spark,.pan-kpi-spark,.rpt-kpi-spark,.pv-spark,.obs-monitor-kpi-chart) :is(.spark-line,.obs-kpi-line,polyline) {
    vector-effect:non-scaling-stroke; stroke-width:2px; stroke-linecap:round; stroke-linejoin:round;
}
body[data-role] .page .pv-spark path:not(.pv-spark-fill) { vector-effect:non-scaling-stroke; stroke-width:2px; stroke-linecap:round; stroke-linejoin:round; }
/* Las tablas anchas mantienen el desplazamiento en su contenedor, no en la página. */
body[data-role] .page :is(.ticket-table-wrap,.obs-tabla-wrap,.table-responsive) { max-width:100%; overflow-x:auto; }
@media (max-width:1199px) {
    :root { --layout-gutter:16px; }
    body[data-role] .page :is(.dash-stat-row,.corp-kpis,.tickets-kpis,.mon-admin-kpis,.pan-indicadores,.pv-kpi-grid) { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width:620px) {
    :root { --layout-gutter:12px; }
    body[data-role] .page :is(.dash-stat-row,.corp-kpis,.tickets-kpis,.mon-admin-kpis,.pan-indicadores,.pv-kpi-grid,.cat-stats) { grid-template-columns:minmax(0,1fr) !important; }
}
/* Detalle de los datos históricos de las minigráficas de reportes. */
.rpt-spark-tooltip { position:fixed; z-index:2000; padding:6px 9px; border:1px solid #cbd5e1; border-radius:7px; background:#fff; color:#1f2937; font:600 12px/1.3 sans-serif; box-shadow:0 4px 12px rgba(15,23,42,.18); pointer-events:none; white-space:nowrap; }
.rpt-spark-tooltip[hidden] { display:none; }
html[data-theme="dark"] .rpt-spark-tooltip { background:#202938; color:#f1f5f9; border-color:#536174; }
body[data-role] .page .rpt-kpi-spark:not(.is-empty) { pointer-events:auto; z-index:5; cursor:crosshair; }
body[data-role] .page .rpt-kpi-spark:focus-visible { outline:2px solid currentColor; outline-offset:3px; border-radius:3px; }
