/* ============================================================================
   hub.css — the Hub shell, layered over style.css

   style.css keeps working: app.js renders .card, .row, .badge, tables and
   buttons and those all still apply. What this file does is retheme the
   variables those rules already use, and replace the page chrome — the old
   tab bar becomes a sidebar.

   Loaded after style.css, so it wins where they overlap.
   ========================================================================== */

:root {
  /* Hub palette — carried over from the assistant design */
  --blue: #3465dc;
  --blue-dark: #2a55bd;
  --pale: #edf3ff;
  --ink: #182033;
  --muted-ink: #707b8e;
  --line: #e5e9f0;
  --shell: #f5f7fb;
  --shadow: 0 1px 2px #1c2d5510, 0 8px 28px #1c2d5510;

  /* Retheme what style.css already uses, so existing markup follows along */
  --navy: #182033;
  --navy-2: #24304a;
  --accent: #1b9a79;
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e5e9f0;
  --text: #182033;
  --muted: #707b8e;
  --surface-1: #f2f5fa;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body { background: var(--shell); color: var(--ink); }
svg { flex-shrink: 0; }

/* ---------------------------------------------------------------- login -- */
#loginScreen {
  background: linear-gradient(158deg, #1b2540 0%, #24356a 55%, #2f4b8f 100%);
}
.login-card {
  border-radius: 18px;
  padding: 2.25rem 2rem 2rem;
  box-shadow: 0 24px 64px #0b132a55;
}
.login-mark {
  width: 46px; height: 46px; margin: 0 auto .9rem;
  border-radius: 14px; background: var(--blue); color: #fff;
  display: grid; place-items: center;
}
.login-mark svg { width: 24px; height: 24px; }
.login-card h1 { font-size: 1.15rem; letter-spacing: -.01em; }
.login-card .muted { margin-bottom: 1.25rem; }
.pin-dots span { border-color: #d6dce8; }
.pin-dots span.filled { background: var(--blue); border-color: var(--blue); }
.pin-pad button {
  background: #fff; border-color: #e2e7f0; font-size: 1.15rem;
  padding: 15px 0; transition: background .12s, border-color .12s;
}
.pin-pad button:hover { border-color: var(--blue); background: var(--pale); }
.pin-pad button:active { background: #dfe8fb; }

/* ----------------------------------------------------------------- shell -- */
.hub {
  min-height: 100vh;
  display: grid;
  grid-template: 64px 1fr / 232px 1fr;
  background: var(--shell);
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 232px 1fr auto;
  align-items: center;
  gap: 0;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 0;
  position: sticky; top: 0; z-index: 30;
}

.brandwrap {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px; height: 64px;
}
.brandwrap > i {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--blue); color: #fff; flex-shrink: 0;
}
.brandwrap > i svg { width: 19px; height: 19px; }
.brand { font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: -.01em; }

.top-actions {
  grid-column: 3;
  display: flex; align-items: center; gap: 12px;
  padding-right: 20px;
}
.whoami { font-size: 13px; color: var(--muted-ink); }
.logout-btn {
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  padding: .42rem .85rem; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.logout-btn:hover { border-color: #c9d3e4; background: #f7f9fc; }

.hamb { display: none; }

/* --------------------------------------------------------------- sidebar -- */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 12px 20px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.nav-title {
  font-size: 9px; font-weight: 800; letter-spacing: .13em;
  color: #9ba3b2; padding: 0 10px; margin-bottom: 8px; display: block;
}
body.nav-grouped .nav-workspace-label { display: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav .tab-btn,
.sidebar .setup-btn {
  --tab-tint: transparent;
}
.sidebar nav .tab-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 9px;
  border: none;
  background: var(--tab-tint, transparent);
  color: #46506a; font-size: 13.5px; cursor: pointer;
  transition: background .12s, color .12s, box-shadow .12s;
}
.sidebar nav .tab-btn svg { width: 17px; height: 17px; color: #8b94a8; }
.sidebar nav .tab-btn span { flex: 1; }
.sidebar nav .tab-btn:hover { filter: brightness(0.97); color: var(--ink); }
.sidebar nav .tab-btn.active {
  background: var(--tab-tint, var(--pale));
  color: var(--blue); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--blue);
}
.sidebar nav .tab-btn.active svg { color: var(--blue); }

.nav-cat {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 8px;
  border: 0;
}
.nav-cat > summary.nav-group {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px 6px;
  margin: 0 0 2px;
  border-radius: 8px;
  color: #7b8496;
  user-select: none;
}
.nav-cat > summary.nav-group::-webkit-details-marker { display: none; }
.nav-cat > summary.nav-group::after {
  content: "";
  float: right;
  width: 0; height: 0;
  margin-top: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #b0b7c6;
  transition: transform .12s;
}
.nav-cat:not([open]) > summary.nav-group::after { transform: rotate(-90deg); }
.nav-cat > summary.nav-group:hover { color: var(--ink); background: #f7f9fc; }

.nav-new {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #1b9a79; background: #e4f4ef;
  padding: 2px 6px; border-radius: 999px;
}

.setup-panel {
  width: auto; flex-shrink: 0; position: static;
  padding: 0; margin-top: 22px;
  display: flex; flex-direction: column; gap: 2px;
}
.setup-panel-label { margin-bottom: 8px; }
.sidebar .setup-btn {
  display: flex; align-items: center;
  text-align: left; background: var(--tab-tint, transparent); border: none;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: #5a6478;
  width: 100%;
}
.sidebar .setup-btn:hover { filter: brightness(0.97); color: var(--ink); }
.sidebar .setup-btn.active {
  background: var(--tab-tint, var(--pale)); color: var(--blue); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--blue);
}

.scrim {
  position: fixed; inset: 0; z-index: 45;
  border: 0; background: #121a2d55; cursor: pointer;
}

/* --------------------------------------------------------------- content -- */
.content { overflow-y: auto; }
.app-body { display: block; max-width: none; padding: 0; margin: 0; }
main#mainContent {
  padding: 26px 28px 60px;
  max-width: 1120px; margin: 0 auto;
}
main#mainContent:has(.sh-hub) {
  max-width: 1280px;
}

/* ------------------------------------------------------------ components -- */
.card {
  border-radius: 12px; border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 1.15rem 1.25rem;
}
.section-title { font-size: 1rem; letter-spacing: -.01em; }

button.primary {
  background: var(--blue); border-radius: 9px; font-weight: 500;
  transition: background .12s;
}
button.primary:hover { background: var(--blue-dark); }
button.secondary { border-radius: 9px; color: var(--ink); border-color: var(--line); }
button.secondary:hover { border-color: #c9d3e4; background: #f7f9fc; }
button.success { background: var(--accent); border-radius: 9px; }

input, select, textarea { border-radius: 9px; border-color: #dde3ee; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #3465dc1f;
}

th { letter-spacing: .04em; font-size: .72rem; }
.badge { font-weight: 500; }
.badge.blue { background: var(--pale); color: var(--blue); }

.unit-item { border-radius: 9px; border-color: var(--line); }
.unit-item:hover { border-color: var(--blue); background: #fbfcfe; }
.unit-item.selected { border-color: var(--blue); background: var(--pale); }

.result-box { background: #f7f9fc; border: 1px solid var(--line); border-radius: 11px; }
.modal-box { border-radius: 16px; }
.modal-overlay { background: #121a2d66; }

/* --------------------------------------------------------- page headings -- */
.hub-heading { margin-bottom: 1.25rem; }
.hub-heading .eyebrow {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 7px;
}
.hub-heading .eyebrow svg { width: 13px; height: 13px; }
.hub-heading h1 {
  margin: 0 0 5px; font-size: 25px; font-weight: 600;
  letter-spacing: -.02em; color: var(--ink);
}
.hub-heading p { margin: 0; color: var(--muted-ink); font-size: 14px; max-width: 70ch; }
.hub-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ------------------------------------------------------------- responsive -- */
@media (max-width: 900px) {
  .hub { display: block; }
  .topbar {
    display: grid; grid-template-columns: 44px 1fr auto;
    height: 56px; padding: 0 8px;
  }
  .hamb {
    display: grid; place-items: center;
    border: 0; background: transparent; color: #4d576b; cursor: pointer;
  }
  .hamb svg { width: 21px; height: 21px; }
  .brandwrap { padding: 0 4px; height: 56px; }
  .brandwrap > i { width: 30px; height: 30px; }
  .brand { font-size: 14px; }
  .whoami { display: none; }

  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0;
    width: 262px; transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 15px 0 40px #16213b22;
    padding-top: 20px;
  }
  .sidebar.open { transform: translateX(0); }

  main#mainContent { padding: 18px 14px 56px; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------- photo capture buttons -- */
/* A bare <input type=file> on a phone offers a vague "choose" sheet. Two
   explicit choices are clearer, and the first one opens the camera directly. */
.photo-pick {
  flex: 1; position: relative; display: block; margin: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; padding: .55rem .7rem; text-align: center;
  font-size: .85rem; color: var(--ink); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.photo-pick:hover { border-color: var(--blue); background: var(--pale); }
.photo-pick span { pointer-events: none; }
.photo-pick input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.photo-pick.disabled { opacity: .5; pointer-events: none; }

/* ------------------------------------------------------- disabled buttons -- */
/* A disabled button that looks exactly like an enabled one is worse than no
   button: people click it, nothing happens, and they assume the app is broken.
   Submit stays visible so the goal is clear, but it has to look unavailable. */
button.primary:disabled,
button.primary[disabled] {
  background: #c2d0ee; cursor: not-allowed;
}
button.primary:disabled:hover { background: #c2d0ee; }
button.secondary:disabled,
button.secondary[disabled] {
  opacity: .55; cursor: not-allowed;
}

/* ---------------------------------------------------------------- calendar --
   A month grid that has to survive two things: a phone, and a day with nine
   jobs on it. So the cells are a fixed minimum height rather than a fixed one —
   a busy week grows, an empty one does not — and the whole grid scrolls
   sideways below 40rem instead of squeezing seven columns into a phone and
   making every entry unreadable. */
.calgrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(6.4rem, 1fr));
  gap: 1px;
  background: var(--line, #dbe1ea);
  border: 1px solid var(--line, #dbe1ea);
  border-radius: 8px;
  overflow: hidden;
  min-width: 44rem;
}
.calwrap { overflow-x: auto; }

.calhead {
  background: var(--sunk, #f1f4f8);
  padding: .35rem .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--sub, #5c6a7c);
  text-align: left;
}

.calcell {
  background: var(--paper, #fff);
  border: 0;
  border-top: 3px solid transparent;
  min-height: 5.6rem;
  padding: .3rem .35rem .4rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calcell:hover  { background: var(--sunk, #f1f4f8); }
.calcell.out    { opacity: .45; }
.calcell.today  { border-top-color: #0e7a52; }
.calcell.open   { background: #eef4ff; border-top-color: #2f5bd7; }

.caldate { font-size: .82rem; font-weight: 600; color: var(--sub, #5c6a7c); }
.calcell.today .caldate { color: #0e7a52; }

/* One entry. Truncated to a line on purpose: the cell answers "is this day
   busy, and roughly with what", and the day panel underneath answers the rest.
   A cell that wraps every title turns the month into a wall of text. */
.calpip {
  font-size: .74rem;
  line-height: 1.25;
  padding: 1px 4px;
  border-radius: 4px;
  background: #E6F2EC;
  color: #0B5D3F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calpip.showing { background: #EDE7F6; color: #4A2C7A; }
.calpip.late    { background: #FBE9E7; color: #B3261E; }
.calpip.arrival { background: #F7F3E8; color: #6B5A2A; box-shadow: inset 0 0 0 1px #D9C89A; }
.calmore { font-size: .72rem; color: var(--sub, #5c6a7c); }

@media (max-width: 700px) {
  .calgrid { grid-template-columns: repeat(7, minmax(5.2rem, 1fr)); min-width: 37rem; }
  .calcell { min-height: 4.6rem; }
}

.calviews { display: flex; gap: 0; }
.calviews button {
  border-radius: 0;
  border: 1px solid var(--line, #dbe1ea);
}
.calviews button:first-child { border-radius: 6px 0 0 6px; }
.calviews button:last-child { border-radius: 0 6px 6px 0; }
.calviews button.on {
  background: #eef4ff;
  border-color: #2f5bd7;
  color: #1d3f9a;
  font-weight: 600;
}

.calweek {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.calweekday {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: .35rem .45rem;
  border: 1px solid var(--line, #dbe1ea);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.calweekday.on { background: #eef4ff; border-color: #2f5bd7; }
.calweekday.today { border-top: 3px solid #0e7a52; }
.calweekday span { font-size: .72rem; color: var(--sub, #5c6a7c); }
.calweekday em { font-size: .7rem; font-style: normal; color: var(--sub, #5c6a7c); }

.calavail {
  display: grid;
  grid-template-columns: 4.4rem repeat(var(--n, 2), minmax(7.2rem, 1fr));
  gap: 1px;
  background: var(--line, #dbe1ea);
  border: 1px solid var(--line, #dbe1ea);
  border-radius: 8px;
  overflow: hidden;
  min-width: calc(4.4rem + var(--n, 2) * 7.2rem);
}
.calavail-head {
  background: var(--sunk, #f1f4f8);
  padding: .35rem .45rem;
  font-size: .78rem;
  font-weight: 600;
}
.calavail-time {
  background: #fff;
  padding: .2rem .4rem;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  color: var(--sub, #5c6a7c);
  display: flex;
  align-items: center;
}
.calavail-cell {
  min-height: 1.55rem;
  border: 0;
  padding: 1px 4px;
  font: inherit;
  font-size: .7rem;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calavail-cell[disabled] { cursor: default; }
.calavail-cell.free { background: #E6F2EC; color: #0B5D3F; }
.calavail-cell.booked { background: #E8EEF9; color: #1d3f9a; }
.calavail-cell.clash { background: #FBE9E7; color: #B3261E; font-weight: 600; }
.calavail-cell.off { background: #f3f4f6; color: #9aa3af; }

table.calhours { width: 100%; margin-top: .5rem; }
table.calhours td, table.calhours th { padding: .25rem .4rem; text-align: left; }

dl.wofacts {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: .2rem .7rem;
  margin: .55rem 0 0;
  font-size: .86rem;
}
dl.wofacts dt { color: var(--muted, #707b8e); }
dl.wofacts dd { margin: 0; }

/* ---------------------------------------------------------------- invoices -- */
.inv-chip {
  border: 1px solid var(--line, #e5e9f0);
  background: #fff;
  border-radius: 999px;
  padding: .28rem .7rem;
  font-size: .82rem;
  cursor: pointer;
}
.inv-chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.inv-chip.on { background: var(--pale, #edf3ff); border-color: var(--blue, #3465dc); color: var(--blue, #3465dc); }
.inv-table-wrap { overflow-x: auto; }
table.inv-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.inv-table th {
  text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: .4rem .45rem; white-space: nowrap;
}
table.inv-table td { vertical-align: top; padding: .45rem; border-top: 1px solid var(--line, #e5e9f0); }
table.inv-table tr.inv-pending td:first-child { box-shadow: inset 3px 0 0 #c0453a; }
table.inv-table tr.inv-submitted td:first-child { box-shadow: inset 3px 0 0 #b8860b; }
table.inv-table tr.inv-complete td:first-child { box-shadow: inset 3px 0 0 var(--accent, #1b9a79); }
table.inv-table textarea,
table.inv-table input[type="text"],
table.inv-table input[type="date"],
table.inv-table select {
  width: 100%; font: inherit; border: 1px solid var(--line, #e5e9f0);
  border-radius: 6px; padding: .28rem .4rem; background: #fff;
}
table.inv-table textarea { min-width: 12rem; resize: vertical; }
.inv-money { max-width: 7.5rem; font-variant-numeric: tabular-nums; }
.inv-total { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.inv-total.missing { color: var(--muted); font-weight: 500; }
.inv-status {
  border: 0; border-radius: 999px; padding: .2rem .65rem; font: inherit; font-size: .78rem;
  font-weight: 600; cursor: pointer; min-width: 6.2rem;
}
.inv-status.pending { background: #fbe9e7; color: #c0453a; }
.inv-status.submitted { background: #faf1de; color: #8a5a12; }
.inv-status.complete { background: #e5f4ee; color: #1b9a79; }
select.inv-status { appearance: auto; width: auto; }
.inv-rule {
  margin-top: .3rem; font-size: .75rem; color: #8a5a12; background: #faf1de;
  border-radius: 6px; padding: .28rem .4rem; line-height: 1.3;
}
.inv-cat { display: flex; align-items: center; gap: .3rem; margin-top: .35rem;
  font-size: .75rem; color: var(--muted); }
.inv-receipt { margin-top: .35rem; font-size: .78rem; display: flex; flex-wrap: wrap;
  gap: .35rem .6rem; align-items: center; }
.inv-upload {
  position: relative; overflow: hidden; cursor: pointer; color: var(--blue, #3465dc);
  text-decoration: underline;
}
.inv-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

table.inv-table th.inv-pick,
table.inv-table td.inv-pick { width: 2rem; text-align: center; }
table.inv-table tr.inv-invoiced td:first-child { box-shadow: inset 3px 0 0 #3465dc; }
.inv-status.invoiced { background: #e8eef8; color: #34548a; cursor: default; }
.inv-banner {
  margin-top: .75rem;
  background: #e5f4ee;
  border: 1px solid #b7dccb;
  border-radius: 8px;
  padding: .65rem .8rem;
  font-size: .86rem;
}
.inv-banner a { margin-right: .75rem; }
.inv-banner .inv-rule { display: inline-block; }
#invGenerate:disabled { opacity: .55; cursor: not-allowed; }
.inv-docs { display: flex; flex-direction: column; gap: .55rem; }
.inv-doc {
  display: grid; grid-template-columns: 1fr auto auto; gap: .6rem .9rem;
  align-items: center; padding: .45rem 0; border-top: 1px solid var(--line, #e5e9f0);
}
.inv-doc:first-child { border-top: 0; }
.inv-doc-total { font-variant-numeric: tabular-nums; font-weight: 600; }
.inv-doc-actions { display: flex; flex-wrap: wrap; gap: .4rem .55rem; align-items: center; }
@media (max-width: 700px) {
  .inv-doc { grid-template-columns: 1fr; }
}
.inv-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .65rem .8rem;
  margin-top: .85rem;
}
.inv-editor-grid label,
.inv-editor-grid .inv-span {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.inv-editor-grid .inv-span { grid-column: 1 / -1; }
.inv-editor-grid input,
.inv-editor-grid select {
  font: inherit; font-weight: 500; text-transform: none; letter-spacing: 0;
  color: inherit; border: 1px solid var(--line, #e5e9f0);
  border-radius: 6px; padding: .32rem .45rem; background: #fff;
}

/* --- typeahead (Inspections, Tasks, and any other long property list) --- */
.hub-combo { position: relative; }
.hub-combo-input { width: 100%; }
.hub-combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  max-height: 16rem; overflow: auto; background: #fff;
  border: 1px solid var(--line, #e5e9f0); border-radius: 10px;
  box-shadow: 0 8px 24px #1c2d5518;
}
.hub-combo-opt { padding: .45rem .7rem; cursor: pointer; font-size: .9rem; }
.hub-combo-opt:hover, .hub-combo-opt.is-active { background: var(--pale, #edf3ff); }
.hub-combo-opt.is-selected { font-weight: 600; }
.hub-combo-empty { padding: .55rem .7rem; color: var(--muted); font-size: .85rem; }
.login-lang {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  margin-top: 1.1rem; font-size: .85rem; color: var(--muted, #707b8e);
}
.login-lang select { width: auto; min-width: 8rem; }
.hub-lang select {
  width: auto; min-width: 4.2rem; padding: .28rem .45rem; font-size: .78rem;
  background: #fff; color: var(--ink, #182033);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.tf-keyline { display: flex; gap: .4rem; align-items: flex-start; margin-top: .35rem; }
.tf-keyline .hub-combo { flex: 1; }
.tf-keyline button { flex: 0 0 auto; margin-top: 0; }
.t-mode-opt { display: flex; gap: .55rem; align-items: flex-start; margin: .35rem 0; }
.t-mode-opt input { width: 16px; flex: 0 0 16px; margin-top: .2rem; }
.sh-keys { margin-top: .75rem; padding: .65rem .75rem; background: var(--surface-1, #f2f5fa); border-radius: 8px; }
.sh-keys ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.sh-toolbar { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* Showing-agent Hub — three columns matching the approved preview */
.sh-hub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.sh-hub.one {
  grid-template-columns: 1fr;
  max-width: 720px;
}
.sh-eyebrow {
  margin: 0 0 .4rem;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9aa3b5;
  font-weight: 600;
}
.sh-col-card { margin: 0; padding: 1.1rem 1.15rem 1.2rem; }
.sh-col-card h2 {
  margin: 0 0 .85rem;
  font-size: 1.15rem;
  color: #1a2744;
}
.sh-sub { margin: 1rem 0 .4rem; font-size: .9rem; }
.sh-rental {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: .75rem;
  padding: .75rem .8rem;
  margin: 0 0 .65rem;
  border: 1px solid var(--line, #e5e9f0);
  border-radius: 12px;
  background: #fff;
}
.sh-rental:last-of-type { margin-bottom: 0; }
.sh-photo {
  width: 88px; height: 72px; border-radius: 10px; overflow: hidden;
  background: #eef1f6; color: #9aa3b5;
  display: grid; place-items: center;
}
.sh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-rental-body h3 { margin: 0 0 .15rem; font-size: .98rem; color: #1a2744; }
.sh-meta { margin: 0 0 .25rem; font-size: .82rem; color: var(--muted); }
.sh-blurb { margin: 0 0 .35rem; font-size: .82rem; color: #4a5568; line-height: 1.4; }
.sh-listing-link { font-size: .82rem; }
.sh-keys-inline { margin: .35rem 0 0; font-size: .78rem; color: var(--muted); }
.sh-keys-quiet { background: transparent; padding: .2rem 0 0; margin: 0; }
.sh-day h4 {
  margin: .85rem 0 .4rem; font-size: .88rem; font-weight: 600; color: #1a2744;
  display: flex; gap: .35rem; align-items: center;
}
.sh-item { border: 1px solid var(--line, #e5e9f0); border-radius: 10px; margin-bottom: .45rem; overflow: hidden; }
.sh-item.open { border-color: #c9d6f5; box-shadow: 0 0 0 1px #e8eefc; }
.sh-item.done { opacity: .65; }
.sh-item-head {
  width: 100%; display: flex; align-items: center; gap: .45rem;
  background: #fff; border: 0; padding: .55rem .7rem; text-align: left; cursor: pointer; font: inherit;
}
.sh-item.open .sh-item-head { background: #f3f6fd; }
.sh-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b6fe3; flex: 0 0 8px; }
.sh-item-title { flex: 1; font-weight: 600; font-size: .88rem; color: #1a2744; }
.sh-caret { color: var(--muted); font-size: .8rem; }
.sh-detail { padding: .15rem .85rem .85rem 1.85rem; }
.sh-detail-row { margin: .2rem 0; font-size: .85rem; color: #3c4a63; }
.sh-prospects h4 { margin: .6rem 0 .35rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sh-person { display: flex; justify-content: space-between; gap: .6rem; align-items: center; margin: .35rem 0; }
.sh-person-name { font-weight: 600; font-size: .88rem; }
.sh-contact { display: flex; gap: .35rem; flex-wrap: wrap; }
.sh-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  border: 1px solid var(--line, #e5e9f0); border-radius: 8px;
  padding: .28rem .5rem; font-size: .78rem; text-decoration: none; color: #1a2744; background: #fff;
}
.sh-notes { display: flex; gap: .4rem; margin: .55rem 0; font-size: .85rem; }
.sh-notes p { margin: .15rem 0 0; }
.sh-status-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .45rem; font-size: .85rem; color: #3c4a63;
}
.sh-alert-row {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .7rem;
}
.sh-danger { color: #9b2c2c; border-color: #f0c7c7; }
.sh-done { margin: .7rem 0 0; font-size: .8rem; }
.sh-coming { margin: 0; padding-left: 1.1rem; font-size: .85rem; color: #3c4a63; }
.sh-week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; margin-bottom: .7rem; }
.sh-wday {
  border: 0; background: transparent; padding: .35rem 0; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); border-radius: 999px;
}
.sh-wday span { font-size: .68rem; }
.sh-wday b { font-size: .88rem; font-weight: 600; color: #1a2744; width: 1.7rem; height: 1.7rem;
  display: grid; place-items: center; border-radius: 999px; }
.sh-wday.on b { background: #1a2744; color: #fff; }
.sh-wday.today:not(.on) b { box-shadow: inset 0 0 0 1.5px #1a2744; }
.sh-daygrid { display: grid; grid-template-columns: 3.2rem 1fr; min-height: 280px; }
.sh-hours { display: flex; flex-direction: column; justify-content: space-between;
  font-size: .7rem; color: var(--muted); padding: .15rem 0; }
.sh-track {
  position: relative; border-top: 1px dashed #e5e9f0; border-bottom: 1px dashed #e5e9f0;
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 24%, #eef1f6 24%, #eef1f6 25%);
  min-height: 280px;
}
.sh-block {
  position: absolute; left: 4px; right: 4px;
  background: #2f5bd7; color: #fff; border: 0; border-radius: 8px;
  padding: .28rem .5rem; text-align: left; cursor: pointer; font: inherit;
  overflow: hidden; min-height: 44px;
}
.sh-block b { display: block; font-size: .75rem; line-height: 1.2; }
.sh-block span { display: block; font-size: .72rem; opacity: .92; line-height: 1.2; }
.sh-cal-note { margin: .65rem 0 0; font-size: .78rem; }
.sh-mail {
  display: flex; gap: .55rem; align-items: flex-start;
  margin: 1rem 0 0; padding: .7rem .9rem;
  background: #f7f1e6; border: 1px solid #ead9b8; border-radius: 10px;
  font-size: .85rem; color: #4a3d28;
}
.sh-mail-ico { font-size: 1rem; }
.sh-link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.sh-p-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4rem; margin-bottom: .35rem; }

@media (max-width: 980px) {
  .sh-hub { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sh-rental { grid-template-columns: 1fr; }
  .sh-photo { width: 100%; height: 120px; }
  .sh-p-row { grid-template-columns: 1fr; }
}

/* ---------- Bank Rec ---------- */
.br-page h2 { margin: 0 0 .2rem; }
.br-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .6rem; }
.br-head .muted { margin: 0; }
.br-stats { display: flex; gap: .8rem; font-size: .85rem; color: var(--muted); }
.br-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.br-tabs { display: flex; gap: .4rem; margin: .6rem 0 1rem; }
.br-tabs button {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: .35rem .85rem; cursor: pointer; font-size: .85rem;
}
.br-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.br-toolbar { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.br-toolbar input, .br-toolbar select { width: auto; min-width: 9rem; }
.br-file { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; cursor: pointer; }
.br-file input { display: none; }
.br-warn, .br-notice {
  background: #f7f1e6; border: 1px solid #ead9b8; border-radius: 10px;
  padding: .55rem .8rem; font-size: .85rem; margin: 0 0 .7rem;
}
.br-empty { color: var(--muted); padding: 1.5rem 0; }
.br-ex-list { display: flex; flex-direction: column; gap: .55rem; }
.br-ex {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: .75rem 1rem; box-shadow: inset 4px 0 0 #c0453a;
}
.br-ex-in_column_not_buildium { box-shadow: inset 4px 0 0 #c0453a; }
.br-ex-in_buildium_not_column { box-shadow: inset 4px 0 0 #3465dc; }
.br-ex-amount_date_mismatch { box-shadow: inset 4px 0 0 #b8860b; }
.br-ex-duplicate_suspicion { box-shadow: inset 4px 0 0 #6b5b95; }
.br-ex-top { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; }
.br-ex-top strong { font-size: .92rem; }
.br-amt { font-variant-numeric: tabular-nums; font-weight: 650; }
.br-when { color: var(--muted); font-size: .85rem; }
.br-tag { font-style: normal; font-size: .72rem; background: #edf3ff; color: #2a55bd; border-radius: 999px; padding: .1rem .5rem; }
.br-ex-acct { margin: .2rem 0 .15rem; font-size: .88rem; }
.br-ex-desc { color: var(--muted); font-size: .85rem; }
.br-ex-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: flex-start; }
.br-ex-actions button { padding: .35rem .65rem; font-size: .78rem; }
table.br-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.br-table th { text-align: left; padding: .45rem; color: var(--muted); font-weight: 600; }
table.br-table td { padding: .55rem .45rem; border-top: 1px solid var(--line); vertical-align: top; }
tr.br-paused { opacity: .55; }
.br-bal { font-variant-numeric: tabular-nums; white-space: nowrap; }
.br-map-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.br-map-actions button { padding: .3rem .55rem; font-size: .78rem; }
.br-add { margin-bottom: 1rem; }

/* ---------- Hub Bills ---------- */
.hb-page h2 { margin: 0 0 .2rem; }
.hb-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .7rem; }
.hb-head .muted { margin: 0; max-width: 52ch; }
.hb-upload {
  position: relative; display: inline-flex; align-items: center; gap: .4rem;
  background: #eef6ff; border: 1px solid #c9dbf5; color: #2a55bd;
  border-radius: 999px; padding: .4rem .95rem; font-size: .85rem; cursor: pointer;
}
.hb-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hb-modes, .hb-filters { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin: .45rem 0; }
.hb-modes button, .hb-filters button {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: .35rem .85rem; cursor: pointer; font-size: .85rem;
}
.hb-modes button.on { background: #e8f6ef; border-color: #b7e0cb; color: #1b7a55; }
.hb-filters button.on { background: var(--pale); border-color: #c5d4f4; color: var(--blue); }
.hb-search { width: auto; min-width: 12rem; margin-left: auto; }
.hb-warn, .hb-notice {
  background: #f7f1e6; border: 1px solid #ead9b8; border-radius: 10px;
  padding: .55rem .8rem; font-size: .85rem; margin: 0 0 .7rem; color: #4a3d28;
}
.hb-err {
  background: #fbe9e7; border: 1px solid #f0c4be; border-radius: 10px;
  padding: .55rem .8rem; font-size: .85rem; margin: 0 0 .7rem; color: #8a2b22;
}
.hb-empty, .hb-detail-empty { color: var(--muted); padding: 1.4rem .4rem; }
.hb-split { display: grid; grid-template-columns: minmax(260px, 34%) 1fr; gap: 1rem; align-items: start; }
.hb-list { display: flex; flex-direction: column; gap: .55rem; }
.hb-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: .75rem .9rem; cursor: pointer; box-shadow: 0 1px 2px #1c2d5508;
}
.hb-card:hover { border-color: #c9d4ea; }
.hb-card.on { background: #eef8f2; border-color: #b7e0cb; }
.hb-card-top { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.hb-card-top strong { font-size: .95rem; }
.hb-conf { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hb-card-where { color: var(--muted); font-size: .8rem; margin: .15rem 0 .25rem; }
.hb-card-amt { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.hb-card-meta { display: flex; justify-content: space-between; gap: .5rem; margin-top: .45rem; font-size: .75rem; color: var(--muted); }
.hb-pill { border-radius: 999px; padding: .1rem .5rem; background: #fbe9e7; color: #c0453a; }
.hb-pill-held { background: #faf1de; color: #8a5a12; }
.hb-pill-submitted, .hb-pill-approved { background: #e5f4ee; color: #1b9a79; }
.hb-pill-failed { background: #fbe9e7; color: #8a2b22; }
.hb-pill-not_invoice, .hb-pill-rejected { background: #eee; color: #555; }
.hb-review { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.1rem 1.15rem; }
.hb-pdf { margin-bottom: .9rem; }
.hb-pdf-name { display: flex; gap: .65rem; align-items: center; margin-bottom: .55rem; }
.hb-pdf-mark {
  background: #fde8e4; color: #c0453a; font-size: .68rem; font-weight: 700;
  letter-spacing: .04em; border-radius: 8px; padding: .45rem .4rem;
}
.hb-pdf-frame {
  width: 100%; height: 220px; border: 1px solid var(--line); border-radius: 10px;
  background: #f8fafc;
}
.hb-pdf-missing {
  border: 1px dashed var(--line); border-radius: 10px; padding: 1.4rem;
  text-align: center; color: var(--muted); font-size: .85rem;
}
.hb-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .7rem; margin-bottom: .75rem;
}
.hb-fields label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: var(--muted); }
.hb-fields .hb-span { grid-column: 1 / -1; }
.hb-fields input, .hb-fields select, .hb-fields textarea {
  font: inherit; color: var(--ink); border: 1px solid var(--border); border-radius: 8px;
  padding: .4rem .5rem; background: #fff;
}
.hb-fields textarea { min-height: 4rem; resize: vertical; }
.hb-conf-row { display: flex; gap: .55rem; align-items: center; }
.hb-conf-row input { flex: 1; }
.hb-actions { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: flex-end; margin: .8rem 0 .4rem; }
.hb-drive { font-size: .75rem; color: var(--muted); margin: .4rem 0 0; }
.hb-head-actions { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.hb-manage-btn, .hb-sync-btn {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: .4rem .95rem; font-size: .85rem; cursor: pointer;
}
.hb-manage-btn.on { background: var(--pale); border-color: #c5d4f4; color: var(--blue); }
.hb-sync-btn { background: #eef6ff; border-color: #c9dbf5; color: #2a55bd; }
.hb-sync-btn:disabled { opacity: .55; cursor: wait; }
.hb-draft-mode {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin: 0 0 .7rem;
}
.hb-draft-mode button {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: .3rem .75rem; cursor: pointer; font-size: .8rem;
}
.hb-draft-mode button.on { background: #e8f6ef; border-color: #b7e0cb; color: #1b7a55; }
.hb-email-meta { font-size: .8rem; color: var(--muted); margin: 0 0 .75rem; }
.hb-match {
  background: #fff6e5; border: 1px solid #f0d59a; border-radius: 12px;
  padding: .7rem .85rem; margin: 0 0 .8rem; font-size: .85rem;
}
.hb-match h4 { margin: 0 0 .35rem; color: #8a5a10; font-size: .9rem; }
.hb-match p { margin: 0 0 .35rem; }
.hb-match ul { margin: .25rem 0 0; padding-left: 1.15rem; }
.hb-match-err { background: #f4f6fb; border-color: var(--border); color: var(--muted); }
.hb-match-err strong { color: var(--ink); }
.hb-email-enable { display: flex; gap: .45rem; align-items: center; margin: .5rem 0; font-size: .9rem; }
.hb-danger {
  background: #fff; border: 1px solid #f0c4be; color: #c0453a;
  border-radius: 8px; padding: .4rem .75rem; cursor: pointer;
}
.hb-danger:hover { background: #fbe9e7; }
.hb-combo-mount { width: 100%; }
.hb-manage { display: flex; flex-direction: column; gap: 1.2rem; }
.hb-manage-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.hb-manage-head h3 { margin: 0 0 .2rem; }
.hb-manage-head .muted { margin: 0; max-width: 62ch; }
.hb-manage-search { min-width: 14rem; }
.hb-manage-block {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 1rem 1.1rem 1.15rem;
}
.hb-manage-block h4 { margin: 0 0 .7rem; }
.hb-manage-add, .hb-manage-glbar { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .7rem; }
.hb-manage-add input { min-width: 10rem; flex: 1; }
.hb-manage-table-wrap { overflow: auto; }
.hb-manage-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.hb-manage-table th { text-align: left; font-weight: 600; padding: .35rem .4rem; color: var(--muted); }
.hb-manage-table td { padding: .3rem .4rem; vertical-align: middle; }
.hb-manage-table input { width: 100%; font: inherit; }
.hb-manage-row-actions { white-space: nowrap; }
.hb-manage-row-actions button { margin-left: .25rem; }
.hb-mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; }
.hb-offset { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); margin: 0 0 .7rem; max-width: 22rem; }
.hb-email-list { max-width: 28rem; }
.hb-email-list textarea {
  min-height: 4.2rem; resize: vertical; font: inherit; width: 100%;
  padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 8px;
}
.hb-map-toolbar {
  display: flex; justify-content: space-between; gap: .6rem;
  align-items: flex-start; flex-wrap: wrap; margin: 0 0 .7rem;
}
.hb-map-vendors { display: flex; flex-wrap: wrap; gap: .35rem; }
.hb-map-vendors button {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: .25rem .7rem; font-size: .8rem; cursor: pointer;
}
.hb-map-vendors button.on { background: #eef6ff; border-color: #c9dbf5; color: #2a55bd; }
.hb-payrange-note {
  background: #fff6e5; border: 1px solid #f0d59a; border-radius: 12px;
  padding: .65rem .8rem; margin: 0 0 .8rem; font-size: .85rem; color: #8a5a10;
}
.hb-payrange-month { margin: 0 0 .7rem; max-width: 16rem; }
.hb-payrange-month label {
  display: flex; flex-direction: column; gap: .25rem;
  font-size: .8rem; color: var(--muted);
}

@media (max-width: 900px) {
  .hb-split { grid-template-columns: 1fr; }
  .hb-search { margin-left: 0; width: 100%; }
  .hb-fields { grid-template-columns: 1fr; }
}

/* ---------- Arrange: tab colours ---------- */
.ar-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: .55rem;
}
.ar-color-cell {
  display: flex; flex-direction: column; gap: .35rem;
  background: var(--tab-tint, #f5f7fb);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .65rem .5rem;
  font-size: .8rem; font-weight: 600;
}
.ar-color-cell input[type="color"] {
  width: 100%; height: 1.7rem; padding: 0; border: 0;
  background: transparent; cursor: pointer;
}
.ar-pastel-row { display: flex; flex-wrap: wrap; gap: 3px; }
.ar-pastel {
  width: 14px; height: 14px; padding: 0; border-radius: 4px;
  border: 1px solid #d5dbe6; cursor: pointer;
}
.ar-pastel:hover { border-color: var(--blue); }

