/* ============================================================================
   panel - estructura de la replica original (replicador-web-integral/panel/replica-test)
   re-pintada con la paleta de Vector GPS
   ============================================================================ */
:root{--paper:#ffffff;--ink:#26313d;--line:#bfcbd6;--muted:#f4f7f9;--soft:#f4f7f9;--gray1:#607080;--gray2:#bfcbd6;--gray3:#bfcbd6;--gray4:#cfd9e2}
*{box-sizing:border-box;border-radius:0}[hidden]{display:none!important}html,body{margin:0;min-width:320px;font:14px Roboto,Arial,sans-serif;color:var(--ink);background:var(--paper)}button,input{border:1px solid var(--line);background:var(--paper);color:inherit;font:inherit}button{cursor:pointer}button:hover{background:var(--soft)}button:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:2px solid #bfcbd6;outline-offset:1px}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.dashboard-grid{display:grid;grid-template-columns:repeat(auto-fit,420px);align-items:start;gap:20px 0;width:100%;min-height:2820px;padding:10px}.chart-card{position:relative;width:400px;height:450px;margin-left:22px;border:1px solid var(--line);background:var(--paper);overflow:hidden}.chart-card.expanded{width:820px;height:920px;grid-column:span 2}.chart-card>header{display:flex;align-items:center;justify-content:space-between;height:55px;padding:10px 16px}.chart-card h2{margin:0;font-size:20px;font-weight:500}.card-actions{display:flex;align-items:center}.card-actions button{display:grid;place-items:center;width:41px;height:38px;border:0;font-size:20px}.card-actions .configure{font-size:17px}.card-actions .graph-back{font-size:28px}.info{width:auto!important;height:auto!important;padding:0;border:0!important;font-size:0!important}.info::after{content:"i";display:grid;place-items:center;width:20px;height:20px;border:2px solid #bfcbd6;border-radius:50%;font-size:12px;font-style:normal;font-weight:bold}
.chart-view{height:calc(100% - 55px);padding:0 16px 16px}.legend{display:flex;justify-content:center;gap:14px;height:30px;font-size:12px}.legend-item{display:flex;align-items:center;gap:6px}.legend-swatch{width:38px;height:10px;border:1px solid var(--line)}.legend-item:nth-child(1) .legend-swatch{background:var(--gray1)}.legend-item:nth-child(2) .legend-swatch{background:var(--gray3)}.legend-item:nth-child(3) .legend-swatch{background:var(--gray4)}
.chart{position:relative;width:366px;height:calc(100% - 30px);margin:auto}.donut{position:relative;width:330px;height:330px;margin:0 auto;border-radius:50%;background:conic-gradient(var(--gray1) 0 var(--part),var(--gray3) var(--part) 100%)}.donut::after{content:"";position:absolute;inset:80px;border-radius:50%;background:var(--paper)}.donut button{position:absolute;z-index:2;border:0;background:transparent}.donut .segment-a{inset:0 50% 0 0}.donut .segment-b{inset:0 0 0 50%}.donut button:focus-visible{outline:3px solid #bfcbd6;outline-offset:-5px}
.bar-chart{display:flex;align-items:flex-end;justify-content:space-around;height:calc(100% - 30px);border-left:1px solid var(--line);border-bottom:1px solid var(--line);padding:15px 8px 30px;background-image:linear-gradient(to top,var(--muted) 1px,transparent 1px);background-size:100% 20%}.bar-item{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;width:8%;height:100%;border:0;background:transparent}.bar-item:hover{background:transparent}.bar{display:block;width:100%;min-width:18px;height:var(--height);border:1px solid var(--gray1);background:repeating-linear-gradient(45deg,var(--gray4),var(--gray4) 4px,var(--paper) 4px,var(--paper) 8px)}.bar-label{position:absolute;bottom:4px;font-size:11px;white-space:nowrap;transform:rotate(-20deg);transform-origin:center}.chart-card.expanded .chart{width:760px}.chart-card.expanded .donut{width:700px;height:700px}.chart-card.expanded .donut::after{inset:170px}.chart-card.expanded .bar-chart{height:760px}.chart-card.expanded .bar-label{transform:none}
.detail-view{height:calc(100% - 55px);padding:0 16px 16px}.detail-head{display:flex;align-items:center;gap:10px;height:34px}.detail-head h3{margin:0;font-size:15px}.detail-head button{width:34px;height:28px}.detail-search{width:100%;height:30px;margin:4px 0;padding:4px}.detail-table-wrap{height:calc(100% - 105px);overflow:auto;border:1px solid var(--line)}.detail-table{width:100%;border-collapse:collapse;font-size:12px}.detail-table th,.detail-table td{height:32px;border:1px solid var(--line);padding:5px;text-align:left}.detail-table th{position:sticky;top:0;background:var(--muted)}.detail-footer{display:flex;align-items:center;justify-content:space-between;height:34px}.detail-pager{display:flex;gap:2px}.detail-pager button{min-width:28px;height:26px}.detail-export{height:28px;padding:4px 12px}
#configDialog{width:500px;max-width:calc(100vw - 24px);min-height:276px;border:2px solid #bfcbd6;padding:0;background:var(--paper)}#configDialog::backdrop{background:rgba(0,0,0,.25)}#configDialog form>header{display:flex;align-items:center;justify-content:space-between;height:52px;padding:8px 14px;border-bottom:1px solid var(--line)}#configDialog h2{margin:0;font-size:18px}#configDialog header button{width:32px;height:32px;border:0;font-size:22px}#configDialog form{display:grid;grid-template-columns:120px 1fr;gap:16px;padding-bottom:14px}#configDialog form>header,#configDialog footer{grid-column:1/-1}#configDialog form>label{padding-left:26px;font-weight:bold}#configDialog input{width:180px;height:30px;padding:5px}#configDialog footer{display:flex;justify-content:flex-end;gap:8px;padding:20px 14px 0;border-top:1px solid var(--line)}#configDialog footer button{height:32px;padding:5px 12px}
.dashboard-grid{align-content:start;padding:12px 10px 8px}
@media(max-width:850px){.dashboard-grid{grid-template-columns:420px;min-height:2820px}.chart-card.expanded{width:820px;grid-column:span 1}}
@media(max-width:450px){.dashboard-grid{grid-template-columns:1fr;padding:6px}.chart-card,.chart-card.expanded{width:calc(100vw - 12px);height:450px;margin-left:0}.chart{width:100%}.donut{width:min(330px,90vw);height:min(330px,90vw)}.chart-card.expanded .chart{width:100%}.chart-card.expanded .donut{width:min(330px,90vw);height:min(330px,90vw)}.chart-card.expanded .donut::after{inset:80px}}

/* ============================================================================
   Capa Vector GPS (colores, bordes y estados) - no altera el layout original
   Referencia: GUIA_ESTILOS_UI.md
   ============================================================================ */
:root {
  --v-primary: #0f8995; --v-primary-border: #0d7d88; --v-primary-dark: #0a6670;
  --v-primary-tint: #e6f4f5; --v-primary-ring: rgba(15, 137, 149, .18);
  --v-danger: #dc3545; --v-danger-dark: #bd2130; --v-success: #28a745; --v-success-dark: #1e8a37;
  --v-text: #26313d; --v-title: #1f2a35; --v-muted: #607080; --v-label: #485664;
  --v-border: #cfd9e2; --v-input-border: #bfcbd6; --v-th-bg: #f4f7f9; --v-input-bg: #f9fbfc;
  --v-shadow-pop: 0 12px 24px rgba(26, 36, 44, .22);
}

html, body { font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif; color: var(--v-text); }
a { color: var(--v-primary); }
h1, h2, h3 { color: var(--v-title); }

button {
  border-color: var(--v-input-border);
  border-radius: 6px;
  background-color: #fff;
  color: var(--v-label);
  font-weight: 600;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
button:hover:not(:disabled) { color: var(--v-primary); border-color: var(--v-primary); background-color: var(--v-primary-tint); }
button:disabled { opacity: .5; color: #9aa6b2; background-color: #f4f7f9; border-color: #d8e0e6; cursor: not-allowed; }

button:is([id*="save" i],[id*="create" i],[id*="crear" i],[id*="guardar" i],[id*="accept" i],[id*="aceptar" i],[id*="apply" i],[id*="send" i],[id*="enviar" i],[id*="agregar" i],[id*="add" i],[id*="submit" i],[id*="filter" i]):not(:disabled) { color: #fff; background-color: var(--v-primary); border-color: var(--v-primary-border); }
button:is([id*="save" i],[id*="create" i],[id*="crear" i],[id*="guardar" i],[id*="accept" i],[id*="aceptar" i],[id*="apply" i],[id*="send" i],[id*="enviar" i],[id*="agregar" i],[id*="add" i],[id*="submit" i],[id*="filter" i]):hover:not(:disabled) { color: #fff; background-color: var(--v-primary-dark); border-color: var(--v-primary-dark); }

button:is([id*="edit" i],[id*="editar" i]):not(:disabled) { color: var(--v-primary); border-color: var(--v-primary); }

button:is([id*="delete" i],[id*="remove" i],[id*="borrar" i],[id*="eliminar" i]):not(:disabled) { color: var(--v-danger); border-color: #e3a0a8; background-color: #fff5f6; }
button:is([id*="delete" i],[id*="remove" i],[id*="borrar" i],[id*="eliminar" i]):hover:not(:disabled) { color: #fff; border-color: var(--v-danger); background-color: var(--v-danger); }

button:is([id*="excel" i],[id*="download" i],[id*="export" i],[id*="csv" i],[id*="descargar" i]):not(:disabled) { color: #fff; background-color: var(--v-success); border-color: var(--v-success); }
button:is([id*="excel" i],[id*="download" i],[id*="export" i],[id*="csv" i],[id*="descargar" i]):hover:not(:disabled) { color: #fff; background-color: var(--v-success-dark); border-color: var(--v-success-dark); }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible, [role="row"]:focus-visible {
  outline: 2px solid var(--v-primary);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea {
  border-color: var(--v-input-border);
  border-radius: 6px;
  background-color: var(--v-input-bg);
  color: var(--v-text);
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--v-primary); box-shadow: 0 0 0 3px var(--v-primary-ring); }
input:disabled, select:disabled, textarea:disabled { color: #8a97a4; background-color: #f1f4f6; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--v-primary); }

fieldset { border-color: var(--v-border); border-radius: 8px; }
legend { color: var(--v-primary); font-weight: 700; }

th, [role="columnheader"] { background-color: var(--v-th-bg); color: #536171; font-weight: 700; }

tr[aria-selected="true"], [role="row"][aria-selected="true"], [role="option"][aria-selected="true"], tr.selected, [role="row"].selected,
[class*="row"].selected, [class*="item"].selected, [class*="row"][aria-selected="true"], [class*="item"][aria-selected="true"] {
  background-color: var(--v-primary-tint);
  box-shadow: inset 4px 0 0 var(--v-primary);
  outline: none;
}
tbody tr:hover, [role="grid"] [role="row"]:hover { background-color: rgba(15, 137, 149, .07); }
tr[aria-selected="true"]:hover, tr.selected:hover, [role="row"][aria-selected="true"]:hover { background-color: var(--v-primary-tint); }

dialog {
  border: 1px solid var(--v-border);
  border-top: 4px solid var(--v-primary);
  border-radius: 8px;
  background: #fff;
  color: var(--v-text);
  box-shadow: var(--v-shadow-pop);
}
dialog:not([open]) { display: none !important; }
dialog::backdrop { background: rgba(26, 36, 44, .5); }

/* Botones dentro de encabezados de tabla: sin caja */
th button, [role="columnheader"] button { background-color: transparent; border-color: transparent; box-shadow: none; color: inherit; }
th button:hover:not(:disabled), [role="columnheader"] button:hover:not(:disabled) { background-color: rgba(15, 137, 149, .10); border-color: transparent; color: var(--v-primary); }
/* Estado activo / seleccionado en botones (pestañas, filtros, categorías) */
button[aria-pressed="true"]:not(:disabled), button[aria-selected="true"]:not(:disabled), button.active:not(:disabled), button.selected:not(:disabled) {
  color: var(--v-primary-dark); background-color: var(--v-primary-tint); border-color: var(--v-primary); box-shadow: none;
}

/* v2: dialogos al nivel de Alertas */
html, body { background: #eef2f5; }
/* Diálogos con encabezado */
dialog { padding: 0 0 14px !important; overflow: auto; }
dialog > :not(header):not(h1:first-child):not(h2:first-child) { margin-left: 16px; margin-right: 16px; }
dialog > header, dialog > h1:first-child, dialog > h2:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px !important;
  padding: 9px 14px !important;
  font: 700 13px/1.45 Roboto, Arial, sans-serif !important;
  color: #fff !important;
  background: #343a40 !important;
  border: 0 !important;
  border-bottom: 3px solid var(--v-primary) !important;
}
dialog > header h2, dialog > header h1 { margin: 0 !important; padding: 0 !important; font: 700 13px/1.45 Roboto, Arial, sans-serif !important; color: #fff !important; background: transparent !important; border: 0 !important; }
dialog > header button { min-height: 26px; padding: 0 9px; color: #fff; background: transparent; border-color: rgba(255, 255, 255, .4); }
dialog > header button:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, .16); border-color: #fff; }
dialog[id*="confirm" i] { border-top-color: var(--v-danger); }
dialog[id*="confirm" i] > h1:first-child, dialog[id*="confirm" i] > h2:first-child, dialog[id*="confirm" i] > header { border-bottom-color: var(--v-danger); }

/* v2: bandas de panel */
.detail-view > header, .detail-view > header h1, .detail-view > header h2, .detail-view > header span {
  color: #fff !important;
}
.detail-view > header {
  background: #343a40 !important;
  border-bottom: 3px solid var(--v-primary) !important;
  border-top: 0 !important;
}

/* v2: paleta de graficas y encabezados de tarjeta */
:root { --gray1: #0f8995; --gray3: #2196f3; --gray4: #8bc34a; }
.bar { background: var(--gray1) !important; border-color: #0d7d88 !important; }
.chart-card { background: #fff; border: 1px solid var(--v-border); border-radius: 8px; box-shadow: 0 3px 12px rgba(31, 45, 61, .06); overflow: hidden; }
.chart-card > header { height: auto; min-height: 44px; background: #343a40 !important; border-bottom: 3px solid var(--v-primary) !important; padding: 8px 14px; }
.chart-card > header h2 { color: #fff !important; font-size: 15px; font-weight: 700; }
.chart-card > header button { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .4); }
.chart-card > header button:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, .16); border-color: #fff; }
.donut button, .donut button:hover:not(:disabled), .bar-item, .bar-item:hover:not(:disabled) { background: transparent !important; border: 0 !important; border-radius: 0; box-shadow: none; }

/* v3: tablas a ancho completo del contenedor */
table { width: 100%; }