/* Agreements views (agreements.js) and the shared pieces the Secure Portal admin views
   reuse (pills, cards, fields). Tokens come from theme.css. */

.agr-root, .agr-tpl-root, .agr-sig-root { padding: 16px 20px 32px; color: var(--lf-text); }
.agr-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.agr-top h1 { font-size: 20px; margin: 0 0 4px; color: var(--lf-text); }
.agr-sub { margin: 0; color: var(--lf-text-muted); font-size: 13px; line-height: 1.5; }
.agr-muted { color: var(--lf-text-muted); }
.agr-empty { padding: 18px; color: var(--lf-text-muted); text-align: center; line-height: 1.5; }
.agr-empty-big { padding: 60px 20px; }
.agr-error { color: var(--lf-error); font-size: 13px; margin: 8px 0 0; min-height: 0; }
.agr-error:empty { display: none; }

.agr-panes { display: grid; grid-template-columns: var(--lf-list-w, 340px) 1fr; gap: 16px; align-items: start; }
.agr-list { background: var(--lf-panel-alt); border: 1px solid var(--lf-border); border-radius: 10px; overflow: hidden; }
.agr-search { display: block; width: calc(100% - 24px); margin: 12px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--lf-border-strong); background: var(--lf-bg); color: var(--lf-text); font: inherit; }
.agr-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.agr-chip { font: inherit; font-size: 12px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--lf-border); color: var(--lf-text-muted); background: transparent; cursor: pointer; min-height: 28px; }
.agr-chip.on { border-color: var(--lf-accent); color: var(--lf-accent); }
.agr-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; width: 100%; text-align: left; padding: 11px 14px; border: 0; border-top: 1px solid var(--lf-border); background: transparent; color: var(--lf-text); font: inherit; cursor: pointer; }
.agr-row:hover { background: var(--lf-panel-hover); }
.agr-row.on { background: var(--lf-panel-hover); box-shadow: inset 3px 0 0 var(--lf-accent); }
.agr-row-name { font-weight: 600; color: var(--lf-text); }
.agr-row-time { color: var(--lf-text-dim); font-size: 11px; text-align: right; }
.agr-row-sub { color: var(--lf-text-muted); font-size: 12px; }

.agr-pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; vertical-align: middle; }
.agr-pill-info { background: var(--lf-info-bg); color: var(--lf-info); border-color: var(--lf-info-border); }
.agr-pill-warn { background: var(--lf-warn-bg); color: var(--lf-warn); border-color: var(--lf-warn-border); }
.agr-pill-ok { background: var(--lf-success-bg); color: var(--lf-success); border-color: var(--lf-success-border); }
.agr-pill-err { background: var(--lf-error-bg); color: var(--lf-error); border-color: var(--lf-error-border); }
.agr-pill-dim { background: var(--lf-panel-hover); color: var(--lf-text-muted); }
.agr-pill-acc { background: var(--lf-accent-bg); color: var(--lf-accent-hover); }
.agr-pill-pur { background: var(--lf-purple-bg); color: var(--lf-purple); border-color: var(--lf-purple-border); }

.agr-detail { min-width: 0; }
.agr-dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.agr-dh h2 { margin: 0 0 4px; font-size: 18px; color: var(--lf-text); }
.agr-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.agr-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-bottom: 16px; }
.agr-card { background: var(--lf-panel); border: 1px solid var(--lf-border); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; min-width: 0; }
.agr-grid .agr-card { margin-bottom: 0; }
.agr-card h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--lf-text-muted); font-weight: 600; }
.agr-kv { display: grid; grid-template-columns: 130px 1fr; row-gap: 8px; column-gap: 12px; margin: 0; font-size: 13px; }
.agr-kv dt { color: var(--lf-text-muted); }
.agr-kv dd { margin: 0; color: var(--lf-text); overflow-wrap: anywhere; }
.agr-sigbox { background: #f8f7f4; border-radius: 8px; height: 96px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.agr-sigbox img { max-height: 84px; max-width: 92%; }
.agr-sigbox-sm { height: 58px; width: 160px; margin: 0; }
.agr-sigbox-sm img { max-height: 50px; }
.agr-pdfs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.agr-trail { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.agr-trail th { text-align: left; color: var(--lf-text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 0 8px 6px 0; }
.agr-trail td { border-top: 1px solid var(--lf-border); padding: 8px 8px 8px 0; vertical-align: top; }
.agr-trail code, .agr-kv code { font-size: 12px; color: var(--lf-text-muted); }
.agr-note { white-space: pre-wrap; margin: 0; color: var(--lf-text); }

.agr-dialog { max-width: 560px; }
.agr-blk { border: 1px solid var(--lf-border); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.agr-blk-acc { border-color: var(--lf-accent); }
.agr-blk-l { font-size: 11px; letter-spacing: .08em; color: var(--lf-text-muted); text-transform: uppercase; margin-bottom: 6px; font-weight: 600; }
.agr-blk-acc .agr-blk-l { color: var(--lf-accent); }
.agr-blk-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.agr-form { display: grid; gap: 12px; }
.agr-field { display: grid; gap: 5px; font-size: 12px; color: var(--lf-text-muted); }
.agr-field input, .agr-field select, .agr-field textarea { font: inherit; font-size: 14px; color: var(--lf-text); background: var(--lf-bg); border: 1px solid var(--lf-border-strong); border-radius: 6px; padding: 9px 10px; min-height: 40px; }
.agr-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--lf-text); line-height: 1.4; }
.agr-check input { margin-top: 2px; width: 16px; height: 16px; }
.agr-hint { margin: -4px 0 0 24px; font-size: 12px; line-height: 1.4; }
.agr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.agr-field input:focus-visible, .agr-field select:focus-visible, .agr-field textarea:focus-visible, .agr-chip:focus-visible, .agr-row:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: 1px; }

.agr-tpl-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.agr-tpl-head h2 { margin: 0 0 4px; font-size: 16px; color: var(--lf-text); }
.agr-upload { cursor: pointer; position: relative; }
/* The file input stays in the accessibility tree and the tab order (a [hidden] one is in
   neither), visually folded into its label button; focus shows on the label. */
.agr-file-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.agr-upload:focus-within { outline: 2px solid var(--lf-accent); outline-offset: 2px; }
.agr-upload.busy { opacity: .6; pointer-events: none; }
.agr-reqlink { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; font-size: 12.5px; color: var(--lf-text-muted); }
.agr-reqlink code { color: var(--lf-text); overflow-wrap: anywhere; }

.agr-sig-card { max-width: 720px; }
.agr-tabs { display: flex; gap: 18px; margin: 12px 0 8px; }
.agr-tabs button { font: inherit; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--lf-text-muted); padding: 4px 0; cursor: pointer; }
.agr-tabs button.on { color: var(--lf-accent); border-bottom-color: var(--lf-accent); font-weight: 600; }
.agr-pad { width: 100%; height: 150px; background: #f8f7f4; border-radius: 8px; touch-action: none; cursor: crosshair; display: block; margin-bottom: 10px; }
.agr-typed { width: 100%; margin-bottom: 10px; font: inherit; padding: 9px 10px; border-radius: 6px; border: 1px solid var(--lf-border-strong); background: var(--lf-bg); color: var(--lf-text); }

@media (max-width: 900px) {
  .agr-panes, .agr-grid, .agr-two { grid-template-columns: 1fr; }
  .agr-dh, .agr-top, .agr-tpl-head { flex-direction: column; }
  .agr-kv { grid-template-columns: 110px 1fr; }
}
