/* Team, companies, audit log and import pages. Tokens from app.css only, so light and dark mode both work. */

/* role badges */
.role-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.role-badge.r-owner { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.role-badge.r-admin { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.role-badge.r-accountant { background: var(--success-soft); color: var(--success); border-color: transparent; }
.role-badge.r-invited { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.member { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member .av { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.member .av.pending { background: var(--warning-soft); color: var(--warning); }
.member b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions select { width: auto; min-width: 150px; padding-top: 6px; padding-bottom: 6px; }
.seat-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.seat-bar > i { display: block; height: 100%; background: var(--accent); }
.seat-bar.full > i { background: var(--warning); }

/* role picker in the invite dialog */
.role-pick { display: grid; gap: 8px; margin: 4px 0 6px; }
.role-opt { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.role-opt:hover { border-color: var(--border-strong); }
.role-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.role-opt input { margin: 3px 0 0; grid-row: span 2; width: auto; }
.role-opt b { font-size: 14px; }
.role-opt span { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.role-opt .areas { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.area-chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.area-chip.w { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.cpa-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--success-soft); color: var(--text); margin-bottom: 12px; font-size: 13.5px; line-height: 1.45; }
.cpa-note svg, .cpa-note img { flex: none; margin-top: 2px; }

/* role matrix */
.role-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.role-matrix th, .role-matrix td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.role-matrix th:first-child, .role-matrix td:first-child { text-align: left; }
.role-matrix thead th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.role-matrix .w { color: var(--accent-text); font-weight: 600; }
.role-matrix .r { color: var(--text-2); }
.role-matrix .n { color: var(--muted); }
.matrix-wrap { overflow-x: auto; }

/* companies */
.co-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.co-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.co-card.current { border-color: var(--accent); }
.co-card .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.co-card .top .co-av { width: 40px; height: 40px; font-size: 14px; }
.co-card .top b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-card .meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.co-card .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* invite acceptance */
.invite-wrap { max-width: 520px; margin: 48px auto; padding: 0 16px; }
.invite-card { padding: 28px; text-align: center; }
.invite-card .co-av { width: 56px; height: 56px; font-size: 20px; margin: 0 auto 12px; }
.invite-card h1 { font-size: 22px; margin: 0 0 6px; }
.invite-card p { color: var(--muted); margin: 0 0 14px; }
.invite-card .role-badge { margin-bottom: 10px; }
.invite-card .btn { width: 100%; justify-content: center; }
.invite-card .stack { display: grid; gap: 8px; margin-top: 16px; }

/* audit log */
.audit-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; align-items: end; }
.audit-filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0; }
.audit-filters input, .audit-filters select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.audit-row { cursor: pointer; }
.act-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); text-transform: capitalize; }
.act-badge.a-create, .act-badge.a-import { background: var(--success-soft); color: var(--success); }
.act-badge.a-delete, .act-badge.a-void { background: var(--danger-soft); color: var(--danger); }
.act-badge.a-update { background: var(--accent-soft); color: var(--accent-text); }
.changed { color: var(--muted); font-size: 12.5px; }
.diff { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.diff th, .diff td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; word-break: break-word; }
.diff th { color: var(--muted); font-size: 12px; font-weight: 600; }
.diff td:first-child { font-weight: 600; width: 26%; }
.diff .before { background: var(--danger-soft); }
.diff .after { background: var(--success-soft); }
.diff pre { margin: 0; white-space: pre-wrap; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 220px; overflow: auto; }
.diff .none { color: var(--muted); font-style: italic; }
.audit-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; margin-bottom: 14px; }
.audit-meta dt { color: var(--muted); }
.audit-meta dd { margin: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; }

/* import */
.io-steps { display: flex; gap: 6px; margin: 0 0 16px; flex-wrap: wrap; }
.io-step { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); }
.io-step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 12px; }
.io-step.on { color: var(--text); background: var(--accent-soft); }
.io-step.on i, .io-step.done i { background: var(--accent); color: var(--on-accent); }
.io-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.io-type { text-align: left; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); display: flex; gap: 10px; align-items: flex-start; }
.io-type:hover:not(:disabled) { border-color: var(--border-strong); }
.io-type.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.io-type:disabled { opacity: .55; cursor: not-allowed; }
.io-type b { display: block; }
.io-type small { color: var(--muted); }
.drop { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { color: var(--text); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.map-grid label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.map-grid label .req { color: var(--danger); }
.map-grid label small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.preview { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.preview th, .preview td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.preview th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; z-index: 1; }
.preview tr.bad td { background: var(--danger-soft); }
.preview tr.skip td { background: var(--warning-soft); }
.preview td.err { color: var(--danger); white-space: normal; min-width: 220px; }
.preview td.rn { color: var(--muted); }
.result-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.result-tiles .card { padding: 12px 14px; }
.result-tiles span { color: var(--muted); font-size: 12px; display: block; }
.result-tiles b { font-size: 20px; }
.result-tiles .bad b { color: var(--danger); }
.result-tiles .good b { color: var(--success); }
.io-hint { margin: 8px 0 0; }
.io-migrate { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; color: var(--text); text-decoration: none; } .io-migrate small { display: block; color: var(--muted); } .io-migrate:hover { border-color: var(--border-strong); }
.io-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.export-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.export-row:last-child { border-bottom: 0; }

@media (max-width: 1100px) { .audit-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .audit-filters { grid-template-columns: 1fr 1fr; }
  .row-actions { justify-content: flex-start; }
  .row-actions select { flex: 1 1 100%; }
  .result-tiles { grid-template-columns: 1fr 1fr; }
  .diff td:first-child { width: 30%; }
  .invite-wrap { margin: 24px auto; }
  .invite-card { padding: 22px 18px; }
  .io-bar .btn { flex: 1 1 auto; justify-content: center; }
}
