/* Shared components (platform-owned): status chips, page header actions, detail button bar, report page, records sections
   (documents / comments / history), selectors, photo button, in-progress placeholder, settings landing + category cards. */

/* status chips (spec 16.5) – text + colour, never colour alone */
.st { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--st-text); }
.st-draft { background: var(--st-draft); } .st-open { background: var(--st-open); } .st-done { background: var(--st-done); } .st-bad { background: var(--st-bad); }
.st-info { background: var(--st-info); } .st-neutral { background: var(--st-neutral); }
/* workflow steps (Draft → Active → Terminated) and the right-side workflow navigation */
.st-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; } .st-steps .other .st { opacity: .55; } .st-arrow { color: var(--text-3); font-size: 12px; }
.detail-side { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--gap); align-items: start; }
.wf-list { list-style: none; margin: 0; padding: 4px 16px 14px; display: grid; gap: 2px; }
.wf-list a { display: block; padding: 6px 0; color: var(--text-2); font-size: var(--fs-sm); text-decoration: none; } .wf-list a:hover { color: var(--primary); }
.wf-list li.cur a { color: var(--primary); font-weight: 650; }
@media (max-width: 960px) { .detail-side { grid-template-columns: minmax(0, 1fr); } }

/* detail pages */
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.detail-actions [data-act="back"] { margin-right: auto; }
.crumbs span[aria-hidden] { opacity: .6; }

/* report (list) pages */
.report-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-bottom: 12px; }
.report-bar .search-in { max-width: 320px; flex: 1 1 220px; height: 38px; }
.report-bar .input:not(.search-in) { width: auto; height: 38px; font-size: var(--fs-sm); }
.report .tbl tr.click:hover td { background: var(--primary-soft); }
.report .chip { height: 30px; }

/* records: documents, comments, history */
.doc-bar { margin-bottom: 12px; } .doc-bar .search-in { flex: 1 1 200px; max-width: 320px; } .doc-bar select.input { width: auto; }
.doc-list li { display: flex; align-items: center; gap: 12px; }
.doc-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.doc-ic { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; flex: none; }
.doc-main { flex: 1; min-width: 0; } .doc-main a { color: var(--text); display: block; } .doc-main b { display: block; }
.cmt-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 12px; }
.cmt-form textarea.input { min-height: 44px; }
.cmt-to-tenant { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; min-height: 32px; }
.cmt-tenant { display: inline-flex; gap: 4px; align-items: center; color: var(--info, var(--text-2)); margin-top: 2px; }
.cmt-list li { padding: 10px 0; } .cmt-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.aud .aud-what span { display: inline-block; margin-right: 10px; font-size: 12px; color: var(--text-3); } .aud .aud-what .k { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); }
.aud .mini { display: block; font-size: 11px; color: var(--text-3); }
@media (max-width: 560px) { .cmt-form { grid-template-columns: 1fr; } }

/* selector (customer / property / employee) */
.sel { position: relative; }
.sel-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; }
.sel-it { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; } .sel-it.on, .sel-it:hover { background: var(--surface-3); }

/* photo capture */
.photo-btn { cursor: pointer; } .photo-btn input { display: none; }

/* in-progress placeholder */
.in-progress-area { display: block; margin-top: 8px; }

/* settings landing (spec 15.0: four equal cards) and category cards (spec 15.2) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s, transform .12s; cursor: pointer; text-align: left; font: inherit; }
.tile:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.tile-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; }
.tile-ic .icon { stroke: var(--primary); width: 22px; height: 22px; }
.tile b { font-size: var(--fs-md); } .tile small { color: var(--text-3); font-size: var(--fs-sm); }
.tile .n { font-size: var(--fs-xs); color: var(--text-3); }
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; } .cat-grid .tile { padding: 14px; gap: 6px; }
.cat-msg { margin: 16px 0; }

/* home quick cards (shared look) */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }

/* section headers with icon (spec 16.6) */
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; } .card-head h2 .icon { stroke: var(--primary); }
.topbar .menu-btn { display: none; }
@media (max-width: 960px) { .topbar .menu-btn { display: inline-flex; } body.own-mode .topbar .menu-btn { display: none; } }


/* ---------- price table (components/money.js) ---------- */
.price-tbl td.r, .price-tbl th.r { text-align: right; } .price-tbl tfoot td { border-top: 1px solid var(--border-strong); }
.tax-breakdown { margin-top: 6px; }
/* ---------- actionable alerts (components/alerts.js) – tinted background + icon, no coloured left border ---------- */
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.alert-item.sev-bg-critical { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 22%, var(--border)); }
.alert-item.sev-bg-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 22%, var(--border)); }
.alert-item.sev-bg-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 18%, var(--border)); }
.alert-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; }
.sev-bg-critical .alert-ic { color: var(--danger); } .sev-bg-warning .alert-ic { color: var(--warning); } .sev-bg-info .alert-ic { color: var(--info); }
.alert-main { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; } .alert-main a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.alert-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.alert-list.compact .alert-item { padding: 10px 12px; }
/* document section (components/records.js): upload with category picker, row actions preview / download / edit / delete */
.doc-up { gap: 6px; flex-wrap: wrap; } .doc-up select.input { max-width: 220px; }
.doc-list .doc-acts { gap: 2px; flex-shrink: 0; }
.doc-cat { color: var(--text-2); }
@media (max-width: 560px) {
  .doc-up { width: 100%; } .doc-up select.input { flex: 1 1 auto; max-width: none; }
  .doc-list li { flex-wrap: wrap; } .doc-list .doc-main { flex-basis: calc(100% - 60px); } .doc-list .doc-acts { margin-left: auto; }
}
