/* Webacc UI v2 – Experts & Audit (audit/), Information (notice/, information/, member_info/, notification/),
   Extra Activity (visitor/, guard/) and the Election module (election/).
   Hooks (v2-gated in the templates, so v1 emits none of them): .v2-rx-head on .content-header and .v2-rx on
   .content together with one of .v2-rx-list (DataTable list pages; + .v2-rx-sr when column 1 is a serial number),
   .v2-rx-form (add / edit / view forms and the 14 audit checklist forms), .v2-rx-audit (audit report index)
   or .v2-rx-letter (election letter previews). Tokens come from theme.css; nothing here is loaded in v1. */

/* ---------- page header ---------- */
.content-header.v2-rx-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px 20px;flex-wrap:wrap;padding:22px 24px 6px}
.v2-rx-head>h5,.v2-rx-head>.v2-page-desc{flex:0 0 100%}
.v2-rx-head h5{margin:0;font-size:1.3rem;font-weight:800;letter-spacing:-.02em;line-height:1.2}
.v2-rx-head h5 strong{font-weight:inherit}
.v2-rx-head .v2-page-desc{max-width:76ch;line-height:1.45}
.v2-rx-head>div:first-child,.v2-rx-head .pull-left{float:none!important;padding:0!important;flex:1 1 320px;min-width:0}
.v2-rx-head .pull-right{float:none!important;padding:0 0 2px!important;margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:0}
.v2-rx-head .pull-right .btn{font-size:.82rem;padding:.42rem .95rem}

/* ---------- list pages ---------- */
.v2-rx-list .card-body{padding:16px 20px 20px}
.v2-rx-list .card-body .card-body{padding:0}
.v2-rx-list .card-body>br:first-child{display:none}
.v2-rx-list .card-primary:not(.card-outline)>.card-header{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;padding:10px 16px;background:var(--v2-surface);color:var(--v2-text);border-bottom:1px solid var(--v2-border)}
.v2-rx-list .card-header a{display:inline-flex;text-decoration:none}
.v2-rx-list .card-header .btn{float:none!important}
.v2-rx-list .table-responsive{border:1px solid var(--v2-border);border-radius:var(--v2-radius-sm);padding:12px 14px 10px}
.v2-rx-list .table{margin:0}
.v2-rx-list .table-bordered{border:0}
.v2-rx-list .table thead th{white-space:nowrap}
.v2-rx-list .table td{font-size:.88rem;vertical-align:middle}
.v2-rx-sr #listTable td:first-child{font-family:var(--v2-mono);color:var(--v2-muted);width:64px;text-align:right}
.v2-rx-list #listTable td:has(>a>.btn){white-space:nowrap;font-size:0}
.v2-rx-list #listTable td .btn{font-size:.76rem;padding:.3rem .6rem;line-height:1.25;margin:1px 2px;vertical-align:middle}
.v2-rx-list #listTable td>a{display:inline-flex;text-decoration:none;vertical-align:middle}
.v2-rx-list #listTable td.sm a{display:inline-flex;align-items:center;padding:3px 11px;border:1px solid var(--v2-border-strong);border-radius:999px;font-size:.74rem;font-weight:700;color:var(--v2-text-2);text-decoration:none;transition:color .15s,border-color .15s}
.v2-rx-list #listTable td.sm a:hover{color:var(--v2-primary);border-color:var(--v2-primary)}
.v2-rx-list .dataTables_wrapper>.row:first-child{margin-bottom:12px}
.v2-rx-list .dataTables_wrapper>.row:last-child{margin-top:4px}
.v2-rx-list table.dataTable.no-footer{border-bottom:0}
body:has(.v2-rx-list) #myModal #modalid{max-width:100%;height:auto;border-radius:var(--v2-radius-xs);border:1px solid var(--v2-border)}

/* status pills (member_info/info.cfm: Created / Assigned / Closed) */
.v2-rx-pill{display:inline-flex;align-items:center;gap:7px;padding:3px 11px 3px 9px;border-radius:999px;font-size:.74rem;font-weight:700;letter-spacing:.02em;line-height:1.3;white-space:nowrap;background:var(--v2-surface-2);color:var(--v2-text-2);border:1px solid var(--v2-border)}
.v2-rx-pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 18%,transparent)}
.v2-rx-pill:empty{display:none}
.v2-rx-pill.is-created{background:color-mix(in srgb,var(--v2-info) 12%,transparent);color:var(--v2-info);border-color:transparent}
.v2-rx-pill.is-assigned{background:color-mix(in srgb,var(--v2-warning) 14%,transparent);color:var(--v2-warning);border-color:transparent}
.v2-rx-pill.is-closed{background:color-mix(in srgb,var(--v2-success) 13%,transparent);color:var(--v2-success);border-color:transparent}

/* ---------- add / edit / view forms and audit checklists ---------- */
.v2-rx-form>.row{margin:0}
.v2-rx-form>.row>[class*="col-md-"][style]{flex:0 0 100%;max-width:980px;padding:0;position:static}
.v2-rx-form .card-primary:not(.card-outline)>.card-header[style]{background:var(--v2-surface)!important;color:var(--v2-text);border-bottom:1px solid var(--v2-border);padding:12px 20px}
.v2-rx-form .card-header[style] b[style]{color:var(--v2-text-2)!important;font-size:.72rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.v2-rx-form form>div[style]{padding:8px 20px 18px!important}
.v2-rx-form form .row[style]{padding:0!important;margin:0 -8px}
.v2-rx-form form .form-group[class*="col-"]{padding:0 8px;margin-bottom:16px}
.v2-rx-form label.col-form-label{display:block;padding:0 0 6px;margin:0;font-size:.76rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--v2-text-2);line-height:1.3}
.v2-rx-form .input-group .form-control{min-height:38px}
.v2-rx-form .form-control:disabled{background:var(--v2-surface-2);color:var(--v2-text-2);border-style:dashed}
/* audit checklist: one question per row, label | answer, separated by hairlines */
.v2-rx-form .row.mb-3{margin:0!important;padding:10px 0;border-bottom:1px solid var(--v2-border);align-items:center}
.v2-rx-form .row.mb-3:last-of-type{border-bottom:0}
.v2-rx-form .row.mb-3>label.col-form-label{padding:0 12px 6px 0;font-size:.84rem;font-weight:600;text-transform:none;letter-spacing:0;color:var(--v2-text)}
.v2-rx-form .row.mb-3>.col-sm-6{padding:0}
.v2-rx-form .row.mb-3 textarea.form-control{min-height:64px}
@media (min-width:768px){
  .v2-rx-form .row.mb-3>label.col-form-label{padding-bottom:0}
  .v2-rx-form .row.mb-3>.col-sm-4{flex:0 0 34%;max-width:34%}
  .v2-rx-form .row.mb-3>.col-sm-6{flex:0 0 66%;max-width:66%}
}
/* phones (incl. landscape 576-767): question above answer */
@media (max-width:767px){
  .v2-rx-form .row.mb-3>.col-sm-4,.v2-rx-form .row.mb-3>.col-sm-6{flex:0 0 100%;max-width:100%}
}
/* action row (Save / Reset / Back / Print) */
.v2-rx-form form>div[style]>div:not(.row):last-child{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end;padding:16px 0 0!important;margin-top:8px;border-top:1px solid var(--v2-border);font-size:0}
.v2-rx-form form>div[style]>div:not(.row):last-child .btn{font-size:.82rem;min-width:92px;float:none!important;cursor:pointer}

/* ---------- audit report index: one tile per section ---------- */
.v2-rx-audit>.row{margin:0}
.v2-rx-audit>.row>.col-md-10[style]{flex:0 0 100%;max-width:1200px;padding:0;position:static;display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px;counter-reset:v2sec}
.v2-rx-audit>.row>.col-md-10>br{display:none}
.v2-rx-audit .card-header::after{display:none}
.v2-rx-audit .card{margin:0;position:relative;counter-increment:v2sec;transition:transform .2s var(--v2-ease),border-color .2s,box-shadow .2s}
.v2-rx-audit .card:hover{transform:translateY(-2px);border-color:var(--v2-primary);box-shadow:var(--v2-shadow)}
.v2-rx-audit .card-primary:not(.card-outline)>.card-header[style]{background:var(--v2-surface)!important;color:var(--v2-text);display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 16px 14px;border:0;border-radius:inherit;min-height:84px}
.v2-rx-audit .card-header b[style]{color:var(--v2-text)!important;font-size:.84rem;font-weight:700;line-height:1.3;letter-spacing:.01em}
.v2-rx-audit .card-header b[style]::before{content:counter(v2sec,decimal-leading-zero);display:block;font-family:var(--v2-mono);font-size:.68rem;font-weight:600;letter-spacing:.08em;color:var(--v2-muted);margin-bottom:6px}
.v2-rx-audit .card-header .btn{position:static;float:none!important;flex:0 0 auto;padding:.3rem .55rem;background:var(--v2-primary-soft);border-color:transparent;color:var(--v2-primary-600);box-shadow:none}
.v2-rx-audit .card-header .btn::after{content:"";position:absolute;inset:0;border-radius:inherit}
.v2-rx-audit .card:hover .card-header .btn{background:var(--v2-primary);color:#fff}

/* ---------- election letter previews ---------- */
.v2-rx-letter .card{max-width:900px;margin:0 auto 16px;padding:28px 20px 20px}
.v2-rx-letter .card>br{display:none}
.v2-rx-letter .card h6{font-size:.9rem}
.v2-rx-letter .card address{line-height:1.6}
.v2-rx-letter>.row[style*="float"]{float:none!important;max-width:900px;margin:0 auto}
.v2-rx-letter>.row[style*="float"]>.col-md-12{display:flex;gap:10px;justify-content:flex-end;padding:0;font-size:0}
.v2-rx-letter>.row[style*="float"] .btn{font-size:.82rem;min-width:92px}
.v2-rx-letter>.row[style*="float"] a{cursor:pointer}
.v2-rx-letter>br{display:none}

/* ---------- responsive ---------- */
.v2-rx-list .dataTables_paginate{white-space:normal}
.v2-rx-list .dataTables_paginate>span{display:contents}
@media (max-width:1199px){
  .content-header.v2-rx-head{padding:18px 16px 4px}
}
@media (max-width:991px){
  /* list tables scroll inside the card; the first column stays put */
  .v2-rx-list .table-responsive{position:relative}
  .v2-rx-list #listTable th:first-child,.v2-rx-list #listTable td:first-child{position:sticky;left:0;z-index:1;background:var(--v2-surface);box-shadow:inset -1px 0 0 var(--v2-border)}
  .v2-rx-list #listTable thead th:first-child{z-index:2;background:var(--v2-surface-2)}
  .v2-rx-list #listTable.table-striped tbody tr:nth-of-type(odd) td:first-child{background:var(--v2-surface-2)}
  .v2-rx-list #listTable td .btn{min-height:34px}
  .v2-rx-list #listTable td.sm a{min-height:34px}
  .v2-rx-list .dataTables_paginate a.paginate_button,.v2-rx-list .dataTables_paginate .page-link{min-height:40px;display:inline-flex;align-items:center;margin:2px 1px}
  .v2-rx-list .dataTables_paginate .pagination{flex-wrap:wrap;justify-content:center;margin:0}
  .v2-rx-list .card-primary:not(.card-outline)>.card-header{padding:10px 12px}
  .v2-rx-form>.row>[class*="col-md-"][style],.v2-rx-audit>.row>.col-md-10[style]{max-width:none}
  .v2-rx-audit .card-primary:not(.card-outline)>.card-header[style]{min-height:0;padding:14px 14px 12px}
}
@media (max-width:767px){
  .content-header.v2-rx-head{padding:14px 12px 2px}
  .v2-rx-head h5{font-size:1.15rem}
  .v2-rx-head .pull-right{margin-left:0;flex:0 0 100%;padding:0!important}
  .v2-rx-head .pull-right .btn{flex:1 1 auto;justify-content:center;min-height:40px}
  .v2-rx-list .card-body{padding:12px}
  .v2-rx-list .table-responsive{padding:8px 8px 6px}
  .v2-rx-list .card-header a{flex:1 1 100%}
  .v2-rx-list .card-header .btn{width:100%;justify-content:center}
  .v2-rx-form .card-primary:not(.card-outline)>.card-header[style]{padding:10px 12px}
  .v2-rx-form form>div[style]{padding:4px 12px 14px!important}
  .v2-rx-form form .form-group[class*="col-"]{flex:0 0 100%;max-width:100%}
  /* two buttons per row; margins instead of gap so the &nbsp; text nodes between the buttons take no space */
  .v2-rx-form form>div[style]>div:not(.row):last-child{gap:0;margin-left:-4px;margin-right:-4px}
  .v2-rx-form form>div[style]>div:not(.row):last-child .btn{flex:1 1 calc(50% - 8px);min-width:0;margin:4px}
  .v2-rx-audit>.row>.col-md-10[style]{gap:10px}
  .v2-rx-letter .card{padding:18px 14px 14px}
  .v2-rx-letter>.row[style*="float"]>.col-md-12{flex-wrap:wrap;gap:0;margin:0 -4px}
  .v2-rx-letter>.row[style*="float"] .btn{flex:1 1 calc(50% - 8px);min-width:0;margin:4px}
}
@media (max-width:575px){
  .v2-rx-head .v2-page-desc{font-size:.84rem}
  .v2-rx-list .card-body{padding:10px}
  .v2-rx-list .table-responsive{padding:6px 6px 4px}
  .v2-rx-audit>.row>.col-md-10[style]{grid-template-columns:1fr}
  .v2-rx-audit .card-header b[style]::before{display:inline;margin:0 8px 0 0}
}
