/* People, Financials, receipt capture, charts. Uses only design tokens from theme.css (so it follows dark mode). */
.eyebrow { margin: 0 0 .1rem; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.page-head { margin: .3rem 0 1rem; }
.push-right { margin-left: auto; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plain-list { list-style: none; margin: 0 0 .6rem; padding: 0; } .plain-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1rem; }

/* project cards on the list */
.project-card { padding: 0; overflow: hidden; }
.project-card .pc-cover { height: 110px; background-size: cover; background-position: center; border-bottom: 1px solid var(--line); }
.project-card .pc-body { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem .4rem; }
.project-card .pc-main { flex: 1; min-width: 0; }
.project-card .pc-address { display: flex; gap: .3rem; align-items: center; margin: .2rem 0 .5rem; }
.project-card .progress, .project-card .card-foot { margin-left: 1.2rem; margin-right: 1.2rem; } .project-card .card-foot { padding-bottom: 1rem; }
.project-card dl.meta { grid-template-columns: repeat(3, auto); justify-content: start; gap: .3rem 1.2rem; }
@media (max-width: 420px) { .project-card dl.meta { grid-template-columns: 1fr 1fr; } }

/* contacts & people */
.contact-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.contact-head .contact-id { flex: 1; min-width: 0; } .contact-head h3 { margin: 0; } .contact-head p { margin: 0; }
.contact-head .badge { align-self: flex-start; }
.person-card { display: flex; gap: 1rem; align-items: flex-start; }
.person-card .avatar { width: 56px; height: 56px; font-size: 1.1rem; }
.person-card.missing { border-style: dashed; background: transparent; box-shadow: none; }
.person-body { flex: 1; min-width: 0; } .person-body h3 { margin: 0 0 .4rem; }
.sub-head { margin-top: 1.6rem; }
.sub-money { grid-template-columns: repeat(4, 1fr) !important; gap: .5rem !important; } @media (max-width: 560px) { .sub-money { grid-template-columns: 1fr 1fr !important; } }
.status-select { width: auto; min-height: 44px; padding: .2rem 2rem .2rem .8rem; border-radius: 99px; font-weight: 650; font-size: .88rem; }
.status-select.st-active { background-color: var(--ok-bg); color: var(--ok); border-color: transparent; }
.status-select.st-on-hold { background-color: var(--warn-bg); color: var(--warn); border-color: transparent; }
.status-select.st-complete { background-color: var(--info-bg); color: var(--info); border-color: transparent; }
details.sub-links { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .3rem; }
details.sub-links summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .5rem; font-weight: 650; color: var(--ink-2); list-style: none; }
details.sub-links summary::-webkit-details-marker { display: none; }
.sub-linked h4 { margin: .6rem 0 .2rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.badge.expiry small { font-weight: 500; opacity: .85; }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.no-dot::before { display: none; }

/* KPIs, alerts, tables */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: .8rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: .85rem 1rem; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.kpi-label { font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.kpi-value { font-family: var(--font-display); font-size: 1.45rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-sub { font-size: .84rem; color: var(--muted); }
.kpi.ok .kpi-value { color: var(--ok); } .kpi.bad .kpi-value { color: var(--bad); }
.alerts { display: grid; gap: .5rem; grid-template-columns: minmax(0, 1fr); }
.alert { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: var(--radius-md); font-weight: 600; background: var(--surface-3); }
.alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.info { background: var(--info-bg); color: var(--info); }
.fin-table { width: 100%; font-variant-numeric: tabular-nums; font-size: .95rem; }
.fin-table th, .fin-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.fin-table thead th { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line-2); }
.fin-table tbody th { font-weight: 650; white-space: normal; }
.fin-table .num { text-align: right; } .fin-table .neg { color: var(--bad); font-weight: 650; } .fin-table .pos { color: var(--ok); }
.fin-table tr.total th, .fin-table tr.total td { border-top: 2px solid var(--line-2); font-weight: 750; background: var(--surface-2); }
.fin-table tr.row-over th { box-shadow: inset 4px 0 0 var(--bad); }
.fin-table tr.clickable { cursor: pointer; transition: background var(--dur); } .fin-table tr.clickable:hover { background: var(--surface-2); }
.fin-table tr.muted-row { color: var(--muted); }
.fin-table input { min-height: 44px; min-width: 16rem; }
.map-table td { width: 100%; }
.segmented.fin-nav { display: flex; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; margin-bottom: 1rem; scrollbar-width: none; }
.segmented.fin-nav::-webkit-scrollbar { display: none; }
.segmented.fin-nav .seg { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; text-decoration: none; min-height: 44px; padding: 0 .9rem; border-radius: 12px; font-weight: 650; }
.segmented.small .seg { min-height: 40px; padding: 0 .8rem; }
.row-card .amount-col { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; } .row-card .amount-col b { font-family: var(--font-display); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.row-card .card-head h3 { margin-bottom: .1rem; } .row-card p { margin: .1rem 0; }
.expense-row .exp-main { display: flex; gap: .9rem; align-items: center; }
.expense-row .exp-body { flex: 1; min-width: 0; } .expense-row h3 { margin: 0; }
.receipt-thumb { width: 64px; height: 64px; flex: none; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); display: grid; place-items: center; color: var(--muted); padding: 0; cursor: pointer; }
.receipt-thumb.empty { cursor: default; border-style: dashed; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; border-radius: 0; }
.check-field { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 500; cursor: pointer; }
.field.check { padding-top: .2rem; }
.inline-form { align-items: end; }

/* charts */
.bbars { display: grid; gap: .8rem; margin: 1rem 0 .4rem; }
.bbar-top { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; } .bbar-name { font-weight: 650; } .bbar-fig { color: var(--muted); font-variant-numeric: tabular-nums; }
.bbar-track { position: relative; height: 14px; background: var(--surface-3); border-radius: 99px; overflow: visible; margin-top: .25rem; }
.bbar-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .7s var(--ease); }
.bbar-committed { background: color-mix(in srgb, var(--accent-2) 50%, var(--surface-3)); } .bbar-actual { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.bbar-track .bbar-budget { left: auto; width: 3px; top: -4px; bottom: -4px; background: var(--ink); border-radius: 2px; margin-left: -1px; }
.bbar.over .bbar-fig { color: var(--bad); font-weight: 650; } .bbar.over .bbar-actual { background: linear-gradient(90deg, var(--accent), var(--bad)); }
.legend-line { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin: .6rem 0 0; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; } .sw.actual { background: var(--accent); } .sw.committed { background: color-mix(in srgb, var(--accent-2) 50%, var(--surface-3)); } .sw.budget { background: var(--ink); width: 3px; }
.donut { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.donut .ring { transform: none; } .donut .ring svg { transform: rotate(-90deg); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; flex: 1; min-width: 200px; } .legend li { display: flex; align-items: center; gap: .55rem; } .legend li b { margin-left: auto; font-variant-numeric: tabular-nums; } .legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.chart { margin: 0; } .chart svg { width: 100%; height: auto; display: block; overflow: visible; } .chart .ax { font: 600 11px var(--font); fill: var(--muted); }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: .5rem; } .chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 12px; height: 12px; border-radius: 4px; } .chart-legend i.hatched { background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 5px); border: 1px solid var(--muted); } .chart-legend i.line { height: 3px; border-radius: 2px; width: 16px; }
.profit-row { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.profit-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); } .profit-bar .cost { background: var(--accent); } .profit-bar .margin { background: var(--ok); } .profit-bar .loss { background: var(--bad); }

/* export */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: .7rem; margin-top: .6rem; }
.export-card { display: flex; gap: .8rem; align-items: center; text-align: left; padding: .9rem 1rem; min-height: 72px; border-radius: var(--radius-md); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; transition: all var(--dur) var(--ease); }
.export-card:hover { border-color: var(--accent); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.export-card .icon { color: var(--accent); } .export-card b { display: block; } .export-card small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.3; }

/* receipt scan */
.scan-start { text-align: center; } .scan-hero { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: .4rem; }
.scan-start .field { text-align: left; } .scan-start .btn-col { margin: 1rem 0; } .scan-start .btn.big { min-height: 60px; font-size: 1.1rem; }
.scan-preview { display: block; max-width: 100%; max-height: 46vh; margin: .6rem auto 1rem; border-radius: 14px; box-shadow: var(--shadow-2); }
.scan-progress { margin: .4rem 0 .6rem; }
.scan-grid { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 1.2rem; align-items: start; } @media (max-width: 719px) { .scan-grid { grid-template-columns: 1fr; } }
.scan-photo { margin: 0; position: sticky; top: 4.5rem; } .scan-photo img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-3); }
.scan-photo figcaption { font-size: .78rem; color: var(--muted); margin-top: .3rem; text-align: center; }
.conf { margin-left: .4rem; font-size: .7rem; } .check-stack { display: grid; gap: .1rem; }
.ocr-raw { margin: 1rem 0; } .ocr-raw summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; } .ocr-raw pre { background: var(--surface-2); padding: .8rem; border-radius: 12px; max-height: 220px; overflow: auto; font-size: .82rem; }

/* report */
.fin-report .report-head h1 { margin-bottom: .1rem; } .fin-report .report-table { margin-top: 1.4rem; break-inside: avoid; } .fin-report h2 { margin-top: 1.2rem; }
@media print { .fin-table th, .fin-table td { padding: .25rem .4rem; font-size: 9pt; } .kpi { box-shadow: none; } .fin-report .chart svg { max-height: 220px; } }

.fin, .fin > *, .fin .card, .fin .field, .fin .kpi, .people .card { min-width: 0; }
.fin .form .field.half { flex-basis: calc(50% - .5rem); }
.kpi-value { overflow-wrap: anywhere; }
