/* Tax, Documents and document approvals. Builds on style.css (its variables and components). */

/* Helpers */
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre-wrap { white-space: pre-wrap; }
.row.nowrap, .gap.nowrap { flex-wrap: nowrap; }
.row > input.grow { width: auto; }

/* Navigation badge (requests waiting for approval) */
.nav-icon { position: relative; display: inline-flex; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nav-icon .nav-badge { position: absolute; top: -5px; right: -10px; box-shadow: 0 0 0 2px var(--surface); }
.nav-icon .nav-badge-dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: -2px; right: -4px; }
.list-row .nav-badge { flex: none; }

/* Tax: person switcher */
.person-chips .chip { padding-left: 6px; gap: 8px; }
.person-chips .avatar { width: 26px; height: 26px; font-size: 0.8rem; }
.person-chips .chip.active .avatar { background: var(--bg); color: var(--text); }
.data-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.chip.active .data-dot { background: var(--bg); }
.hero-top { gap: 8px; flex-wrap: wrap; }
.tax-totals { column-gap: 12px; row-gap: 10px; }
.tax-totals .total { font-size: clamp(0.95rem, 4.1vw, 1.15rem); }
.invisible { visibility: hidden; }
/* A section heading that may or may not have a small button: always as tall as with one. */
.head-fixed { min-height: 36px; }
/* A row that opens something, beside a button of its own (charity payments to check). */
.row-open { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.tag-btn { flex: none; max-width: 48%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A radio choice laid out as a list row: the option and its explanation. */
label.choice-row { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-weight: 400; font-size: 0.95rem; cursor: pointer; }
label.choice-row input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.section-head h2.row .avatar { width: 22px; height: 22px; font-size: 0.72rem; }
.link-picker { display: flex; flex-direction: column; gap: 6px; }
.link-picker .field-label { margin-bottom: 0; }
.link-picker .list-row { min-height: 56px; }

/* Documents */
.doc-row { gap: 12px; }
.doc-badge {
  width: 40px; height: 44px; flex: none; border-radius: 8px;
  display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 6px;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  position: relative;
}
.doc-badge::before {
  content: ""; position: absolute; top: -1px; right: -1px; width: 12px; height: 12px;
  background: linear-gradient(225deg, var(--bg) 50%, var(--border) 50%); border-radius: 0 8px 0 4px;
}
.doc-pdf { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.doc-img { color: var(--accent); background: var(--accent-soft); }
.doc-link { color: var(--text); min-width: 0; padding: 2px 0; }
.doc-link:hover .block:first-child { text-decoration: underline; }
.doc-preview { width: 100%; height: 260px; object-fit: contain; border-radius: 12px; background: var(--surface-2); }
.doc-attachments { display: flex; flex-direction: column; gap: 8px; }
.detail-head .doc-badge { width: 48px; height: 54px; font-size: 0.7rem; }
.detail-head .grow { min-width: 0; }

.file-pick { position: relative; }
.file-pick input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 96px; padding: 16px; border-radius: 14px; border: 2px dashed var(--border);
  background: var(--surface-2); color: var(--text); font-size: 0.95rem;
}
.file-pick:focus-within .file-pick-box { border-color: var(--accent); }
.file-pick-box .strong { word-break: break-word; }

.picker { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.picker input[type="search"] { border-radius: 999px; padding-left: 16px; }
.picker .card { box-shadow: none; }
.picker-list { max-height: 300px; overflow-y: auto; }
.picker-list .list-row:disabled { opacity: 0.6; }

/* Access requests: calm, but impossible to miss */
.access { gap: 10px; }
.access-card { display: flex; flex-direction: column; gap: 10px; border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.access-waiting { border-color: var(--border); }
.access-top { display: flex; gap: 12px; align-items: flex-start; }
.access-icon {
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--warn) 16%, var(--surface)); font-size: 1.05rem;
}
.access-waiting .access-icon { background: var(--surface-2); }
.access-reason-label { margin-bottom: -6px; }
.access-reason {
  margin: 0; padding: 10px 12px; border-left: 3px solid var(--border); border-radius: 0 10px 10px 0;
  background: var(--surface-2); font-size: 0.92rem; white-space: pre-wrap; word-break: break-word;
}
.access-explain { margin: 0; color: var(--muted); }
.access-actions .btn { flex: 1; }
.access-confirm {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px;
  background: var(--accent-soft);
}
.access-confirm .row { justify-content: flex-end; }
.access-recent summary { font-weight: 600; }
.access-recent .card { margin-top: 4px; }
.access-row { align-items: flex-start; }
.access-row .tag { margin-top: 2px; flex: none; }

/* Settings: approvers */
.approvals-intro { margin: 0; }
.approver-list { display: flex; flex-direction: column; }
.approver-list label.check { padding: 6px 0; border-bottom: 1px solid var(--border); }
.approver-list label.check:last-child { border-bottom: 0; }
