/* Hailey's Admin — Hailey's brand (rose #9c3a57, Young Serif + Figtree). No pills: status = a coloured word. */
:root {
  --bg: #faf7f5; --panel: #ffffff; --ink: #2a2326; --muted: #6f6468; --line: #e8dfdc;
  --rose: #9c3a57; --rose-ink: #ffffff; --rose-soft: #f6e9ed; --ok: #2f7a4a; --bad: #b3261e; --warn: #9a6200;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1719; --panel: #242022; --ink: #f1eaec; --muted: #b0a4a8; --line: #3a3235;
    --rose: #d97a98; --rose-ink: #1b1719; --rose-soft: #3a2730; --ok: #6cc28b; --bad: #ff8a80; --warn: #e2b04a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Figtree, system-ui, sans-serif; }
a { color: var(--rose); }
h1, h2, .brand { font-family: "Young Serif", Georgia, serif; font-weight: 400; }
h1 { font-size: 28px; margin: 4px 0 6px; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 20px 0 8px; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 13px; } .sub { font-size: 12.5px; color: var(--muted); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.nowrap { white-space: nowrap; } .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } .cap { text-transform: capitalize; }

.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-size: 20px; color: var(--ink); text-decoration: none; } .brand span, .signin h1 span { color: var(--rose); }
.top nav { display: flex; gap: 18px; } .top nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 4px 0; border-bottom: 2px solid transparent; }
.top nav a.on { color: var(--ink); border-bottom-color: var(--rose); }
.who { margin-left: auto; font-size: 13px; color: var(--muted); }
.qa-tag { color: var(--warn); font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 24px 60px; }

input, select, button { font: inherit; color: inherit; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
input:focus, select:focus { outline: 2px solid var(--rose); outline-offset: 1px; border-color: transparent; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 10px 0; }
label input, label select { margin-top: 4px; font-weight: 400; color: var(--ink); }
button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; }
button:hover:not(:disabled) { border-color: var(--rose); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--rose); color: var(--rose-ink); border-color: var(--rose); }
button.link { border: 0; background: none; padding: 0; color: var(--rose); font-weight: 600; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

.signin { max-width: 380px; margin: 12vh auto; padding: 0 16px; }
.signin form { margin-top: 12px; }

.bar { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.bar input { max-width: 520px; font-size: 16px; padding: 11px 14px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; }
.leads th, .leads td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.leads th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--panel); position: sticky; top: 0; }
.leads tbody tr { cursor: pointer; } .leads tbody tr:hover, .leads tbody tr:focus { background: var(--rose-soft); outline: none; }
.leads a.name { color: var(--ink); font-weight: 600; text-decoration: none; }
.st { font-weight: 600; } .st.sold { color: var(--ok); }
#more { margin: 14px 0; }

.file-head { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid > * { min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid > .card { margin-bottom: 0; } .grid + .card, .grid + section { margin-top: 18px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv span { color: var(--muted); font-size: 13px; } .kv b { font-weight: 500; overflow-wrap: anywhere; }
.note { background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; font-size: 14px; }
.plain { list-style: none; padding: 0; margin: 6px 0; } .plain li { padding: 4px 0; }
details summary { cursor: pointer; color: var(--rose); font-weight: 600; margin-top: 10px; }
.stack button { margin-top: 6px; }
.inline { display: flex; gap: 8px; align-items: center; margin: 8px 0; } .inline.wrap { flex-wrap: wrap; }
.inline input, .inline select { width: auto; flex: 1 1 110px; min-width: 0; }
.inline label.pct { display: flex; align-items: center; gap: 6px; margin: 0; } .inline label.pct input { width: 70px; flex: none; margin: 0; }
.mini { margin: 4px 0; } .mini td, .mini th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; } .mini th { font-size: 12.5px; color: var(--muted); }
.mini td.num, .mini th.num { text-align: right; }
tr.off td, li.off { color: var(--muted); }
.tabs { display: flex; gap: 18px; margin: 4px 0 8px; }
.tabs button { border: 0; background: none; padding: 4px 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--rose); }
.breakdown { font-size: 15px; } .breakdown td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.breakdown tr.sum td { font-weight: 700; border-top: 2px solid var(--ink); }
.money .breakdown + button, .money .breakdown + p { margin-top: 12px; }
.log { list-style: none; padding: 0; margin: 0; } .log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.statuses { padding-left: 22px; } .statuses li { padding: 4px 0; }
.only-phone { display: none; }
.statuses .st-name { width: 260px; display: inline-block; padding: 6px 9px; } .statuses .ctl { margin-left: 10px; display: inline-flex; gap: 10px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); } #toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 760px) {
  .top { padding: 10px 16px; gap: 12px; } main { padding: 14px 16px 50px; }
  .who { width: 100%; margin: 0; }
  .grid { grid-template-columns: 1fr; }
  .leads .c-phone, .leads .c-src, .leads .c-rep, .leads .c-date { display: none; }
  .leads .only-phone { display: block; }
  .leads th, .leads td { padding: 10px 8px; }
  button, button.link { min-height: 44px; } button.link { padding: 0 6px; }
  input, select { min-height: 44px; }
  .statuses .ctl button.link { min-width: 44px; } .statuses .ctl .up, .statuses .ctl .down { font-size: 18px; }
  table.settings td.num { text-align: left; }
  table.settings, table.settings tbody, table.settings tr, table.settings td { display: block; width: 100%; }
  table.settings thead { display: none; }
  table.settings tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.settings td { border: 0; padding: 2px 0; text-align: left; overflow-wrap: break-word; }
  table.settings td[data-l]:not([data-l="Name"])::before { content: attr(data-l) ": "; color: var(--muted); font-size: 13px; }
  table.settings td[data-l="Name"] { font-weight: 600; }
  .inline:not(.wrap) { flex-wrap: wrap; }
  .statuses .st-name { width: 100%; }
  table.mini:not(.settings) { display: block; overflow-x: auto; }
  table.mini td { word-break: normal; overflow-wrap: normal; }
  table.mini td.num, table.mini td:last-child { white-space: nowrap; }
  table.settings { font-size: 13.5px; }
}
