/* F02 Búsqueda de electores, Elector 360 and Agregar evento (V360-HTML-02A).
   Scoped to voter-specific classes and the shared modal, so F01 styles in
   dashboard.css and base.css are not changed by this feature. */

.voter-toolbar{display:grid;grid-template-columns:minmax(220px,2fr) minmax(140px,1fr) minmax(140px,1fr) auto auto;gap:12px;align-items:end;margin:0 0 16px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:var(--radius-card);}
.voter-toolbar .button{height:48px;}
.voter-notice{margin:0 0 16px;}
.text-button{padding:0;color:var(--navy-950);background:none;border:0;font:600 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;text-decoration:underline;text-underline-offset:3px;text-align:left;cursor:pointer;}
.crumbs{margin:-18px 0 0;font:400 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.crumbs ol{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none;}
.crumbs li + li::before{content:"/";margin-right:6px;color:var(--muted);}
.crumbs a{color:var(--navy-950);}
.crumbs [aria-current="page"]{color:var(--ink);}
.main-content{scroll-margin-top:var(--topbar);}
/* Preserve F02's inset seven-column table without touching F01's table. */
.voter-table{width:calc(100% - 32px);margin:0 16px 16px;table-layout:fixed;}
.voter-table th,.voter-table td{padding:12px 0;overflow-wrap:anywhere;}
.voter-table th:nth-child(1){width:12%;}.voter-table th:nth-child(2){width:18%;}
.voter-table th:nth-child(3){width:11%;}.voter-table th:nth-child(4){width:9%;}
.voter-table th:nth-child(5){width:8%;}.voter-table th:nth-child(6){width:14%;}
.voter-table th:nth-child(7){width:28%;}
.table-card:has(.voter-table) .table-card__head{padding:16px 18px 12px;border-bottom:0;}
.voter-table tbody tr:nth-child(even){background:var(--surface-subtle);}
.metrics-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:4px;}
.profile-grid{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:16px;align-items:start;}
.profile-main__head{display:grid;gap:4px;margin-bottom:12px;}
.profile-main__head p{margin:0;}
.tabs{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:22px;padding-bottom:10px;border-bottom:1px solid var(--line);}
.tab{min-height:44px;min-width:140px;padding:10px 14px;color:var(--navy-950);background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);font:500 14px/18px Inter,ui-sans-serif,system-ui,sans-serif;}
.tab[aria-selected="true"]{color:#fff;background:var(--navy-950);border-color:var(--navy-950);}
.tab-panel{min-height:120px;}
.event-list,.household-list{display:grid;gap:12px;margin:0;padding:0;list-style:none;}
.event-item{padding:12px 0;border-bottom:1px solid var(--line);display:grid;gap:4px;}
.event-item:last-child{border-bottom:0;}
.timeline-list{display:grid;margin:0;padding:0;list-style:none;}
.timeline-list li{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);gap:16px;padding:0 0 54px;}
.timeline-list li:not(:last-child)::before{content:"";position:absolute;left:13px;top:28px;bottom:0;width:1px;background:var(--navy-950);}
.timeline-marker{width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:var(--navy-950);border:1px solid var(--navy-950);color:#fff;font:600 11px/16px Inter,ui-sans-serif,system-ui,sans-serif;}
.timeline-copy{display:grid;gap:6px;min-width:0;}
.timeline-copy time{margin-top:12px;}
.timeline-list li:last-child{padding-bottom:8px;}
.timeline-copy p,.event-note{margin:0;color:var(--muted);font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;}
.timeline-copy time{font:500 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.event-item__head{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;}
.event-item__head span{font:400 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.profile-notice{margin:0 0 12px;padding:10px 12px;color:var(--green);background:var(--green-bg);border-radius:var(--radius-md);font:500 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
.household-card{display:grid;gap:10px;align-content:start;}
.household-card h2{margin:0;}
.household-card p{margin:0;}
.household-list li{display:grid;gap:2px;padding:10px 0;border-top:1px solid var(--line);}
.household-list span{font:400 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}

.modal{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--line);border-radius:var(--radius-card);background:#fff;color:var(--ink);box-shadow:var(--shadow);overflow:hidden;}
.modal::backdrop{background:rgba(20,36,75,.55);}
.modal > form,.modal > div{display:flex;flex-direction:column;max-height:calc(100dvh - 32px);}
.modal__head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid var(--line);}
.modal__head h2{font:600 24px/30px Inter,ui-sans-serif,system-ui,sans-serif;}
.modal__close{width:44px;height:44px;flex:none;color:var(--ink);background:transparent;border:1px solid var(--line);border-radius:var(--radius-md);}
.modal__body{display:grid;gap:10px;padding:14px 18px;overflow-y:auto;min-height:0;}
.modal__actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;padding:10px 18px;border-top:1px solid var(--line);}
.modal__body + .modal__actions{flex:none;}
.modal .field{gap:4px;}
.modal .field select,.modal .field input{min-height:40px;padding:6px 12px;}
.form-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;}
.event-form__elector{margin:0;}
.field-error{margin:0;color:var(--danger);font:500 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;}
.field-hint{font:400 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.field textarea{width:100%;height:80px;min-height:80px;padding:8px 12px;color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);font:400 15px/22px Inter,ui-sans-serif,system-ui,sans-serif;resize:vertical;}
.field select[aria-invalid="true"],.field input[aria-invalid="true"],.field textarea[aria-invalid="true"]{border-color:var(--danger);}
.form-errors{padding:12px 14px;color:var(--danger);background:var(--danger-bg);border:1px solid var(--danger);border-radius:var(--radius-md);display:grid;gap:6px;}
.form-errors ul{margin:0;padding-left:18px;}
.form-errors .text-button{color:var(--danger);}
.discard-choice{display:grid;gap:10px;padding:12px 14px;background:var(--surface-accent);border:1px solid var(--line);border-radius:var(--radius-md);}
.discard-choice p{margin:0;}
.discard-choice .modal__actions{padding:0;border:0;}
.modal__body .discard-choice[hidden]{display:none;}

@media (max-width:1180px){
  .voter-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));}
  .voter-toolbar .button{width:100%;}
  .metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .profile-grid{grid-template-columns:minmax(0,1fr);}
}
@media (max-width:720px){
  .form-row{grid-template-columns:minmax(0,1fr);}
  .modal{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);}
  .modal > form,.modal > div{max-height:calc(100dvh - 24px);}
}
@media (max-width:420px){
  .voter-toolbar{grid-template-columns:minmax(0,1fr);}
  .metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .metrics-grid .metric-card{min-height:0;padding:12px;}
  .metrics-grid .metric-card__value{font-size:20px;line-height:26px;}
}

/* The profile's action group follows its source two-row badge/button rhythm. */
.main-content:has(.profile-grid) .page-actions{display:grid;grid-template-columns:112px 214px;gap:8px 12px;max-width:338px;}
.main-content:has(.profile-grid) .page-actions > .status{grid-column:1/-1;justify-self:start;margin-left:80px;}
.main-content:has(.profile-grid) .page-actions > .button:last-child{min-width:214px;}
.main-content:has(.profile-grid) .page-head{position:relative;}
.main-content:has(.profile-grid) .page-actions{position:absolute;right:0;top:4px;}
@media (max-width:1180px){.main-content:has(.profile-grid) .page-head{height:auto;margin-bottom:16px;}.main-content:has(.profile-grid) .page-actions{position:static;display:flex;max-width:none;justify-content:flex-start;}.main-content:has(.profile-grid) .page-actions > .status{margin:0;}.main-content:has(.profile-grid) .page-actions > .button:last-child{min-width:0;}}
@media (max-width:720px){.voter-table{width:100%;margin:0;table-layout:auto;}.voter-table td{padding:6px 0;}.tab{min-width:0;}.timeline-list li{padding-bottom:28px;}}

/* V360-EXT-02B.1 extended Search (territory and order band, result pager). Scoped to these classes only; the legacy
   toolbar, the shared seven-column table, the profile and the event dialog keep their rules above. */
.voter-search-toolbar{scroll-margin-top:calc(var(--topbar) + 16px);}
.voter-search-band{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:end;padding-top:12px;border-top:1px solid var(--line);}
.voter-search-band select{min-height:48px;}
.voter-pager{display:grid;gap:10px;padding:14px 18px 16px;border-top:1px solid var(--line);scroll-margin-top:calc(var(--topbar) + 16px);}
.voter-pager p{margin:0;}
.voter-pager__range{font:600 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-pager__source{font:400 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.voter-pager__controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 12px;}
.voter-pager__size{min-width:200px;}
.voter-pager__size select{min-height:48px;}
.voter-pager__controls .button{min-height:48px;}
.voter-pager__page{min-height:48px;display:inline-flex;align-items:center;font:500 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
@media (max-width:1180px){.voter-search-band{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:720px){.voter-search-band{grid-template-columns:minmax(0,1fr);}.voter-pager{padding:12px 14px 14px;}}
@media (max-width:420px){.voter-pager__controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);}.voter-pager__size{grid-column:1/-1;min-width:0;}.voter-pager__page{grid-column:1/-1;justify-content:center;}.voter-pager__controls .button{width:100%;}}
/* Search recovery notice: a sentence, not a status pill. It wraps inside the card width and keeps every applicable message.
 * Scoped by id, because .voter-notice and .status are shared with other screens. */
#voter-search-notice{display:block;width:100%;min-width:0;box-sizing:border-box;height:auto;min-height:0;padding:10px 14px;border-radius:var(--radius-card);white-space:normal;overflow-wrap:break-word;font:500 13px/20px Inter,ui-sans-serif,system-ui,sans-serif;}
/* V360-EXT-02B.2 Expediente vinculado: read-only linked records below the profile grid. Every rule is namespaced under .voter-related. */
.voter-related{display:grid;gap:14px;margin-top:16px;padding:18px;background:#fff;border:1px solid var(--line);border-radius:var(--radius-card);min-width:0;}
.voter-related p{margin:0;}
.voter-related__head{display:grid;gap:6px;}
.voter-related__head h2{margin:0;font:600 20px/28px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-related__groups{display:grid;gap:10px;min-width:0;}
.voter-related__group{min-width:0;background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);}
.voter-related__group[open]{background:var(--surface-accent);}
.voter-related__summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;min-height:44px;padding:10px 14px;cursor:pointer;list-style:none;color:var(--ink);font:600 15px/22px Inter,ui-sans-serif,system-ui,sans-serif;}
.voter-related__summary::-webkit-details-marker{display:none;}
.voter-related__name{flex:1 1 220px;min-width:0;overflow-wrap:anywhere;}
.voter-related__count{flex:none;}
.voter-related__toggle{flex:none;font:600 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--navy-950);text-decoration:underline;text-underline-offset:3px;}
.voter-related__toggle-close{display:none;}
.voter-related__group[open] .voter-related__toggle-open{display:none;}
.voter-related__group[open] .voter-related__toggle-close{display:inline;}
.voter-related__body{display:grid;gap:12px;padding:12px 14px 14px;border-top:1px solid var(--line);min-width:0;}
.voter-related__description,.voter-related__empty{font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.voter-related__records{display:grid;gap:12px;min-width:0;}
.voter-related__record{display:grid;gap:8px;min-width:0;padding:12px;background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);}
.voter-related__record-id{font:600 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);overflow-wrap:anywhere;}
.voter-related__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;margin:0;min-width:0;}
.voter-related__field{display:grid;gap:2px;min-width:0;align-content:start;}
.voter-related__field dt{font:500 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.voter-related__field dd{margin:0;min-width:0;font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);overflow-wrap:anywhere;}
.voter-related__session{color:var(--muted);}
.voter-related__text{display:block;white-space:pre-wrap;overflow-wrap:anywhere;}
.voter-related__changes{margin:0;padding-left:18px;}
.voter-related__availability{padding:10px 12px;font:400 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);background:var(--surface-accent);border-radius:var(--radius-md);}
@media (max-width:720px){.voter-related{padding:14px;}.voter-related__fields{grid-template-columns:minmax(0,1fr);}}
@media (max-width:420px){.voter-related__summary{padding:10px 12px;}.voter-related__body{padding:12px;}}

/* V360-EXT-02B.3 Compromisos tab. Every rule sits under .voter-commitment (the panel, the list, the dialog form and the
 * notice); shared .modal, .field, .tab, .card and feature selectors are not restyled here. */
.voter-commitments{display:grid;gap:12px;}
.voter-commitments__head h3{margin:0 0 6px;}
.voter-commitments__head p{margin:0 0 6px;}
.voter-commitments__actions{display:flex;flex-wrap:wrap;gap:8px;}
.voter-commitments__actions .button{min-height:44px;}
.voter-commitments__filter{display:flex;flex-wrap:wrap;align-items:end;gap:12px;}
.voter-commitments__filter .field{min-width:220px;max-width:100%;}
.voter-commitments__filter .field select{min-height:44px;}
.voter-commitments__empty{display:grid;gap:6px;padding:14px 16px;border:1px dashed var(--line);border-radius:var(--radius-card);background:var(--surface-subtle);}
.voter-commitments__empty p{margin:0;}
.voter-commitments__readonly{margin:0;padding:10px 12px;border-radius:var(--radius-md);background:var(--surface-subtle);}
.voter-commitment__notice{margin:0;padding:10px 12px;border-radius:var(--radius-md);background:var(--green-bg);color:var(--green);font:500 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;scroll-margin-top:calc(var(--topbar) + 16px);}
.voter-commitment__notice:focus{outline:2px solid var(--info);outline-offset:2px;}
.voter-commitment-list{display:grid;gap:12px;margin:0;padding:0;list-style:none;}
.voter-commitment{display:grid;gap:10px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);min-width:0;}
.voter-commitment__head{display:flex;flex-wrap:wrap;align-items:start;justify-content:space-between;gap:8px;min-width:0;}
.voter-commitment__title{margin:0;min-width:0;overflow-wrap:anywhere;font:600 16px/22px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-commitment__status{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border-radius:var(--radius-full);font:500 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;white-space:nowrap;background:var(--info-bg);color:var(--info);}
.voter-commitment__status--pending{background:var(--amber-bg);color:var(--amber);}
.voter-commitment__status--fulfilled{background:var(--green-bg);color:var(--green);}
.voter-commitment__status--not_fulfilled,.voter-commitment__status--cancelled{background:var(--danger-bg);color:var(--danger);}
.voter-commitment__facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px 16px;margin:0;min-width:0;}
.voter-commitment__facts>div{display:grid;gap:2px;min-width:0;}
.voter-commitment__facts dt{font:500 12px/16px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.voter-commitment__facts dd{margin:0;min-width:0;overflow-wrap:anywhere;font:400 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-commitment__outcome{font-weight:600;}
.voter-commitment__details summary{display:inline-flex;align-items:center;min-height:44px;font:500 14px/20px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--info);cursor:pointer;}
.voter-commitment__details summary:focus-visible{outline:2px solid var(--info);outline-offset:2px;}
.voter-commitment__body{display:grid;gap:8px;padding-top:6px;min-width:0;}
.voter-commitment__body h5{margin:6px 0 0;font:600 13px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-commitment__text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font:400 14px/22px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-commitment__actions{display:flex;flex-wrap:wrap;gap:8px;}
.voter-commitment__actions .button{min-height:44px;}
.voter-commitment-form .voter-commitment__owner{margin:0;font:500 15px/22px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);overflow-wrap:anywhere;}
.voter-commitment-form .voter-commitment__outcomes{display:grid;gap:8px;margin:0;padding:0;border:0;min-width:0;}
.voter-commitment-form .voter-commitment__outcomes legend{padding:0;margin-bottom:4px;font:500 14px/18px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-commitment__choice{display:flex;align-items:center;gap:10px;min-height:44px;font:400 15px/22px Inter,ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.voter-commitment__choice input{width:20px;height:20px;margin:0;}
.voter-commitment-form .voter-commitment__outcomes .field-error{margin:0;}
.voter-commitment-form textarea{min-height:96px;}
.voter-commitment-form{min-width:0;max-width:100%;}
.voter-commitment-form .modal__body{min-width:0;}
.voter-commitment-form .modal__body>*{min-width:0;max-width:100%;}
.voter-commitment-form p,.voter-commitment-form .field,.voter-commitment-form .field-hint,.voter-commitment-form .field-error,.voter-commitment-form legend{overflow-wrap:anywhere;}
.voter-commitment-form input,.voter-commitment-form textarea,.voter-commitment-form select{max-width:100%;box-sizing:border-box;}
.voter-commitment-form fieldset{min-width:0;}

/* V360-EXT-UI-SEARCH-01 compact elector-search toolbar (Search only). Every selector is scoped to #voter-search (the form with class
   .voter-search-toolbar) or to its .voter-search-band group. The shared .voter-toolbar, .field and .button rules that Registry, Volunteers,
   GOTV and Early Voting use are not changed. The form is a grid whose columns depend on the viewport, because a container query cannot
   style the container itself. Under 1181 px: two columns, the territory and order group on its own line, the order select full width
   inside it. From 1181 px: query, status, category and the group in one row, with the two actions on a second row. From 1428 px (form content
   about 1042 px or more): all six fields and both actions in one row. Option widths come from the native select (its widest option), so a
   selected value is never clipped and a state change never resizes the field. */
#voter-search.voter-search-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:12px 8px;}
#voter-search.voter-search-toolbar > .field:first-child,#voter-search.voter-search-toolbar > .voter-search-band{grid-column:1/-1;}
#voter-search.voter-search-toolbar > .voter-search-band{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 8px;align-items:end;padding:0;border:0;}
#voter-search.voter-search-toolbar .voter-search-band > .field:last-child{grid-column:1/-1;}
#voter-search .field > select{padding:10px 8px 10px 12px;}
@media (min-width:1181px){
  #voter-search.voter-search-toolbar{grid-template-columns:minmax(180px,1fr) auto auto auto;}
  #voter-search.voter-search-toolbar > .field:first-child,#voter-search.voter-search-toolbar > .voter-search-band{grid-column:auto;}
  #voter-search.voter-search-toolbar > .voter-search-band{grid-template-columns:repeat(3,auto);}
  #voter-search.voter-search-toolbar .voter-search-band > .field:last-child{grid-column:auto;}
  #voter-search.voter-search-toolbar > .button--primary{grid-row:2;grid-column:3;justify-self:end;}
  #voter-search.voter-search-toolbar > .button--secondary{grid-row:2;grid-column:4;justify-self:end;}
}
@media (min-width:1428px){
  #voter-search.voter-search-toolbar{grid-template-columns:minmax(180px,1fr) auto auto auto auto auto;}
  #voter-search.voter-search-toolbar > .button--primary,#voter-search.voter-search-toolbar > .button--secondary{grid-row:auto;grid-column:auto;}
}

/* V360-EXT-UI-SEARCH-WIDTH-01: reduce the desktop query share by27.5% and distribute the released space equally across five selects. Keep a180px readable minimum and all narrow layouts. */
@media (min-width:1428px){
#voter-search.voter-search-toolbar{display:flex;flex-wrap:nowrap;gap:8px;align-items:flex-end;}
#voter-search.voter-search-toolbar>.field:first-child{flex:.725 1 0;min-width:180px;}
#voter-search.voter-search-toolbar>.field:nth-child(2),#voter-search.voter-search-toolbar>.field:nth-child(3){flex:.055 0 auto;}
#voter-search.voter-search-toolbar>.voter-search-band{display:flex;flex:.165 0 auto;gap:8px;min-width:0;}
#voter-search.voter-search-toolbar>.voter-search-band>.field{flex:1 0 auto;min-width:0;}
#voter-search.voter-search-toolbar>.button{flex:0 0 auto;}
}
