/* ClearView Consolidated Site Solutions - additions to css/app.css (the shared ClearView stylesheet). */

/* ---------- Brand: ClearView mark + product name (no client logo on this site) ---------- */
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; text-align: center; }
.brand-name b { display: block; }
.brand-name b { font-weight: 800; }
.sidebar-brand .brand img { height: 56px; }
.auth-brand .brand img { height: 72px; }
.side-company {
  margin: 0 8px 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--hover);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Page header with actions ---------- */
.page-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-bar h2 { margin: 0; font-size: 20px; font-weight: 800; }
.page-bar .actions { margin-top: 0; }

/* ---------- Stats: 4 across on wide screens ---------- */
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat .sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
@media (max-width: 980px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Data tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.data-table tbody tr:hover { background: #f9fafb; }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; }
.data-table a.row-link { font-weight: 700; color: #047857; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .table-scroll { border-radius: var(--radius); }

/* ---------- Status chips (format.asp StatusChip) ---------- */
.chip-pending { background: #fef3c7; color: #92400e; }
.chip-info    { background: #e0f2fe; color: #075985; }
.chip-warn    { background: #ffedd5; color: #9a3412; }
.chip-bad     { background: #fee2e2; color: #991b1b; }
.chip-draft   { background: var(--hover); color: var(--muted); }

/* ---------- Getting-started checklist ---------- */
.todo { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.todo li { display: flex; align-items: center; gap: 10px; }
.todo .tick {
  flex: 0 0 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); font-size: 12px; font-weight: 800; color: #fff;
}
.todo li.done .tick { background: var(--brand); border-color: var(--brand); }
.todo li.done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo a { color: #047857; font-weight: 700; }

/* ---------- Two-column dashboard ---------- */
.dash-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 980px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } }
.card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Misc ---------- */
.pad { padding: 12px; }
.flash { margin-bottom: 12px; }
.viewas-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: #fef3c7; border-bottom: 1px solid #fde68a; color: #92400e; font-size: 14px;
}
.viewas-bar form { margin: 0; }

/* ---------- Forms & tables used across the portals ---------- */
.section-gap { margin-top: 12px; }
.section-gap:first-child { margin-top: 0; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.input-sm { min-height: 34px; padding: 5px 8px; font-size: 14px; }
.input.money { width: 92px; text-align: right; }
.input.qty { width: 64px; text-align: right; }
.price-table td { padding-top: 6px; padding-bottom: 6px; }
.price-table select.input-sm { width: auto; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid .span2 { grid-column: 1 / -1; } }
.form-card-wide { max-width: 980px; }
.form-section { margin: 18px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.form-section:first-child { margin-top: 0; }
.sticky-save {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 12px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%);
}
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d1d5db; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.inline-form { display: inline; margin: 0; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filters .field { min-width: 160px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { position: relative; padding-left: 18px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline li.internal::before { background: #f59e0b; }
.timeline .when { font-size: 12px; color: var(--muted); }
.money-total { font-size: 22px; font-weight: 800; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--muted); border: 1px solid transparent; }
.tabs a.active { background: var(--card); border-color: var(--border); color: var(--text); box-shadow: var(--shadow); }
.tabs .count { margin-left: 4px; }

/* ---------- Builder ordering (builder/order.asp, js/order.js) ---------- */
.step-title { margin: 18px 2px 10px; font-size: 16px; font-weight: 800; }
.step-title:first-child { margin-top: 0; }
.site-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.site-card { display: flex; flex-direction: column; gap: 2px; }
.site-card:hover { border-color: var(--brand); }
.site-card-new { border-style: dashed; box-shadow: none; justify-content: center; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.order-side { position: sticky; top: 76px; }
.order-site { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.order-site .k { color: var(--muted); font-size: 13px; }
.bundle-row { display: flex; gap: 10px; flex-wrap: wrap; }
.bundle { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer; font: inherit; min-width: 200px; }
.bundle:hover { border-color: var(--brand); }
.bundle.is-added { background: var(--brand-soft); border-color: var(--brand); }
.cat-block { margin-bottom: 12px; }
.cat-desc { text-transform: none; letter-spacing: 0; font-weight: 500; }
.item-list { display: flex; flex-direction: column; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: 0; }
.item-row.is-picked { background: #f0fdf8; }
.item-info, .item-price { display: flex; flex-direction: column; gap: 2px; }
.item-price { text-align: right; }
.warn-text { color: #b45309; }
.stepper { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.stepper .input.qty { width: 52px; text-align: center; }
.order-summary h3 { margin-bottom: 10px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.summary-lines { margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.summary-line { display: flex; justify-content: space-between; gap: 8px; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--border); }
.summary-total strong { font-size: 22px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 46px; padding: 10px 20px; font-size: 16px; }
@media (max-width: 980px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .order-side { position: static; }
}
@media (max-width: 640px) {
  .item-row { grid-template-columns: minmax(0, 1fr) auto; }
  .item-price { grid-column: 1; text-align: left; }
  .stepper { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Vendor jobs ---------- */
.job-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.job-card h3 { margin: 10px 0; font-size: 16px; }
.job-card.is-new { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.job-card .kv { grid-template-columns: 150px minmax(0, 1fr); }
.accept-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.form-card-narrow { max-width: 620px; }
.nowrap { white-space: nowrap; }
.pre-line { white-space: pre-line; }
.bundle-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 14px; }
.bundle-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.data-table tr.muted td { color: var(--muted); }
.data-table .row { flex-wrap: nowrap; }
.job-card h3 { text-transform: none; letter-spacing: 0; }

/* ---------- Invoices & payout statements (invoice.asp, payout.asp) ---------- */
.invoice-doc { max-width: 1000px; padding: 28px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--text); }
.inv-brand { flex-direction: row; gap: 10px; align-items: center; }
.inv-brand img { height: 48px; }
.inv-brand .brand-name { text-align: left; font-size: 16px; }
.inv-meta h2 { margin: 0 0 8px; font-size: 22px; }
.inv-from { margin-top: 8px; line-height: 1.5; }
.inv-meta .kv { grid-template-columns: 120px auto; }
.inv-to { margin: 18px 0; font-size: 14px; line-height: 1.5; }
.inv-table tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
.inv-table tfoot tr:first-child td { border-top: 1px solid var(--border); }
.inv-table .inv-total td { font-weight: 800; font-size: 15px; }
.inv-group td { background: var(--hover); font-weight: 800; font-size: 13px; }
.inv-foot { margin-top: 16px; }

/* ---------- Report bars ---------- */
.bar-col { width: 30%; min-width: 120px; }
.bar { display: block; height: 10px; border-radius: 999px; background: var(--brand); position: relative; overflow: hidden; }
.bar-cost { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-dark); opacity: .55; }

@media print {
  .sidebar, .topbar, .no-print, .viewas-bar, .scrim, .flash { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .invoice-doc { padding: 0; }
}
