/* WAVHub Accounting additions on top of the shared Sales Tools design system (app.css + theme-3d.css). */

/* Roadmap items in the sidebar */
.nav a.soon { opacity: .62; }
.nav a.soon:hover { opacity: 1; }
.nav a .phase-chip { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--side-2); color: var(--side-muted); }
.nav a.active .phase-chip { color: #111; border-color: rgba(0, 0, 0, .25); }

/* Layout helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grow { flex: 1; min-width: 0; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.section-title:first-of-type { margin-top: 4px; }
.card-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.card > .toolbar { padding: 14px 16px 0; }
.form.one { grid-template-columns: minmax(0, 1fr); }
.btn.block { width: 100%; justify-content: center; }
.type-ico.big { width: 56px; height: 56px; border-radius: 14px; }
.type-ico.big svg { width: 28px; height: 28px; }

/* Search inside toolbars */
.search-in { position: relative; display: flex; align-items: center; }
.search-in svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-in input { padding-left: 32px; width: 280px; }

/* Tables */
table.t tr.archived td { opacity: .55; }
table.t td.mono, .mono { font-variant-numeric: tabular-nums; }
.chg { margin-top: 4px; font-size: 12px; line-height: 1.55; }
.chg > div { overflow-wrap: anywhere; }

/* KPI tiles */
a.kpi.link { display: block; color: inherit; text-decoration: none; }
a.kpi.link:hover { border-color: var(--brand); }
.kpi.pending { background: repeating-linear-gradient(-45deg, var(--card), var(--card) 10px, var(--surface-2) 10px, var(--surface-2) 20px); }
.kpi.pending .val { color: var(--border-2); }
.kpi.pending .ico { background: var(--surface-3); color: var(--muted); }

/* Setup checklist */
.card > .progress { margin: 12px 18px 4px; }
.progress > span { display: block; height: 100%; background: var(--brand-grad); border-radius: 6px; transition: width .4s; }
.setup-list { padding: 6px 8px 10px; }
.setup-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.setup-item:hover { background: var(--hover); text-decoration: none; }
.setup-item svg { width: 18px; height: 18px; color: var(--border-2); flex: none; }
.setup-item.done { color: var(--muted); text-decoration: line-through; }
.setup-item.done svg { color: var(--ok); }
.setup-item .go { margin-left: auto; color: var(--muted); }

/* Simple lists inside cards */
.card .list { padding: 4px 0; }
.row-link { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.row-link:last-child { border-bottom: 0; }
a.row-link:hover { background: var(--hover); text-decoration: none; }
.row-link > svg { width: 16px; height: 16px; flex: none; }
.row-link .num { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Venue group cards */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.group-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.group-card.archived { opacity: .6; }
.gc-top { display: flex; gap: 12px; align-items: center; }
.gc-notes { margin: 0; }
.gc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; background: var(--surface-2); border-radius: 10px; padding: 10px 6px; }
.gc-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.gc-stats span { font-size: 11px; color: var(--muted); }

/* Import wizard */
.wiz-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.wiz-steps span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 3px 10px 3px 4px; border-radius: 20px; background: var(--surface-3); }
.wiz-steps b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--card); font-size: 11px; }
.wiz-steps span.on { background: var(--brand-100); color: var(--text); font-weight: 650; }
.wiz-steps span.on b { background: var(--brand); color: var(--on-brand); }
.wiz-steps span.done b { background: var(--ok); color: #fff; }
.seg button { background: var(--card); border: 0; border-right: 1px solid var(--border); padding: 9px 16px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.seg button:last-child { border-right: 0; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--brand); color: var(--on-brand); }
.dropzone { border: 2px dashed var(--border-2); border-radius: 14px; padding: 34px 20px; text-align: center; cursor: pointer; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); }
.dropzone svg { width: 36px; height: 36px; color: var(--brand-strong, var(--brand)); }
.map-table select { min-width: 220px; }

/* Users */
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.role-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.role-card > div { display: flex; align-items: center; justify-content: space-between; }
.role-card .n { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.role-card p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

/* Settings: EWT table */
.ewt-table input { width: 100%; }

/* Roadmap placeholder */
.soon-card { display: flex; gap: 20px; padding: 24px; align-items: flex-start; max-width: 760px; }
.soon-card h3 { font-size: 17px; margin-bottom: 6px; }
.soon-card p { margin: 0 0 14px; color: var(--text-2); }
.phase-line { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.phase-line span { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--surface-3); color: var(--muted); font-weight: 600; }
.phase-line span.done { background: var(--ok-bg); color: var(--ok); }
.phase-line span.on { background: var(--brand); color: var(--on-brand); }

@media (max-width: 960px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .search-in input { width: 100%; }
  .search-in { flex: 1 1 100%; }
  .soon-card { flex-direction: column; }
}

/* ---- Revenue streams: one validated categorical slot each (dataviz reference palette, slots 1–4) ---- */
:root { --s-pa: #2a78d6; --s-after: #eb6834; --s-prog: #1baf7a; --s-sub: #eda100; }
:root[data-theme="dark"] { --s-pa: #3987e5; --s-after: #d95926; --s-prog: #199e70; --s-sub: #c98500; }
.stream-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.stream-tag svg { width: 14px; height: 14px; color: var(--c); }
.stream-tag::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.stream-tag svg { display: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-box { position: relative; height: 260px; }

/* Contracts */
.ref { font-variant-numeric: tabular-nums; font-weight: 700; }
table.t td.money, table.t th.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.neg { color: var(--bad); }
.draft-banner { border: 1px dashed var(--border-2); }
.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head h1 { font-size: 22px; font-weight: 750; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.detail-head .meta { color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.detail-head .meta a { color: var(--link); }
.detail-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; }
.terms > div span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.terms > div b { font-weight: 600; }
.ms-list { display: grid; gap: 8px; }
.ms { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.ms > svg { width: 20px; height: 20px; color: var(--border-2); }
.ms.done > svg { color: var(--ok); }
.ms.late > svg { color: var(--bad); }
.ms .when { font-size: 12px; color: var(--muted); }
.lines-edit td { padding: 6px 6px; vertical-align: top; }
.lines-edit input, .lines-edit select { width: 100%; min-width: 0; }
.lines-edit .w-qty { width: 80px; } .lines-edit .w-amt { width: 140px; } .lines-edit .w-type { width: 140px; }
.type-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.type-pick button { text-align: left; border: 2px solid var(--border); border-radius: 14px; padding: 16px; background: var(--card); cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.type-pick button:hover { border-color: var(--brand); }
.type-pick button b { font-size: 14.5px; }
.type-pick button small { color: var(--muted); }
.type-pick button svg { width: 22px; height: 22px; color: var(--c); }
.sum-row { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }
.sum-row b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bar-mini { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar-mini > span { display: block; height: 100%; border-radius: 4px; background: var(--ok); }
.bar-mini.warn > span { background: var(--warn); } .bar-mini.bad > span { background: var(--bad); }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); } .dots i.on { background: var(--ok); }

/* Inventory & payroll */
.serial-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; max-height: 180px; overflow: auto; }
.serial-pick .chk { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* Reports */
table.pnl tr.grp td { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.pnl tr.sub td { border-top: 1px solid var(--border-2); }
table.pnl tr.total-row td { border-top: 2px solid var(--text); font-size: 14px; }
table.pnl td.total, table.pnl th:last-child { background: var(--surface-2); }
.print-title { display: none; }
@media print {
  .tabs, .page-head .actions, .toolbar, .pager, details summary, .btn { display: none !important; }
  .print-title { display: block; font-size: 16px; font-weight: 700; margin-bottom: 10px; }
  .card { box-shadow: none !important; border: 1px solid #ccc; }
  table.t { font-size: 10.5px; } details { display: block; } details > * { display: block !important; }
  body { background: #fff !important; }
}

/* ---- Phase 3: close, approvals, Juan import ---- */
label.row-link.clickable { cursor: pointer; }
label.row-link.clickable:hover { background: var(--hover); }
.row-link input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--brand, var(--ok)); }
.ok-ic { color: var(--ok); flex: none; }
.warn-ic { color: var(--warn); flex: none; }
.ok-text { color: var(--ok); }
.tabs.inner { padding: 0 12px; margin-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.mini-stat b { font-size: 1.35rem; }
.mini-stat span { font-size: .78rem; color: var(--muted); }
.mini-stat.ok b { color: var(--ok); } .mini-stat.warn b { color: var(--warn); } .mini-stat.bad b { color: var(--bad); }
@media (max-width: 560px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ---- Phase 4: AI ---- */
.meter { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; }

/* ---- Ask the CFO ---- */
.ask-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.ask-main { display: flex; flex-direction: column; min-height: 60vh; }
.ask-log { flex: 1; overflow-y: auto; max-height: 64vh; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ask-q, .ask-a { display: flex; gap: 10px; align-items: flex-start; }
.ask-q { align-self: flex-end; max-width: 85%; background: var(--hover); border-radius: 14px 14px 4px 14px; padding: 9px 13px; }
.ask-a { max-width: 100%; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 10px 14px; }
.ask-a.bad { border-color: var(--bad); }
.ask-a p { margin: 0 0 6px; line-height: 1.5; } .ask-a ul { margin: 0 0 6px 18px; padding: 0; } .ask-a .table-wrap { margin: 6px 0; }
.ask-q > svg, .ask-a > svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.ask-a > svg { color: var(--brand-ink, var(--brand)); }
.ask-src { font-size: 12.5px; color: var(--muted); margin: 6px 0 2px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ask-src svg { width: 14px; height: 14px; }
.ask-empty { text-align: center; margin: auto; max-width: 620px; }
.ask-empty > svg { width: 34px; height: 34px; color: var(--muted); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { border: 1px solid var(--border); background: var(--card, transparent); color: var(--text); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--hover); }
.ask-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.ask-form textarea { flex: 1; resize: vertical; min-height: 44px; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@media (max-width: 900px) { .ask-grid { grid-template-columns: 1fr; } .ask-log { max-height: none; } }
.ai-sugg { display: flex; gap: 10px; align-items: center; border: 1px dashed var(--brand); background: var(--hover); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.ai-sugg > svg { flex: none; width: 18px; height: 18px; }
.badge.as-btn { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; margin-top: 3px; display: inline-flex; gap: 4px; align-items: center; }
.badge.as-btn svg { width: 12px; height: 12px; }
.outlook-text { font-size: 15px; line-height: 1.55; margin-top: 0; }
.outlook-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 10px 0 4px; display: flex; gap: 6px; align-items: center; }
.outlook-h svg { width: 14px; height: 14px; }
.outlook ol, .outlook ul { margin: 0 0 4px 18px; padding: 0; line-height: 1.5; }
.dup-warn { color: var(--bad); display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.dup-warn svg { width: 13px; height: 13px; flex: none; }
