/* Seguimiento: same sage palette, compact figures, readable actions and agenda. */
#tes-seguimiento { --seg-tint: var(--accent-bg, #edf2e4); min-width: 0; }
#tes-seguimiento .seg-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; margin:12px 0 24px; }
.seg-heading h3 { font-size:20px; font-weight:600; letter-spacing:-.3px; margin:0 0 6px; }
.seg-heading p { margin:0; font-size:13px; line-height:1.5; color:var(--text-secondary); }
#tes-seguimiento .seg-heading .btn { flex-shrink:0; font-size:13px; min-height:42px; box-shadow:none; }
#tes-seguimiento .tes-seg-badge { background:var(--accent-bg); color:var(--accent); font-size:12px; font-weight:600; }
#tes-seguimiento .seg-summary { display:grid; grid-template-columns:1.5fr 1fr 1fr 1fr; border-radius:16px; background:var(--seg-tint); padding:22px 8px; margin-bottom:26px; }
.seg-summary > div { padding:0 22px; min-width:0; }
.seg-summary > div+div { border-left:1px solid var(--accent-border,var(--border)); }
.seg-summary span { display:block; color:var(--text-secondary); font-size:12px; margin-bottom:8px; }
#tes-seguimiento .seg-summary strong { display:block; font-size:23px; font-weight:550; letter-spacing:-.4px; color:var(--text-primary); white-space:nowrap; font-variant-numeric:tabular-nums; }
#tes-seguimiento .seg-summary > div:first-child strong { color:var(--accent); }
#tes-seguimiento .seg-secciones { display:flex; align-items:center; gap:22px; border-bottom:1px solid var(--border); margin-bottom:24px; }
.seg-secciones button { font:inherit; font-size:14px; font-weight:500; background:none; color:var(--text-secondary); border:0; border-bottom:2px solid transparent; min-height:44px; padding:10px 0 13px; cursor:pointer; }
.seg-secciones button.active { color:var(--accent); border-color:var(--accent); }
.seg-secciones button:hover { color:var(--accent); }
.seg-secciones button span { font-size:12px; margin-left:6px; }
#seg-refresh { margin-left:auto; font-size:12px; }
#tes-seguimiento .seg-barra { display:flex; align-items:center; gap:16px; margin:0 0 16px; flex-wrap:wrap; }
#tes-seguimiento .seg-search-label { flex:1; min-width:200px; }
#tes-seguimiento .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
#tes-seguimiento .seg-search { width:100%; max-width:none; height:42px; margin:0; font-size:14px; }
#tes-seguimiento #seg-vista { display:flex; margin:0!important; padding:3px; gap:2px; background:var(--bg-hover); border-radius:11px; }
#tes-seguimiento #seg-vista .filter-btn { border:0; background:transparent; min-height:36px; padding:8px 13px; font-size:13px; box-shadow:none; }
#tes-seguimiento #seg-vista .filter-btn.active { background:var(--bg-card); color:var(--accent); }
.seg-order-label { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-secondary); }
#seg-orden { height:42px; min-width:170px; border:1px solid var(--border); border-radius:10px; padding:8px 30px 8px 10px; color:var(--text-primary); background-color:var(--bg-card); font:inherit; font-size:13px; }
#tes-seguimiento .seg-filtros-row { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin:0 0 18px; }
#tes-seguimiento #seg-filtro { margin:0!important; gap:8px; flex-wrap:wrap; }
#tes-seguimiento #seg-filtro .filter-btn { font-size:12px; font-weight:500; min-height:34px; padding:7px 11px; border-radius:8px; box-shadow:none; }
#seg-resultados { font-size:12px; color:var(--text-secondary); font-variant-numeric:tabular-nums; }
#tes-seguimiento #tabla-seg { font-size:13px; }
#tes-seguimiento #tabla-seg th { background:var(--bg-hover); color:var(--text-secondary); font-size:12px; font-weight:500; padding:13px 16px; white-space:nowrap; }
#tes-seguimiento #tabla-seg td { padding:19px 16px; vertical-align:middle; white-space:normal; }
#tes-seguimiento #tabla-seg td:first-child { min-width:205px; max-width:320px; }
#tes-seguimiento #tabla-seg td:first-child strong { white-space:normal; overflow-wrap:anywhere; }
#tes-seguimiento #tabla-seg strong { font-weight:550; }
#tes-seguimiento #tabla-seg .seg-money { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
#tes-seguimiento .seg-sub { font-size:11.5px; line-height:1.5; margin-top:4px; }
.seg-contact-line { max-width:300px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.seg-due { color:var(--warning,#885820); font-size:12px; }
.seg-next { color:var(--accent); font-size:12px; white-space:nowrap; }
#tes-seguimiento .seg-btn, #modal-seg-reglas .seg-btn { min-height:36px; padding:8px 11px; font-size:12px; font-weight:500; border-radius:9px; box-shadow:none; }
#tes-seguimiento .seg-btn span, #modal-seg-reglas .seg-btn span { display:inline; }
#tes-seguimiento .seg-btn-main { background:var(--seg-tint); color:var(--accent); border-color:transparent; }
#tes-seguimiento .seg-acc { gap:7px; flex-wrap:nowrap; }
.seg-section-intro { margin:0 0 18px; }
.seg-section-intro h4, .seg-rule-create h4 { margin:0 0 7px; font-size:16px; font-weight:600; }
.seg-section-intro p, .seg-note { margin:0; color:var(--text-secondary); font-size:12px; line-height:1.65; }
#tes-seguimiento .seg-note { margin-top:18px; }
#tes-seguimiento .seg-item { gap:20px; padding:20px 0; border-bottom:1px solid var(--border); }
#tes-seguimiento .seg-item-cuerpo b { font-size:14px; font-weight:550; }
#tes-seguimiento .seg-item-cuerpo small { margin-top:5px; font-size:12px; white-space:normal; overflow-wrap:anywhere; }
.seg-agenda-date { display:flex; gap:8px; align-items:center; font-size:12px; color:var(--accent); font-variant-numeric:tabular-nums; }
.seg-agenda-date b { font-weight:500; white-space:nowrap; }
.seg-status { flex-shrink:0; font-size:11px; color:var(--accent); background:var(--accent-bg); padding:5px 9px; border-radius:7px; }
.seg-status.error { color:var(--danger); background:var(--danger-bg,var(--bg-hover)); }
#tes-seguimiento .seg-vacio { padding:32px 0; color:var(--text-secondary); }
.seg-load-state { padding:12px 0; color:var(--text-secondary); font-size:13px; }
#modal-seg-reglas .modal-content { width:820px; }
#modal-seg-reglas .modal-header h3, #modal-seg .modal-header h3 { font-size:23px; letter-spacing:-.4px; }
#modal-seg-reglas .asi-subtit, #modal-seg .asi-subtit { font-size:13px; max-width:62ch; }
#modal-seg-reglas .seg-reglas-lista { gap:12px; }
#modal-seg-reglas .seg-regla { border:1px solid var(--border); border-radius:12px; background:var(--bg-card); }
#modal-seg-reglas .seg-regla.on { background:var(--accent-bg); border-color:var(--accent-border); }
#modal-seg-reglas .seg-regla-fila { padding:17px 16px; gap:14px; }
#modal-seg-reglas .seg-regla-cuerpo b { font-weight:550; font-size:14px; }
#modal-seg-reglas .seg-regla-cuerpo small { margin-top:6px; font-size:11.5px; }
#modal-seg-reglas .seg-regla-editor { padding:18px; background:var(--bg-card); gap:14px; border-top:1px solid var(--border); }
#modal-seg-reglas .seg-rule-fields { display:grid; grid-template-columns:2fr 1fr 1.5fr; gap:12px; }
#modal-seg-reglas .seg-rule-fields select { height:40px; border:1px solid var(--border); border-radius:8px; padding:8px; background-color:var(--bg-card); color:var(--text-primary); font:inherit; }
#modal-seg-reglas input:not([type=checkbox]), #modal-seg-reglas select { min-height:40px; min-width:0; }
.seg-help { font-size:12px; color:var(--text-secondary); margin:18px 0 26px; }
.seg-help summary { cursor:pointer; }
.seg-help p { line-height:1.7; }
.seg-rule-create { border-top:1px solid var(--border); padding-top:24px; margin-top:20px; }
#modal-seg-reglas .seg-regla-nueva { display:grid; grid-template-columns:1fr 2fr .7fr 1.2fr; gap:12px; margin:16px 0 28px; }
#modal-seg-reglas .seg-regla-nueva label { display:flex; flex-direction:column; align-items:stretch; gap:7px; font-size:12px; color:var(--text-secondary); }
#modal-seg-reglas .seg-regla-nueva input[type=number] { width:100%; }
#seg-r-resumen { grid-column:1 / -1; }
#modal-seg-reglas .seg-regla-nueva > button { justify-self:start; grid-column:1 / -1; box-shadow:none; font-size:13px; }
#modal-seg-reglas .af-seccion, #modal-seg .af-seccion { font-size:14px; font-weight:550; letter-spacing:0; text-transform:none; }
#modal-seg-reglas .seg-item { padding:14px 0; }
#modal-seg-reglas .seg-item small { white-space:normal; }
#modal-seg-reglas .seg-previa { white-space:pre-wrap; line-height:1.6; overflow-wrap:anywhere; }
#modal-seg .seg-send-summary { padding:14px 16px; border-radius:10px; background:var(--accent-bg); color:var(--accent); font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
#modal-seg :is(input,textarea,button) { box-shadow:none; }
#modal-seg .form-actions { gap:10px; }
#modal-seg .seg-cuando { padding:12px 0; }
#modal-seg .seg-canal { font-weight:500; }
#modal-seg .seg-repetir { flex-wrap:wrap; }
#modal-seg-reglas .seg-switch input:focus-visible + span { outline:2px solid var(--accent); outline-offset:4px; }
:is(#tes-seguimiento,#modal-seg-reglas,#modal-seg) button { transition:transform 160ms cubic-bezier(.23,1,.32,1); }
:is(#tes-seguimiento,#modal-seg-reglas,#modal-seg) button:active:not(:disabled):not(:focus-visible) { transform:scale(.98); }
:is(#tes-seguimiento,#modal-seg-reglas,#modal-seg) button:disabled { cursor:not-allowed; }
:is(#tes-seguimiento,#modal-seg-reglas,#modal-seg) :is(button,input,select,textarea):focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media(max-width:1200px) {
  #tes-seguimiento .seg-summary { grid-template-columns:repeat(2,minmax(0,1fr)); row-gap:22px; }
  .seg-summary > div:nth-child(3) { border-left:0; }
  #tes-seguimiento .seg-acc { flex-wrap:wrap; }
}
@media(max-width:680px) {
  #tes-seguimiento .seg-btn, #tes-seguimiento #seg-filtro .filter-btn, #modal-seg-reglas .seg-btn, #modal-seg-reglas .btn-icon, #modal-seg .seg-radio { min-height:44px; }
  #tes-seguimiento .seg-heading { align-items:flex-start; flex-direction:column; gap:14px; }
  #tes-seguimiento .seg-summary { padding:18px 0; gap:20px 0; }
  .seg-summary > div { padding:0 14px; }
  #tes-seguimiento .seg-summary strong { font-size:18px; letter-spacing:-.25px; }
  #tes-seguimiento .seg-summary span { font-size:11px; }
  #tes-seguimiento .seg-secciones { gap:16px; overflow:auto; }
  .seg-secciones button { font-size:13px; flex-shrink:0; }
  #tes-seguimiento .seg-barra { flex-direction:row; }
  #tes-seguimiento .seg-search-label { flex-basis:100%; }
  #tes-seguimiento .seg-order-label { flex:1; flex-wrap:wrap; gap:5px; }
  #tes-seguimiento .seg-order-label select { min-width:150px; width:100%; }
  #tes-seguimiento .seg-filtros-row { align-items:flex-start; }
  #tes-seguimiento #seg-filtro { flex-wrap:wrap; overflow:visible; }
  #tes-seguimiento .seg-item { flex-wrap:wrap; gap:12px; }
  #tes-seguimiento .seg-agenda-date { flex-basis:100%; }
  #tes-seguimiento .table-container { overflow-x:auto; }
  #tes-seguimiento #tabla-seg { min-width:790px; }
  #modal-seg-reglas .seg-regla-fila { flex-wrap:wrap; gap:10px; }
  #modal-seg-reglas .seg-regla-cuerpo { flex-basis:calc(100% - 60px); }
  #modal-seg-reglas .seg-regla-nueva { grid-template-columns:1fr 1fr; }
  #modal-seg-reglas .seg-rule-fields { grid-template-columns:1fr 1fr; }
  #modal-seg-reglas .seg-rule-fields label:first-child { grid-column:1/-1; }
  #modal-seg .seg-cuando { gap:12px; }
  #seg-m-fecha { width:100%; }
}
@media(prefers-reduced-motion:reduce) {
  :is(#tes-seguimiento,#modal-seg-reglas,#modal-seg) button { transition:none; }
  :is(#tes-seguimiento,#modal-seg-reglas,#modal-seg) button:active:not(:disabled):not(:focus-visible) { transform:none; }
  #modal-seg-reglas .seg-switch span, #modal-seg-reglas .seg-switch span::after { transition:none; }
}
