/* Secure Portal admin (/portal-people). Builds on agreements.css (agr-*),
   which portal-admin.js loads first. */

.pa-root, .pa-files-root { padding: 16px 20px 32px; color: var(--lf-text); }

.pa-panes { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pa-files-panes { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.pa-table-wrap, .pa-side, .pa-tree, .pa-files-panes > section { background: var(--lf-panel); border: 1px solid var(--lf-border); border-radius: 10px; min-width: 0; }
.pa-table-wrap { overflow-x: auto; }
.pa-side { padding: 14px 16px; position: sticky; top: 12px; }
.pa-side h2 { margin: 0 0 4px; font-size: 17px; color: var(--lf-text); }
.pa-side .agr-sub { margin-bottom: 12px; }
.pa-side a { color: var(--lf-accent); }

.pa-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pa-table th { text-align: left; color: var(--lf-text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px 8px; white-space: nowrap; }
.pa-table td { border-top: 1px solid var(--lf-border); padding: 10px 12px; vertical-align: middle; color: var(--lf-text); }
.pa-table td small { display: block; color: var(--lf-text-muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.pa-row { cursor: pointer; }
.pa-row:hover { background: var(--lf-panel-hover); }
.pa-row.on { background: var(--lf-panel-hover); box-shadow: inset 3px 0 0 var(--lf-accent); }
.pa-row:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: -2px; }
.pa-table select { font: inherit; font-size: 12.5px; color: var(--lf-text); background: var(--lf-bg); border: 1px solid var(--lf-border-strong); border-radius: 6px; padding: 5px 8px; min-height: 32px; }

.pa-stage { display: flex; border: 1px solid var(--lf-border-strong); border-radius: 8px; overflow: hidden; margin: 6px 0 12px; }
.pa-stage button { flex: 1; font: inherit; font-size: 12px; padding: 8px 6px; border: 0; border-left: 1px solid var(--lf-border-strong); background: transparent; color: var(--lf-text-muted); cursor: pointer; min-height: 36px; }
.pa-stage button:first-child { border-left: 0; }
.pa-stage button.on { background: var(--lf-accent-bg); color: var(--lf-accent-hover); font-weight: 600; }
.pa-stage button:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: -2px; }
.pa-controls { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.pa-controls .agr-field { flex: 1; }
.pa-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.pa-stats:empty { display: none; }
.pa-stats div { background: var(--lf-panel-alt); border: 1px solid var(--lf-border); border-radius: 8px; padding: 8px 10px; }
.pa-stats b { display: block; font-size: 16px; color: var(--lf-text); }
.pa-stats span { font-size: 11px; color: var(--lf-text-muted); }
.pa-h3 { margin: 16px 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--lf-text-muted); font-weight: 600; }
.pa-h2 { margin: 0; padding: 12px 12px 4px; font-size: 15px; color: var(--lf-text); }
.pa-timeline { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; font-size: 12.5px; }
.pa-timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--lf-border); }
.pa-timeline li span { color: var(--lf-text-dim); }
.pa-timeline li b { font-weight: 500; color: var(--lf-text); overflow-wrap: anywhere; }

.pa-tree { padding: 6px; display: grid; gap: 2px; }
.pa-folder { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--lf-text); cursor: pointer; min-height: 36px; }
.pa-folder small { color: var(--lf-text-dim); }
.pa-folder:hover { background: var(--lf-panel-hover); }
.pa-folder.on { background: var(--lf-accent-bg); color: var(--lf-accent-hover); }
.pa-folder:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: -2px; }
.pa-file-acts { white-space: nowrap; text-align: right; }
.pa-file-acts .btn { margin-left: 4px; }
.pa-files-panes > section .agr-error { padding: 0 12px 12px; }

.pa-toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.pa-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pa-toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--lf-border-strong); transition: background .15s; pointer-events: none; }
.pa-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.pa-toggle input:checked + span { background: var(--lf-accent); }
.pa-toggle input:checked + span::after { transform: translateX(16px); }
.pa-toggle input:focus-visible + span { outline: 2px solid var(--lf-accent); outline-offset: 2px; }
.pa-folders-text { width: 100%; 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; resize: vertical; }

@media (max-width: 900px) {
  .pa-panes, .pa-files-panes { grid-template-columns: 1fr; }
  .pa-side { position: static; }
  .pa-tree { display: flex; overflow-x: auto; }
  .pa-folder { white-space: nowrap; width: auto; }
  .pa-file-acts { white-space: normal; text-align: left; }
  .pa-file-acts .btn { margin: 0 4px 4px 0; }
}

/* One person's shared folder (side panel). */
.pa-shared-hint { font-size: 12.5px; margin: 0 0 10px; }
.pa-shared-form { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--lf-border); border-radius: 8px; margin-bottom: 12px; }
.pa-shared-form .agr-acts { justify-content: flex-start; }
.pa-shared-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--lf-border); border-radius: 8px; }
.pa-shared-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--lf-border); }
.pa-shared-row:first-child { border-top: 0; }
.pa-shared-info { min-width: 0; }
.pa-shared-info strong { overflow-wrap: anywhere; color: var(--lf-text); }
.pa-shared-info small { display: block; color: var(--lf-text-muted); font-size: 12px; margin-top: 2px; }
.pa-shared-note { font-style: italic; }
.pa-shared-acts { display: flex; gap: 6px; flex: none; }
.pa-row .pa-new { margin-left: 6px; }
