/* Customer pages, the setup Folder, the timeline, the finance ledger and the search page. Uses only the theme tokens (tokens.css). */
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 16px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .875rem; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.card .chips { margin: 6px 0 12px; }
.chip svg, .card h3 svg, .tl-icon svg { width: 16px; height: 16px; vertical-align: -3px; }
.chip.chip-off { background: transparent; border-color: var(--border); color: var(--muted); }
.chip.chip-on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); }
.card h3 { display: flex; align-items: center; gap: 8px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: 12px 16px; margin-top: 12px; align-items: end; }
.form-grid .form-group { margin: 0; }
.form-grid .form-group:has(textarea) { grid-column: 1 / -1; }
.form-grid .btn { justify-self: start; }
.composer { margin-top: 12px; }
.composer > summary { display: inline-flex; cursor: pointer; list-style: none; }
.composer > summary::-webkit-details-marker { display: none; }
.composer .form-group textarea, .note-tools .form-group textarea { width: 100%; }
.narrow { max-width: 38em; }

.note { padding: 12px 0; border-bottom: 1px solid var(--border); }
.note:last-of-type { border-bottom: 0; }
.note-pinned { border-left: 3px solid var(--warning); padding-left: 12px; }
.note-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .8rem; }
.note-body { margin-top: 6px; overflow-wrap: anywhere; }
.note-body p { margin: 0 0 8px; }
.note-body ul, .note-body ol { margin: 0 0 8px 1.4em; padding: 0; }
.note-body code { font-family: var(--font-mono); font-size: .85em; padding: 1px 4px; background: var(--surface-2); border: 1px solid var(--border); }
.note-tools { margin-top: 6px; }
.note-tools > summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; overflow-wrap: anywhere; }
.comm { padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.comm header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.comm p { margin: 4px 0; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 0; }
.tl-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--accent); background: var(--surface-2); }
.tl-payment .tl-icon { color: var(--warning); }
.tl-audit .tl-icon { color: var(--muted); }
.tl-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-detail { margin-top: 2px; overflow-wrap: anywhere; font-size: .875rem; }
.tl-meta { margin-top: 2px; font-size: .78rem; }
.tl-more, .tl-empty { padding: 14px 0; list-style: none; text-align: center; }
.badge-type { text-transform: none; letter-spacing: 0; background: transparent; border: 1px solid var(--border); color: var(--muted); }

.search-box { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.search-box input[type=search] { flex: 1 1 22em; min-width: 0; }
.hit { padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.hit mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; padding: 0 1px; }
.hit-title { font-weight: 600; }
.hit-meta { font-size: .78rem; }
.group-count { font-weight: 400; color: var(--muted); font-size: .85rem; }

.money { font-family: var(--font-mono); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.chain-badge { margin-left: 8px; }
.aging { display: grid; grid-template-columns: repeat(auto-fit, minmax(8em, 1fr)); gap: 12px; margin: 8px 0 16px; }
.aging div { border: 1px solid var(--border); padding: 10px 12px; }
.aging b { display: block; font-size: 1.1rem; font-family: var(--font-mono); }
.row-void { text-decoration: line-through; color: var(--muted); }

@media (max-width: 640px) {
  .tl-item { grid-template-columns: 26px 1fr; gap: 8px; }
  .tl-icon { width: 26px; height: 26px; }
  .tabs a { padding: 8px 10px; }
  .form-grid { grid-template-columns: 1fr; }
}

.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.head-actions .more-filters { position: relative; }
.page-head + .tabs, .tabs + .card { margin-top: 0; }
