/* ProRealty back office — reuses the site tokens from style.css */
body.admin { background: var(--bg); }
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: #211E1A; color: #E9E2D6; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand img { width: 44px; height: 43px; }
.side .brand-name { font-size: 1.2rem; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .group { font-size: 0.68rem; letter-spacing: 0.14em; color: #8B8377; padding: 12px 10px 4px; text-transform: uppercase; }
.side button { all: unset; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 6px; font-size: 0.92rem; color: #E9E2D6; min-height: 24px; }
.side button:hover { background: #2B2621; }
.side button[aria-current="page"] { background: #3A342C; color: #E7C878; font-weight: 600; }
.side button:focus-visible { outline: 2px solid #C9972E; }
.side .count { font-size: 0.72rem; background: #3A342C; color: #E7C878; border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.side .foot { margin-top: auto; font-size: 0.76rem; color: #8B8377; display: flex; flex-direction: column; gap: 6px; }
.side .foot a { color: #C9C2B4; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 12px var(--gutter); }
  .side nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side .group, .side .foot { display: none; }
  .side button { white-space: nowrap; }
}
.main { padding: 24px var(--gutter) 64px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.topline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.topline h1 { font-size: 1.7rem; }
.mode { font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--sand); color: var(--gold-ink); }
.mode.live { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-family: var(--font-display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 0.8rem; color: var(--muted); }
.kpi.alert { border-color: var(--warn); }
.panels { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 700; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 0.86rem; }
.bar .track { height: 10px; background: var(--sand); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--gold); border-radius: 6px; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.9rem; align-items: center; }
.list li:first-child { border-top: 0; }
.list .meta { color: var(--muted); font-size: 0.8rem; }
.empty { color: var(--muted); font-size: 0.88rem; }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--sand); color: var(--ink); white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { min-height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font: inherit; background: var(--surface); color: var(--ink); }
.toolbar input { flex: 1 1 220px; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 0.9rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tbl th { text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-ink); background: var(--sand); padding: 10px 12px; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; max-width: 280px; overflow-wrap: anywhere; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: color-mix(in srgb, var(--gold) 8%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--sand); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.col h3 { font-family: var(--font-body); font-size: 0.86rem; display: flex; justify-content: space-between; }
.lcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; }
.lcard b { font-size: 0.95rem; }
.lcard .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.lcard select { font: inherit; font-size: 0.8rem; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.lcard a { font-size: 0.8rem; font-weight: 600; color: var(--gold-ink); }
.day { display: flex; flex-direction: column; gap: 8px; }
.day h3 { font-family: var(--font-body); font-size: 0.95rem; color: var(--gold-ink); }
.overlay { position: fixed; inset: 0; background: rgba(15, 13, 10, 0.55); display: flex; justify-content: flex-end; z-index: 80; }
.overlay[hidden] { display: none; }
.drawer { background: var(--bg); width: min(560px, 100%); height: 100%; overflow-y: auto; padding: 22px var(--gutter) 40px; display: flex; flex-direction: column; gap: 16px; }
.drawer .grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.drawer .actions { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; bottom: -40px; background: var(--bg); padding-block: 12px; }
.gate { max-width: 460px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #211E1A; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 0.9rem; z-index: 90; }
.toast[hidden] { display: none; }
.linkout { word-break: break-all; font-size: 0.86rem; background: var(--sand); padding: 10px 12px; border-radius: 6px; }

/* Delete with confirm */
.btn.danger { border-color: #B4432F; color: #B4432F; margin-left: auto; }
.btn.danger.confirm { background: #B4432F; color: #fff; }
.drawer .actions { flex-wrap: wrap; }
.panel .grid2 { display: grid; gap: 12px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.panel .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.panel .form .field textarea { min-height: 72px; }
