/* u83-permissions — Team → Permissions review (super user only). Cobalt Paper:
   hairline tables, tabular numerals, cobalt for actions, burnt orange only to
   say "look at this". .pm-* only; nothing here restyles another view. */
.pm { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.main > #permPanel { max-width: none; }                 /* a data table: use the width the screen has */
.pm > * { min-width: 0; max-width: 100%; }
.pm-card { min-width: 0; }
.pm-scroll { max-width: 100%; }
.pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pm-head h2 { margin: 0 0 4px; }
.pm-sub { margin: 0; color: var(--ink-3); font-size: 13px; max-width: 720px; }
.pm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pm-actions .form-msg { margin-left: 4px; }

.pm-strip { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.pm-strip > div { flex: 1 1 180px; padding: 10px 14px; border-right: 1px solid var(--border); min-width: 0; }
.pm-strip > div:last-child { border-right: 0; }
.pm-strip .pm-k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 2px; }
.pm-strip .pm-v { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.2; }
.pm-strip .pm-v small { font-family: inherit; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.pm-strip .pm-note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.pm-card { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.pm-card > h3 { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.pm-card > h3 .pm-hint { font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.pm-card > h3 .pm-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pm-scroll { overflow-x: auto; }

table.pm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pm-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--border); background: var(--bg); white-space: normal; }
.pm-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pm-stack { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pm-clients { font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.pm-clients .pm-l { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.pm-table tr:last-child td { border-bottom: 0; }
.pm-table tr.pm-super td { background: var(--accent-soft); }
.pm-table tr.pm-archived td { color: var(--ink-4); }
.pm-table td.pm-name { white-space: nowrap; font-weight: 600; }
.pm-table td.pm-name .pm-mail { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.pm-table .pm-acct { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; margin-top: 1px; }
.pm-table .pm-acct .pm-off { color: var(--ink-4); }
.pm-vis { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pm-vis > span { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); }
.pm-vis .pm-lock { font-size: 12px; }
.pm-rights { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--text-2); }
.pm-rights > span { display: inline-flex; align-items: center; gap: 6px; }
.pm-rights .ti { color: var(--ink-4); font-size: 14px; }
.pm-table td.num, .pm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pm-table .sort-select, .pm-table select { height: 26px; font-size: 12.5px; padding: 0 20px 0 7px; min-width: 0; width: auto; }
.pm-table select.pm-changed { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pm-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pm-was { color: var(--ink-4); font-size: 12px; text-decoration: line-through; }
.pm-lock { color: var(--ink-3); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.pm-tier { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; background: var(--sunken); color: var(--text-2); }
.pm-tier.super { background: var(--accent); color: #fff; }
.pm-tier.admin { background: var(--accent-soft); color: var(--accent-ink); }
.pm-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 500; background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.pm-chip.warn { background: var(--amber-soft); color: var(--amber); }
.pm-chip.good { background: var(--green-soft); color: var(--green); }
.pm-chip.bad { background: var(--red-soft); color: var(--red); }
.pm-chip.info { background: var(--accent-soft); color: var(--accent-ink); }
.pm-chip.muted { color: var(--ink-4); }
button.pm-modbtn { height: 24px; padding: 0 8px; font-size: 12px; }
tr.pm-modrow td { background: var(--bg); padding: 10px 14px 12px 44px; }
.pm-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.pm-mods label { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; color: var(--text-2); }
.pm-mods label.changed { color: var(--accent-ink); font-weight: 600; }
.pm-mods input { margin: 0; }
.pm-modhead { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 12px; color: var(--ink-3); }

.pm-proof td.pm-delta { white-space: nowrap; }
.pm-proof .pm-arrow { color: var(--ink-4); margin: 0 4px; }
.pm-proof .down { color: var(--text-2); }
.pm-proof .up { color: var(--amber); font-weight: 600; }
.pm-lines { margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--text-2); }
.pm-lines li { padding: 1px 0; }
.pm-lines li.gain { color: var(--amber); font-weight: 600; }
.pm-lines li.warn { color: var(--amber); font-weight: 600; }
.pm-lines .pm-l { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); margin-right: 6px; }

.pm-test { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pm-test-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pm-test-row label { font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.pm-test-row select, .pm-test-row input { height: 30px; margin: 0; }
.pm-test-row input[type="text"] { width: 280px; }
.pm-samples { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); padding: 6px 8px; }
.pm-samples label { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 2px; cursor: pointer; }
.pm-samples label:hover { background: var(--sunken); }
.pm-samples .pm-own { color: var(--ink-4); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.pm-verdict { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg); font-size: 13px; }
.pm-verdict b { font-family: var(--font-display); font-size: 14px; }
.pm-verdict.ok b { color: var(--green); } .pm-verdict.no b { color: var(--red); }
.pm-verdict .pm-why { color: var(--text-2); }

.pm-scen { list-style: none; margin: 0; padding: 0; }
.pm-scen li { display: grid; grid-template-columns: 28px 92px 1fr; gap: 10px; align-items: baseline; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pm-scen li:last-child { border-bottom: 0; }
.pm-scen .pm-n { color: var(--ink-4); font-variant-numeric: tabular-nums; }
.pm-scen .pm-d { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pm-empty { padding: 14px; font-size: 13px; color: var(--ink-3); }
.pm-firm { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-firm .pm-chip { white-space: normal; height: auto; min-height: 22px; padding: 3px 8px; line-height: 1.25; }
.pm-lines li .pm-parts { color: var(--text-2); }
.pm-lines li.more { color: var(--ink-4); }
@media (max-width: 1280px) { .pm-mods { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }

/* u83-permissions (Phase 1): Firm settings in view-only mode for administrators */
.pm-view-only-note { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--sunken); color: var(--text-2); font-size: 13px; }
.settings-card.pm-view-only { opacity: .85; }
