/* bobby-crm UI. Layout, spacing and components follow the Sonigo LinkedIn Marketplace app
   (team inbox and admin workspace). Two simple themes, light and dark; Poppins throughout. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f0f1f4;
  --border: #e5e7ec;
  --border-strong: #d7dae1;
  --text: #252533;
  --text-2: #565b6b;
  --text-3: #8b8f9d;
  --primary: #252533;
  --primary-ink: #ffffff;
  --primary-hover: #34344a;
  --accent: #FF7300;
  --accent-ink: #b45200;
  --accent-soft: #fff4ea;
  --accent-line: #ffd9b8;
  --focus: #FF7300;
  --active: #eef0f4;
  --bubble-out: #eef0f4;

  --ok: #2f7a57; --ok-soft: #eef7f1; --ok-line: #d6ebdd;
  --info: #3c6a99; --info-soft: #eef4fa; --info-line: #d8e5f2;
  --warn: #93661c; --warn-soft: #fcf6e9; --warn-line: #f0e4c8;
  --danger: #b04138; --danger-soft: #fcefed; --danger-line: #f3d8d4;
  --neutral: #616676; --neutral-soft: #f3f4f6; --neutral-line: #e4e6ea;

  --chart-income: #E0700F;
  --chart-expenses: #498BCA;
  --chart-grid: #edeef2;

  --shadow-sm: 0 1px 2px rgba(37, 37, 51, .03);
  --shadow-md: 0 8px 30px rgba(37, 37, 51, .08);
  --shadow-lg: -15px 0 80px rgba(37, 37, 51, .12);
  --backdrop: rgba(37, 37, 51, .25);

  color-scheme: light;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --surface: #1c1c1c;
    --surface-2: #202020;
    --surface-3: #282828;
    --border: #2e2e2e;
    --border-strong: #3b3b3b;
    --text: #f2f2f2;
    --text-2: #b4b4b4;
    --text-3: #838383;
    --primary: #f2f2f2;
    --primary-ink: #141414;
    --primary-hover: #ffffff;
    --accent-ink: #ffa75a;
    --accent-soft: rgba(255, 115, 0, .12);
    --accent-line: rgba(255, 115, 0, .32);
    --active: #282828;
    --bubble-out: #2a2a2a;
    --ok: #86d1a8; --ok-soft: rgba(122, 212, 163, .1); --ok-line: rgba(122, 212, 163, .22);
    --info: #94bce3; --info-soft: rgba(73, 139, 202, .12); --info-line: rgba(73, 139, 202, .28);
    --warn: #e8c178; --warn-soft: rgba(232, 193, 120, .1); --warn-line: rgba(232, 193, 120, .24);
    --danger: #f19a91; --danger-soft: rgba(241, 154, 145, .1); --danger-line: rgba(241, 154, 145, .25);
    --neutral: #b4b4b4; --neutral-soft: rgba(255, 255, 255, .05); --neutral-line: rgba(255, 255, 255, .1);
    --chart-grid: #2e2e2e;
    --shadow-sm: none;
    --shadow-md: 0 8px 30px rgba(0, 0, 0, .3);
    --shadow-lg: -15px 0 80px rgba(0, 0, 0, .35);
    --backdrop: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141414;
  --surface: #1c1c1c;
  --surface-2: #202020;
  --surface-3: #282828;
  --border: #2e2e2e;
  --border-strong: #3b3b3b;
  --text: #f2f2f2;
  --text-2: #b4b4b4;
  --text-3: #838383;
  --primary: #f2f2f2;
  --primary-ink: #141414;
  --primary-hover: #ffffff;
  --accent-ink: #ffa75a;
  --accent-soft: rgba(255, 115, 0, .12);
  --accent-line: rgba(255, 115, 0, .32);
  --active: #282828;
  --bubble-out: #2a2a2a;
  --ok: #86d1a8; --ok-soft: rgba(122, 212, 163, .1); --ok-line: rgba(122, 212, 163, .22);
  --info: #94bce3; --info-soft: rgba(73, 139, 202, .12); --info-line: rgba(73, 139, 202, .28);
  --warn: #e8c178; --warn-soft: rgba(232, 193, 120, .1); --warn-line: rgba(232, 193, 120, .24);
  --danger: #f19a91; --danger-soft: rgba(241, 154, 145, .1); --danger-line: rgba(241, 154, 145, .25);
  --neutral: #b4b4b4; --neutral-soft: rgba(255, 255, 255, .05); --neutral-line: rgba(255, 255, 255, .1);
  --chart-grid: #2e2e2e;
  --shadow-sm: none;
  --shadow-md: 0 8px 30px rgba(0, 0, 0, .3);
  --shadow-lg: -15px 0 80px rgba(0, 0, 0, .35);
  --backdrop: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.2px; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; display: block; flex: none; stroke: currentColor; stroke-width: 1.65; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- App shell (admin workspace layout) ---------- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar { width: 236px; flex: none; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); transition: width .2s ease; }
.brand { display: flex; align-items: center; gap: 10px; padding: 26px 22px 26px 26px; }
.brand-word { font-weight: 700; font-size: 21px; letter-spacing: -.7px; line-height: 1; color: var(--text); }
.brand-word span { color: var(--accent); }
.brand-sub { font-size: 8px; letter-spacing: 1.4px; font-weight: 600; color: var(--text-3); margin-top: 6px; text-transform: uppercase; }
.sidebar-collapse { margin-left: auto; border: 1px solid var(--border); background: var(--surface); color: var(--text-3); width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; }
.sidebar-collapse svg.i { width: 14px; height: 14px; }
.sidebar-collapse:hover { color: var(--text); background: var(--surface-3); }

.nav { flex: 1; overflow: auto; padding: 0 14px 14px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.nav-group { font-size: 9px; letter-spacing: 1.4px; font-weight: 600; color: var(--text-3); padding: 18px 12px 9px; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 2px; }
.nav a svg.i { width: 17px; height: 17px; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--active); color: var(--text); font-weight: 600; }
.nav .count { margin-left: auto; font-size: 10px; font-weight: 600; min-width: 20px; padding: 1px 7px; border-radius: 5px; text-align: center; background: var(--surface-3); color: var(--text-2); }
.nav a.active .count { background: var(--surface); }
.nav .count.hot { background: var(--accent-soft); color: var(--accent-ink); }

.bobby-status { margin: 4px 14px 14px; padding: 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.bobby-status:hover { border-color: var(--border-strong); }
.bobby-status strong { color: var(--text); font-size: 11.5px; font-weight: 600; display: block; }
.bobby-status span { font-size: 10px; color: var(--text-3); font-weight: 400; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); display: inline-block; flex: none; }

.sidebar-user { border-top: 1px solid var(--border); padding: 16px 22px; display: flex; align-items: center; gap: 10px; }
.sidebar-user strong { display: block; color: var(--text); font-size: 11.5px; font-weight: 600; }
.sidebar-user span { font-size: 10px; color: var(--text-3); font-weight: 400; }
.sidebar-user .avatar { width: 32px; height: 32px; font-size: 10.5px; }

.app.collapsed .sidebar { width: 72px; }
.app.collapsed .brand-text, .app.collapsed .nav-group, .app.collapsed .nav a span, .app.collapsed .nav .count, .app.collapsed .bobby-status div, .app.collapsed .sidebar-user div { display: none; }
.app.collapsed .brand { padding: 26px 0; justify-content: center; }
.app.collapsed .sidebar-collapse { margin: 0; transform: rotate(180deg); }
.app.collapsed .nav a { justify-content: center; padding: 10px 0; }
.app.collapsed .bobby-status { justify-content: center; padding: 10px 0; }
.app.collapsed .sidebar-user { justify-content: center; padding: 16px 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 66px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.menu-button { display: none; }
.crumbs { display: flex; align-items: center; font-size: 11.5px; color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; flex: 0 1 auto; }
.crumbs > * { flex: none; }
.crumbs .sep { margin: 0 12px; color: var(--border-strong); }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.global-search { margin-left: auto; display: flex; align-items: center; gap: 9px; width: min(320px, 32vw); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 7px 11px; color: var(--text-3); }
.global-search svg.i { width: 15px; height: 15px; }
.global-search:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--surface-3); }
.global-search input { border: 0; background: transparent; outline: 0; width: 100%; font-size: 11.5px; color: var(--text); }
.global-search input::placeholder { color: var(--text-3); }
kbd { font: 500 10px "Poppins", sans-serif; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-3); white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 20px; padding: 5px 10px; font-size: 10px; color: var(--text-2); white-space: nowrap; }
.pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; }

.view { flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.view-host.full { height: 100%; }
.page { padding: 28px 36px 48px; max-width: 1420px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 4px 0 26px; flex-wrap: wrap; }
.eyebrow { font-size: 9px; letter-spacing: 1.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; }
.page-head h1 { font-size: 27px; font-weight: 700; letter-spacing: -.9px; margin-top: 8px; }
.page-head p { color: var(--text-2); font-size: 11.5px; margin-top: 7px; font-weight: 400; line-height: 1.8; max-width: 720px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 7px; padding: 8px 14px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); white-space: nowrap; line-height: 1.5; }
.btn svg.i { width: 14px; height: 14px; }
.btn:hover { background: var(--surface-3); }
.btn.primary, .btn.navy { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover, .btn.navy:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ok { color: var(--ok); border-color: var(--ok-line); background: var(--surface); }
.btn.ok:hover { background: var(--ok-soft); }
.btn.sm { padding: 5px 10px; font-size: 10.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; color: var(--text-3); flex: none; }
.icon-btn svg.i { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.outlined { border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
.icon-btn.on { color: var(--text); background: var(--active); }
.link { color: var(--accent-ink); font-weight: 600; cursor: pointer; border: 0; background: none; padding: 0; font-size: 11px; }
.link:hover { text-decoration: underline; }

/* ---------- Cards, stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 22px 0; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 13.5px; font-weight: 600; }
.card-head .sub { font-size: 10.5px; color: var(--text-3); font-weight: 400; margin-top: 4px; }
.card-body { padding: 16px 22px 20px; }
.card-foot { border-top: 1px solid var(--border); padding: 13px 22px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10.5px; color: var(--text-3); background: var(--surface-2); border-radius: 0 0 11px 11px; }
.grid { display: grid; gap: 17px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1fr) 360px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 17px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 17px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; box-shadow: var(--shadow-sm); }
.stat-label { font-size: 11px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 8px; min-height: 30px; }
.stat-label svg.i { order: 2; margin-left: auto; width: 30px; height: 30px; padding: 7px; border-radius: 8px; background: var(--surface-3); color: var(--text-3); }
.stat-value { font-size: 25px; font-weight: 600; letter-spacing: -.8px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-note { font-size: 10px; color: var(--text-3); font-weight: 400; }
.stat > .btn { align-self: flex-start; margin-top: 8px; }
.stat .progress { margin: 6px 0 2px; }

.micro { font-size: 9px; letter-spacing: 1px; font-weight: 600; color: var(--text-3); text-transform: uppercase; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px 20px; }
.kv > div { min-width: 0; }
.kv .micro { margin-bottom: 5px; }
.kv .v { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.kv .v.lg { font-size: 15px; }

/* ---------- Status chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; font-size: 10px; font-weight: 500; white-space: nowrap; line-height: 1.5; border: 1px solid var(--neutral-line); background: var(--neutral-soft); color: var(--neutral); }
.badge svg.i { width: 11px; height: 11px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.badge.dot::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge.outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.tag { display: inline-block; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 10px; border-radius: 5px; padding: 3px 8px; margin: 0 4px 5px 0; }
.sr-badge { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: 8px; font-weight: 700; letter-spacing: -.4px; flex: none; }
.money-pos { color: var(--ok); }
.money-neg { color: var(--danger); }

/* ---------- Avatars ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; letter-spacing: .3px; position: relative; background: var(--surface-3); color: var(--text-2); }
.avatar.sm { width: 28px; height: 28px; font-size: 9px; }
.avatar.lg { width: 64px; height: 64px; font-size: 18px; }
.avatar.c0 { background: #f6ece2; color: #9a6a43; }
.avatar.c1 { background: #e6ecf6; color: #4e6d98; }
.avatar.c2 { background: #e5f1ea; color: #4c7d63; }
.avatar.c3 { background: #ebe9f5; color: #66609a; }
.avatar.c4 { background: #f2ebe6; color: #8a6a55; }
.avatar.c5 { background: #e4eff4; color: #47758c; }
:root[data-theme="dark"] .avatar[class*=" c"] { background: var(--surface-3); color: var(--text-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar[class*=" c"] { background: var(--surface-3); color: var(--text-2); } }
.avatar.bobby { background: var(--accent); color: #252533; font-weight: 700; }

/* ---------- Forms, toolbars ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 7px 11px; color: var(--text-3); min-width: 200px; flex: 1; max-width: 300px; }
.search svg.i { width: 15px; height: 15px; }
.search:focus-within { border-color: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3); }
.search input { width: 100%; min-width: 0; border: 0; background: transparent; outline: 0; font-size: 11.5px; color: var(--text); }
.search input::placeholder { color: var(--text-3); }
.select, .input, .textarea { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; padding: 7px 10px; font-size: 11.5px; color: var(--text); min-width: 0; }
.select { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%; background-size: 4px 4px; background-repeat: no-repeat; cursor: pointer; }
.input, .textarea { width: 100%; padding: 10px 12px; font-size: 12px; }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--primary); width: 14px; height: 14px; margin: 0; }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--border-strong); transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; padding: 6px 11px; font-size: 11px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; border-left: 1px solid var(--border); }
.segmented button:first-child { border-left: 0; }
.segmented button svg.i { width: 14px; height: 14px; }
.segmented button .n { font-size: 9.5px; color: var(--text-3); }
.segmented button.active { background: var(--active); color: var(--text); font-weight: 600; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 0 0 12px; font-size: 12px; font-weight: 500; color: var(--text-3); position: relative; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs .active { color: var(--text); font-weight: 600; }
.tabs .active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
.tabs .n { font-size: 9.5px; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--text-3); font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label, .field .label { font-size: 11px; font-weight: 500; color: var(--text); }
.field .hint { font-size: 10px; color: var(--text-3); font-weight: 400; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------- Tables, lists (admin directory) ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.table th { text-align: left; font-size: 8.5px; letter-spacing: .8px; font-weight: 600; color: var(--text-3); text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 15px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table td strong { font-weight: 600; color: var(--text); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.table .row-link { cursor: pointer; }
.card > .table-wrap:first-child .table th { border-top: 0; }
.cell-sub { font-size: 10px; color: var(--text-3); font-weight: 400; margin-top: 3px; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person > div { min-width: 0; }
.person strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover strong { text-decoration: underline; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { font-weight: 600; font-size: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { text-align: center; padding: 38px 20px; color: var(--text-3); font-size: 11.5px; font-weight: 400; line-height: 1.8; }
.empty svg.i { width: 40px; height: 40px; margin: 0 auto 12px; padding: 11px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); }
.note-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 15px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 11px; line-height: 1.7; font-weight: 400; margin-bottom: 16px; }
.note-banner svg.i { color: var(--text-3); width: 16px; height: 16px; margin-top: 1px; }
.note-banner strong { color: var(--text); font-weight: 600; }
.note-banner.info { background: var(--info-soft); border-color: var(--info-line); }
.note-banner.info svg.i { color: var(--info); }

.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.progress.ok > span { background: var(--ok); }

/* ---------- Property cards ---------- */
.prop-list { display: flex; flex-direction: column; gap: 14px; }
.prop-card { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); }
.prop-card:hover { border-color: var(--border-strong); }
.prop-photo { min-height: 140px; position: relative; display: flex; align-items: flex-end; padding: 12px; background: var(--surface-3); border-right: 1px solid var(--border); }
.prop-photo .badge { background: var(--surface); }
.photo-glyph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); opacity: .55; }
.photo-glyph svg.i { width: 46px; height: 46px; stroke-width: 1.2; }
.prop-body { padding: 18px 20px; min-width: 0; }
.prop-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.prop-title h3 { font-size: 14px; font-weight: 600; }
.prop-side { padding: 14px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.room { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.room-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.room-top strong { font-weight: 600; font-size: 12.5px; }
.room .meta { font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.room .rent { font-size: 15px; font-weight: 600; }

/* ---------- Inbox (team inbox three-pane layout) ---------- */
.inbox-shell { display: flex; height: 100%; background: var(--surface); }
.inbox-list { width: 330px; flex: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox-heading { display: flex; align-items: center; gap: 11px; padding: 24px 22px 20px; }
.inbox-heading h1 { font-size: 19px; font-weight: 700; letter-spacing: -.6px; margin-top: 4px; }
.inbox-heading .eyebrow { font-size: 8.5px; }
.inbox-heading .icon-btn { margin-left: auto; }
.inbox-tools { padding: 0 20px; }
.inbox-tools .search { max-width: none; background: var(--surface-2); border-color: var(--border); }
.inbox-filters { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); margin-top: 17px; gap: 6px; }
.inbox-filters button { border: 0; background: none; font-size: 11px; font-weight: 500; padding: 0 0 12px; color: var(--text-3); position: relative; white-space: nowrap; }
.inbox-filters button.active { color: var(--text); font-weight: 600; }
.inbox-filters button.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--text); }
.inbox-filters button span { font-size: 9.5px; padding: 1px 5px; background: var(--surface-3); color: var(--text-3); border-radius: 4px; margin-left: 3px; }
.list-heading { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px 8px; gap: 8px; }
.list-heading .select { font-size: 10px; padding: 4px 26px 4px 8px; }
.conv-list { flex: 1; overflow: auto; padding: 0 10px 14px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.conv { width: 100%; display: flex; gap: 11px; padding: 15px 12px; border: 1px solid transparent; background: transparent; border-radius: 9px; text-align: left; margin: 3px 0; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--active); border-color: var(--border); }
.conv-content { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.conv-top strong { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top time { font-size: 9px; color: var(--text-3); white-space: nowrap; font-weight: 400; }
.conv-sub { font-size: 10px; color: var(--text-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.conv-bottom { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 8px; }
.conv-preview { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.conv.unread .conv-preview { color: var(--text-2); font-weight: 500; }
.unread-dot { background: var(--accent); color: #252533; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; padding: 0 4px; }
.conv-flags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.conv-flags .badge { font-size: 9px; padding: 1px 6px; }

.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-header { height: 80px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 30px; border-bottom: 1px solid var(--border); }
.chat-header h2 { font-size: 14px; font-weight: 600; }
.chat-header p { font-size: 11px; color: var(--text-3); margin-top: 4px; font-weight: 400; }
.chat-header .header-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.chat-body { display: flex; flex: 1; min-height: 0; }
.thread { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface-2); }
.thread-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 30px 0; gap: 10px; }
.channel-label { font-size: 10px; color: var(--text-3); display: flex; align-items: center; gap: 6px; font-weight: 400; }
.messages { flex: 1; overflow: auto; padding: 24px 44px 18px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.date-sep { text-align: center; margin: 4px 0 28px; position: relative; }
.date-sep::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.date-sep span { position: relative; background: var(--surface-2); padding: 0 15px; font-size: 10px; color: var(--text-3); font-weight: 400; }
.msg { display: flex; gap: 10px; margin-bottom: 22px; align-items: flex-end; max-width: 80%; }
.msg .avatar { width: 28px; height: 28px; font-size: 8.5px; margin-bottom: 21px; }
.msg.out { margin-left: auto; flex-direction: row-reverse; }
.msg-content { min-width: 0; }
.bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 12px 12px 12px 3px; padding: 12px 16px; font-size: 12px; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 400; }
.msg.out .bubble { background: var(--bubble-out); border-color: var(--border); color: var(--text); border-radius: 12px 12px 3px 12px; }
.msg-meta { display: flex; gap: 5px; align-items: center; font-size: 9px; color: var(--text-3); margin-top: 7px; font-weight: 400; flex-wrap: wrap; }
.msg.out .msg-meta { justify-content: flex-end; }
.msg-meta svg.i { width: 12px; height: 12px; }
.event-chip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); margin: 0 auto 26px; max-width: 440px; font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.event-chip .ico { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-3); color: var(--text-3); display: grid; place-items: center; flex: none; }
.event-chip .ico svg.i { width: 15px; height: 15px; }
.event-chip strong { display: block; color: var(--text-2); font-weight: 600; font-size: 11px; margin-bottom: 3px; }

.draft-card { border: 1px dashed var(--accent-line); background: var(--surface); border-radius: 12px; padding: 14px 16px; margin: 0 0 22px auto; max-width: 80%; }
.draft-head { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.draft-head .avatar { width: 22px; height: 22px; font-size: 9px; }
.draft-head .why { margin-left: auto; color: var(--text-3); font-weight: 400; font-size: 10px; text-align: right; }
.draft-text { font-size: 12px; line-height: 1.75; white-space: pre-wrap; color: var(--text); font-weight: 400; }
.draft-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.composer-area { padding: 14px 30px 18px; flex: none; }
.composer { border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); overflow: hidden; }
.composer:focus-within { border-color: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3); }
.composer-tabs { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px 0; }
.composer-tabs .segmented button { font-size: 10.5px; padding: 3px 9px; }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 12px 18px 5px; font-size: 12px; line-height: 1.6; min-height: 64px; max-height: 160px; color: var(--text); font-weight: 400; }
.composer textarea::placeholder { color: var(--text-3); }
.composer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 13px 12px; }
.composer-note { display: flex; gap: 5px; align-items: center; font-size: 9.5px; color: var(--text-3); font-weight: 400; }
.composer-note svg.i { width: 12px; height: 12px; }
.keyboard-tip { display: flex; justify-content: space-between; gap: 10px; font-size: 9px; color: var(--text-3); margin: 10px 2px 0; font-weight: 400; }

.details { width: 280px; flex: none; border-left: 1px solid var(--border); background: var(--surface); overflow: auto; padding: 22px; scrollbar-width: thin; }
.details-head { display: flex; justify-content: space-between; align-items: center; }
.details-head h3 { font-size: 12px; font-weight: 600; }
.profile { text-align: center; margin: 22px 0 18px; }
.profile .avatar { margin: 0 auto 12px; }
.profile h4 { font-size: 15px; font-weight: 600; }
.profile p { font-size: 11px; color: var(--text-3); margin-top: 5px; font-weight: 400; }
.detail-block { border-top: 1px solid var(--border); padding: 15px 0; }
.detail-block .micro { margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center; }
.criteria { display: flex; flex-direction: column; gap: 7px; }
.criteria div { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-2); font-weight: 400; }
.criteria .ci { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.criteria .ci svg.i { width: 11px; height: 11px; stroke-width: 2.4; }
.criteria .pass .ci { background: var(--ok-soft); color: var(--ok); }
.criteria .fail .ci { background: var(--danger-soft); color: var(--danger); }
.criteria .unknown .ci { background: var(--surface-3); color: var(--text-3); }
.criteria b { margin-left: auto; font-weight: 600; color: var(--text); font-size: 10.5px; }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.lane { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px; min-height: 200px; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 12px; font-size: 12px; font-weight: 600; }
.lane-head .n { font-size: 10px; background: var(--surface-3); color: var(--text-3); border-radius: 5px; padding: 1px 7px; }
.lane.drag-over { outline: 2px dashed var(--text-3); outline-offset: -2px; }
.lead-card { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 13px; margin-bottom: 8px; cursor: grab; }
.lead-card:hover { border-color: var(--border-strong); }
.lead-card.dragging { opacity: .5; }
.lead-card .top { display: flex; gap: 9px; align-items: center; }
.lead-card strong { font-weight: 600; font-size: 12px; display: block; }
.lead-card .sub { font-size: 10px; color: var(--text-3); font-weight: 400; }
.lead-card .row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.lead-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 9.5px; color: var(--text-3); font-weight: 400; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-head h2 { font-size: 16px; font-weight: 600; min-width: 170px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--surface); }
.cal .dow { font-size: 8.5px; letter-spacing: .8px; font-weight: 600; text-transform: uppercase; color: var(--text-3); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal .day { min-height: 110px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.other { background: var(--surface-2); }
.cal .day.other .dnum { color: var(--text-3); opacity: .6; }
.cal .dnum { font-size: 10.5px; font-weight: 600; text-align: right; padding: 2px 4px; color: var(--text-2); }
.cal .day.today .dnum span { background: var(--primary); color: var(--primary-ink); border-radius: 5px; padding: 1px 6px; }
.ev { font-size: 9.5px; font-weight: 500; padding: 3px 6px 3px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; text-align: left; border: 0; width: 100%; background: var(--surface-3); color: var(--text-2); position: relative; }
.ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.ev.viewing::before { background: var(--accent); }
.ev.payment::before { background: var(--chart-expenses); }
.ev.document::before { background: var(--danger); }
.ev.task::before { background: var(--ok); }
.ev.more { background: none; color: var(--text-3); padding: 0 6px; }
.ev.more::before { display: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); font-weight: 400; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.agenda-day { margin-bottom: 20px; }
.agenda-day h4 { font-size: 9px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 9px; }
.slot { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); margin-bottom: 8px; }
.slot time { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.slot time small { display: block; font-size: 9.5px; color: var(--text-3); font-weight: 400; }
.slot.free { border-style: dashed; background: transparent; }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 10px; font-family: "Poppins", sans-serif; font-weight: 400; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 10px 12px; font-size: 11px; box-shadow: var(--shadow-md); min-width: 160px; z-index: 3; transform: translate(-50%, -100%); white-space: nowrap; }
.chart-tip b { display: block; font-weight: 600; margin-bottom: 6px; }
.chart-tip div { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-weight: 400; color: var(--text-2); margin-top: 3px; }
.chart-tip div strong { color: var(--text); font-weight: 600; }
.chart-tip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.chart-legend { display: flex; gap: 16px; font-size: 10.5px; color: var(--text-2); font-weight: 400; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.hero-figure { font-size: 28px; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; }

/* ---------- Feeds, settings ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-3); }
.feed-ico svg.i { width: 15px; height: 15px; }
.feed-ico.accent { background: var(--accent-soft); color: var(--accent-ink); }
.feed-ico.ok { background: var(--ok-soft); color: var(--ok); }
.feed-ico.info { background: var(--info-soft); color: var(--info); }
.feed-ico.danger { background: var(--danger-soft); color: var(--danger); }
.feed-item p { font-size: 11.5px; line-height: 1.6; font-weight: 400; color: var(--text-2); }
.feed-item p strong { color: var(--text); font-weight: 600; }
.feed-item time { font-size: 9.5px; color: var(--text-3); font-weight: 400; }

.setting { display: flex; gap: 14px; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting .grow { flex: 1; min-width: 0; }
.setting strong { font-weight: 600; font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.setting p { font-size: 11px; color: var(--text-3); margin-top: 4px; font-weight: 400; line-height: 1.6; }

/* Summary strip: a plain card in this design (no gradient). */
.hero-bobby { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 20px 22px; display: flex; gap: 16px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.hero-bobby h2 { font-size: 14px; font-weight: 600; }
.hero-bobby p { color: var(--text-2); font-size: 11.5px; margin-top: 4px; font-weight: 400; line-height: 1.6; }
.hero-bobby .avatar { width: 40px; height: 40px; font-size: 15px; }
.hero-stats { display: flex; margin-left: auto; flex-wrap: wrap; }
.hero-stats div { min-width: 92px; padding: 0 20px; border-left: 1px solid var(--border); }
.hero-stats b { font-size: 21px; font-weight: 600; display: block; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.hero-stats span { font-size: 9px; letter-spacing: 1px; color: var(--text-3); text-transform: uppercase; font-weight: 600; }

/* ---------- Drawer, dialog, toast, menu ---------- */
dialog { border: 1px solid var(--border); border-radius: 15px; padding: 0; width: min(400px, calc(100vw - 32px)); color: var(--text); background: var(--surface); box-shadow: var(--shadow-md); }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
dialog form { display: flex; flex-direction: column; height: 100%; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 24px 24px 6px; }
.dialog-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.4px; }
.dialog-head .icon-btn { border: 1px solid var(--border); }
.dialog-body { padding: 14px 24px 8px; overflow: auto; }
.dialog-body > p { font-size: 11.5px; color: var(--text-2); line-height: 1.8; margin-bottom: 18px; font-weight: 400; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px 22px; }
/* Forms open as a right-hand drawer, as in the admin workspace's editor. */
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(480px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 0; border-width: 0 0 0 1px; box-shadow: var(--shadow-lg); }
dialog.drawer .dialog-head { padding: 26px 26px 22px; border-bottom: 1px solid var(--border); }
dialog.drawer .dialog-body { flex: 1; padding: 24px 26px; }
dialog.drawer .dialog-foot { border-top: 1px solid var(--border); padding: 18px 26px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--primary); color: var(--primary-ink); padding: 12px 18px; border-radius: 9px; font-size: 11.5px; box-shadow: var(--shadow-md); z-index: 50; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 32px); }
.toast svg.i { width: 15px; height: 15px; }

.menu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-md); padding: 5px; min-width: 180px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 9px; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; font-size: 11.5px; text-align: left; color: var(--text-2); }
.menu button:hover { background: var(--surface-3); color: var(--text); }
.menu button svg.i { width: 15px; height: 15px; }
.menu button.danger { color: var(--danger); }

.later { max-width: 620px; margin: 40px auto; text-align: center; }
.later .ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--surface-3); color: var(--text-3); }
.later .ico svg.i { width: 24px; height: 24px; }
.later h1 { font-size: 22px; font-weight: 700; }
.later p { color: var(--text-2); margin-top: 10px; line-height: 1.8; font-weight: 400; font-size: 12px; }
.later ul { text-align: left; margin: 22px auto 0; padding: 18px 22px 18px 38px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text-2); line-height: 2; font-weight: 400; font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.main-side { grid-template-columns: minmax(0, 1fr); }
  .inbox-shell { position: relative; }
  .details { position: absolute; right: 0; top: 80px; bottom: 0; z-index: 4; box-shadow: -10px 0 30px rgba(37, 37, 51, .08); }
}
@media (max-width: 1080px) {
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox-list { width: 290px; }
  .chat-header { padding: 0 22px; }
  .messages { padding: 22px 24px; }
  .composer-area { padding: 12px 22px 18px; }
  .msg, .draft-card { max-width: 94%; }
  .keyboard-tip > span:last-child { display: none; }
  .prop-card { grid-template-columns: 150px minmax(0, 1fr); }
  .prop-side { grid-column: 1 / -1; flex-direction: row; border-top: 1px solid var(--border); }
  .hero-stats { margin-left: 0; }
  .hero-stats div:first-child { border-left: 0; padding-left: 0; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 45; transform: translateX(-100%); transition: transform .2s ease; width: 260px; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.collapsed .sidebar { width: 260px; }
  .sidebar-collapse { display: none; }
  .menu-button { display: grid; }
  .topbar { padding: 0 16px; height: 60px; }
  .global-search { width: auto; flex: 1; max-width: 260px; }
  .global-search kbd { display: none; }
  .page { padding: 22px 16px 40px; }
  .page-head h1 { font-size: 24px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .inbox-list { width: 100%; border: 0; }
  .chat { display: none; }
  .inbox-shell.chat-open .inbox-list { display: none; }
  .inbox-shell.chat-open .chat { display: flex; }
  .details { top: 0; width: 100%; }
  .chat-header { padding: 0 14px; height: 68px; }
  .thread-top { padding: 14px 16px 0; }
  .messages { padding: 20px 14px; }
  .composer-area { padding: 8px 12px 12px; }
  .keyboard-tip { display: none; }
  .prop-card { grid-template-columns: minmax(0, 1fr); }
  .prop-photo { min-height: 90px; border-right: 0; border-bottom: 1px solid var(--border); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .slot { grid-template-columns: 56px minmax(0, 1fr); }
  .slot > :last-child { grid-column: 1 / -1; }
  .cal .day { min-height: 70px; padding: 3px; }
  .ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .ev::before { width: 100%; }
  .ev.more { font-size: 9px; height: auto; }
  .hero-stats div { padding: 0 14px; min-width: 70px; }
  .table td, .table th { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) {
  .crumbs, .topbar-actions .pill, .chat-header .header-actions > .badge, .thread-top > :last-child { display: none; }
  .global-search { max-width: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 20px; }
  .toolbar .search { max-width: none; min-width: 100%; }
  .composer-tabs .btn.ghost { font-size: 0; gap: 0; }
  .draft-head .why { display: none; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; min-width: 0; padding: 0 10px; }
}

/* ---------- Fit and finish ---------- */
.list-heading .tools { display: flex; align-items: center; gap: 6px; }
.tx-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(170px, auto) 100px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tx-row:last-child { border-bottom: 0; }
.tx-row .tx-tag { text-align: right; min-width: 0; }
.tx-row .tx-amt { text-align: right; }
.wrap-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1180px) {
  .table .opt { display: none; }
}
@media (max-width: 1080px) {
  /* Tables with a header become stacked rows; labels come from data-label (set in app.js). */
  .table.stacked thead { display: none; }
  .table.stacked, .table.stacked tbody, .table.stacked tr { display: block; width: 100%; }
  .table.stacked tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table.stacked tr:last-child { border-bottom: 0; }
  .table.stacked td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 4px 0 !important; text-align: right; max-width: none !important; }
  .table.stacked td::before { content: attr(data-label); font-size: 9px; letter-spacing: .8px; font-weight: 600; color: var(--text-3); text-transform: uppercase; text-align: left; flex: none; }
  .table.stacked td:first-child { display: block; text-align: left; padding-bottom: 8px !important; }
  .table.stacked td:first-child::before, .table.stacked td[data-label=""]::before { display: none; }
  .table.stacked td[data-label=""] { justify-content: flex-end; }
  .table.stacked td[colspan] { display: block; }
  .table.stacked tbody tr:hover td { background: transparent; }
  .table.stacked .person { justify-content: flex-end; }
  .table.stacked td:first-child .person { justify-content: flex-start; }
  .table.stacked .cell-v { min-width: 0; text-align: right; }
  .composer-tabs { flex-wrap: wrap; gap: 6px; }
  .composer-tabs .btn.ghost { font-size: 0; gap: 0; }
  .inbox-filters button { font-size: 10.5px; }
  .inbox-filters button span { margin-left: 2px; padding: 1px 4px; }
}
@media (max-width: 860px) {
  /* Tabs become wrapping chips so nothing scrolls out of sight. */
  .tabs { flex-wrap: wrap; gap: 6px; border-bottom: 0; overflow: visible; }
  .tabs button, .tabs a { padding: 6px 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
  .tabs .active { background: var(--active); border-color: var(--border-strong); }
  .tabs .active::after { display: none; }
  .tx-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .tx-row .tx-tag { grid-column: 2 / -1; grid-row: 2; text-align: left; }
  .tx-row .tx-tag .cell-sub { display: inline; margin-left: 6px; }
}

/* ---------- Availability requests ---------- */
.avail-top { display: flex; align-items: center; gap: 12px; }
.avail-top .grow { flex: 1; min-width: 0; }
.avail-top strong { font-weight: 600; font-size: 12.5px; }
.avail-reply { margin-top: 12px; background: var(--surface-2); }
.window-list { display: flex; flex-wrap: wrap; gap: 8px; }
.window { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; padding: 7px 11px; font-size: 11px; color: var(--text-2); text-align: left; }
.window svg.i { width: 14px; height: 14px; color: var(--text-3); }
.window strong { color: var(--text); font-weight: 600; }
.window:not(:disabled):hover { border-color: var(--text-3); background: var(--surface-3); }
.window:disabled { cursor: default; }
.slot-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Maintenance tickets ---------- */
.ev.repair::before { background: var(--warn); }
.photo-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 16px; }
.photo-tile { aspect-ratio: 4 / 3; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); display: grid; place-items: center; align-content: center; gap: 6px; color: var(--text-3); font-size: 10px; }
.photo-tile svg.i { width: 22px; height: 22px; }
.t-msg { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.t-msg:first-child { padding-top: 0; }
.t-msg .grow { flex: 1; min-width: 0; }
.t-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; }
.t-meta strong { font-weight: 600; }
.t-meta time { margin-left: auto; font-size: 9.5px; color: var(--text-3); font-weight: 400; }
.t-msg p { font-size: 12px; line-height: 1.7; color: var(--text-2); font-weight: 400; margin-top: 4px; overflow-wrap: anywhere; }
.t-msg.internal p { background: var(--warn-soft); border: 1px dashed var(--warn-line); border-radius: 8px; padding: 8px 11px; color: var(--text); }
.ticket-thread .composer textarea { min-height: 54px; }

.report-wrap { max-width: 560px; margin: 0 auto; }
.report-card .card-body { padding: 26px 26px 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; border: 1px solid var(--border-strong); border-radius: 20px; padding: 6px 12px; font-size: 11px; color: var(--text-2); background: var(--surface); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border-strong); border-radius: 9px; padding: 11px 13px; font-size: 11px; line-height: 1.6; color: var(--text-2); font-weight: 400; cursor: pointer; }
.radio-card strong { color: var(--text); font-weight: 600; font-size: 11.5px; }
.radio-card input { accent-color: var(--primary); margin-top: 3px; flex: none; }
.radio-card:has(input:checked) { border-color: var(--text-3); background: var(--surface-2); }
@media (max-width: 520px) {
  .report-card .card-body { padding: 20px 16px 22px; }
  .slot-actions { justify-content: flex-start; }
}

/* Breadcrumbs shrink with an ellipsis instead of pushing the search box. */
.crumbs > a, .crumbs > span:not(.sep) { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.crumbs .sep { flex: none; }
@media (max-width: 1180px) {
  .global-search { width: 220px; }
  .topbar-actions .pill { font-size: 0; gap: 0; padding: 7px; }
}

/* Sign-in screen, and the sign-out button beside the signed-in user. */
.signin { min-height: 100%; display: grid; place-items: center; padding: 40px 16px; box-sizing: border-box; }
.signin-card { width: 100%; max-width: 380px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); padding: 34px 32px 26px; }
.signin-brand { margin-bottom: 30px; }
.signin h1 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; margin: 0; color: var(--text); }
.signin-lead { font-size: 11.5px; line-height: 1.7; color: var(--text-2); font-weight: 400; margin: 6px 0 22px; }
.signin-password { position: relative; }
.signin-password .input { padding-right: 44px; }
.signin-password .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.signin-password .icon-btn[aria-pressed="true"] { color: var(--text); }
.signin-submit { width: 100%; padding: 11px 14px; font-size: 12px; margin-top: 4px; }
.signin-help { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 20px 0 0; font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.signin-help svg.i { width: 13px; height: 13px; flex: none; }
.note-banner.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--text); }
.note-banner.danger svg.i { color: var(--danger); }
.note-banner[hidden] { display: none; }
.sidebar-user > div { min-width: 0; }
.sidebar-user #sign-out { margin-left: auto; }
.app.collapsed .sidebar-user { flex-direction: column; gap: 6px; }
.app.collapsed .sidebar-user #sign-out { margin-left: 0; }
@media (max-width: 520px) {
  .signin-card { padding: 28px 20px 22px; }
}
