/* Harder Holdings – brand styles. Colours are taken from the logo. */
@font-face { font-family: 'Ubuntu'; src: url('/assets/fonts/ubuntu-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Ubuntu'; src: url('/assets/fonts/ubuntu-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Ubuntu'; src: url('/assets/fonts/ubuntu-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --navy-950: #030f33; --navy-900: #061a4f; --navy-800: #0f2a63; --navy-700: #2a4574; --navy-500: #5470a3; --navy-300: #aac0e8; --navy-100: #e5ecf8; --navy-50: #f2f5fb;
  --bg: #f4f6fa; --card: #fff; --line: #e2e7f0; --line-2: #eef1f6; --text: #0e1a33; --muted: #5b6782; --faint: #8a94ab;
  --ok: #17804f; --ok-bg: #e5f5ec; --warn: #a76510; --warn-bg: #fdf2dc; --bad: #c0392b; --bad-bg: #fbe8e6; --info: #2a4574; --info-bg: #e5ecf8;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(6, 26, 79, .05), 0 4px 16px rgba(6, 26, 79, .05);
  --shadow-lg: 0 12px 40px rgba(6, 26, 79, .18);
  --font: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sb: 256px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.25; margin: 0 0 .5em; color: var(--navy-900); letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; margin-top: 1.2em; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--navy-50); padding: 2px 6px; border-radius: 6px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .block { display: block; } .center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.pre { white-space: pre-line; } .pos { color: var(--ok); } .neg { color: var(--bad); } .ok-text { color: var(--ok); display: inline-flex; gap: 4px; align-items: center; } .warn-text { color: var(--warn); } .danger-text { color: var(--bad) !important; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-500); margin-bottom: 8px; }

/* ---------- boot ---------- */
.boot, .boot-error { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px; text-align: center; background: #fff; }
.boot img, .boot-error img { width: 260px; }
.boot-error button { font: inherit; padding: 10px 18px; border-radius: 10px; border: 0; background: var(--navy-900); color: #fff; cursor: pointer; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--navy-100); border-top-color: var(--navy-900); animation: spin .8s linear infinite; display: inline-block; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: flex; justify-content: center; padding: 80px 0; }
.page-loading.sm { padding: 30px 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--navy-900); background: var(--navy-900); color: #fff; font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; text-decoration: none !important; }
.btn:hover { background: var(--navy-800); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--navy-300); outline-offset: 2px; }
.btn.secondary { background: #fff; color: var(--navy-900); border-color: var(--line); box-shadow: 0 1px 1px rgba(6,26,79,.04); }
.btn.secondary:hover { background: var(--navy-50); border-color: #d3dbe8; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--navy-700); }
.btn.ghost:hover { background: var(--navy-50); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.light { background: #fff; color: var(--navy-900); border-color: #fff; }
.btn.light:hover { background: var(--navy-100); }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn.outline-light:hover { background: rgba(255,255,255,.1); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.secondary.loading::after { border-color: var(--navy-100); border-top-color: var(--navy-900); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--navy-50); color: var(--navy-900); text-decoration: none; }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy-700); font: inherit; cursor: pointer; text-decoration: underline; }
.link { font-size: 13px; font-weight: 500; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.4; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.muted { background: #eef0f4; color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sb) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy-900); color: #fff; display: flex; flex-direction: column; overflow: hidden; z-index: 40; }
.sidebar::before { content: ''; position: absolute; width: 140%; height: 90px; background: rgba(255,255,255,.035); transform: rotate(-38deg); top: 40%; left: -30%; pointer-events: none; }
.sb-brand { display: block; padding: 22px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-brand img { height: 44px; width: auto; display: block; }
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sb-group { margin-top: 10px; }
.sb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: rgba(255,255,255,.45); padding: 8px 12px 6px; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: rgba(255,255,255,.78); font-size: 14px; position: relative; text-decoration: none !important; }
.sb-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-link.active { background: rgba(255,255,255,.11); color: #fff; }
.sb-link.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--navy-300); }
.sb-link .ic { opacity: .9; }
.sb-badge { margin-left: auto; background: var(--navy-300); color: var(--navy-900); font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.sb-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sb-user b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user small { color: rgba(255,255,255,.55); font-size: 12px; }
.sb-logout { background: none; border: 0; color: rgba(255,255,255,.65); cursor: pointer; padding: 6px; border-radius: 8px; }
.sb-logout:hover { color: #fff; background: rgba(255,255,255,.08); }
.sb-overlay { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-300); color: var(--navy-900); display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: 13px; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; background: var(--navy-100); }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; background: var(--navy-100); }
.avatar .ic { width: 16px; height: 16px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 24px; background: rgba(244,246,250,.85); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.burger, .tb-logo { display: none; }
.tb-logo img { height: 30px; }
.tb-spacer { flex: 1; }
.tb-pop { position: relative; }
.bell .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.avatar-btn { border: 0; background: none; padding: 2px; cursor: pointer; border-radius: 50%; }
.popover { position: absolute; right: 0; top: 46px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60; }
.notif-pop { width: min(380px, 92vw); max-height: 70vh; display: flex; flex-direction: column; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.np-body { overflow-y: auto; }
.np-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 12px 16px 12px 24px; font: inherit; cursor: pointer; position: relative; }
.np-item:hover { background: var(--navy-50); }
.np-item.unread::before { content: ''; position: absolute; left: 10px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--navy-700); }
.np-item b { display: block; font-weight: 500; font-size: 14px; }
.np-item span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-item small { color: var(--faint); font-size: 12px; }
.np-empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.np-empty .ic { width: 28px; height: 28px; opacity: .5; }
.menu-pop { width: 240px; padding: 6px; }
.menu-pop .mp-head { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu-pop .mp-head b { display: block; font-weight: 500; } .menu-pop .mp-head small { color: var(--muted); font-size: 12px; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none !important; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--navy-50); }
.content { padding: 8px 32px 48px; max-width: 1280px; width: 100%; }
.tabbar { display: none; }

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 22px; }
.page-head h1 { margin: 0; font-size: 26px; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.back .ic { width: 15px; height: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card.pad, .pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head.flat { padding: 0 0 12px; border: 0; }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--navy-500); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
.grid-2 > .card, .grid-main > .card { margin-bottom: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.col { min-width: 0; }
.col > .card:last-child { margin-bottom: 0; }
.section-title { margin: 22px 0 10px; font-size: 15px; color: var(--muted); }
.stack { display: grid; gap: 10px; }
.empty { text-align: center; padding: 44px 24px; }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--navy-50); color: var(--navy-500); margin-bottom: 12px; }
.empty-ic .ic { width: 26px; height: 26px; }
.empty h3 { margin-bottom: 4px; } .empty p { color: var(--muted); max-width: 420px; margin: 0 auto 16px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: #e9edf4; border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seg a, .seg .seg-btn { padding: 6px 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; border: 0; background: none; font: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none !important; }
.seg a.active { background: #fff; color: var(--navy-900); box-shadow: 0 1px 3px rgba(6,26,79,.1); }
.filters-bar { margin-bottom: 14px; }
.filters-bar select, .filters select { height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats.three, .stats.six { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1560px) { .stats.six { grid-template-columns: repeat(6, 1fr); } } .stats.four { grid-template-columns: repeat(4, 1fr); }
.stat { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin: 0; color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: #cbd5e6; transform: translateY(-1px); }
.stat-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--navy-100); color: var(--navy-900); }
.stat-ic.green { background: var(--ok-bg); color: var(--ok); } .stat-ic.red { background: var(--bad-bg); color: var(--bad); } .stat-ic.amber { background: var(--warn-bg); color: var(--warn); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 500; color: var(--navy-900); line-height: 1.25; margin: 2px 0; }
.stat-sub { font-size: 12px; color: var(--faint); }
.grow { flex: 1; }
.progress { height: 6px; border-radius: 6px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); border-radius: 6px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.right, .tbl td.right { text-align: right; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--navy-50); }
.tbl small { font-size: 12px; }
.who { display: flex; align-items: center; gap: 10px; }
.rthumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; }
.rthumb.ph { display: inline-flex; align-items: center; justify-content: center; background: var(--navy-50); color: var(--navy-500); }

/* key-value */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 4px 0 14px; }
.kv.three { grid-template-columns: repeat(3, 1fr); }
.kv > div span { display: block; font-size: 12px; color: var(--muted); }
.kv > div b { font-weight: 500; font-size: 14px; word-break: break-word; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--navy-900); }
.tab.active { color: var(--navy-900); border-bottom-color: var(--navy-900); }
.tab-count { background: var(--bad-bg); color: var(--bad); font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }

/* notes */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; background: var(--info-bg); color: var(--navy-900); }
.note .ic { margin-top: 2px; color: var(--navy-700); }
.note.ok { background: var(--ok-bg); } .note.ok .ic { color: var(--ok); }
.note.warn { background: var(--warn-bg); } .note.warn .ic { color: var(--warn); }
.note.bad { background: var(--bad-bg); } .note.bad .ic { color: var(--bad); }
.note.muted { background: #eef0f4; }
.note p { margin: 6px 0 0; }
.note a { font-weight: 500; }
.note.emergency.compact { font-size: 13px; padding: 10px 14px; }

/* chips & files */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chips.pad { padding: 14px 20px; }
.chip { background: var(--navy-50); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; font-size: 13px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font-size: 13px; background: #fff; color: var(--text); max-width: 260px; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.thumb { padding: 0; border: 0; background: var(--navy-50); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.thumb:hover img { transform: scale(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(3,15,51,.92); display: flex; align-items: center; justify-content: center; padding: 50px 60px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lb-close { top: 14px; right: 14px; } .lb-prev { left: 14px; top: 50%; } .lb-next { right: 14px; top: 50%; }
.lb-open { position: absolute; bottom: 14px; color: #fff; font-size: 13px; display: flex; gap: 6px; align-items: center; opacity: .8; }

/* toasts */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--navy-900); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .2s ease; max-width: 92vw; pointer-events: auto; }
.toast.ok .ic { color: #7fd8a8; } .toast.bad { background: var(--bad); } .toast.info .ic { color: var(--navy-300); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* modals */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(3,15,51,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fadeIn .15s; }
.modal-wrap.out { opacity: 0; transition: opacity .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: popIn .18s ease; margin-bottom: 40px; }
.modal.sm { max-width: 440px; } .modal.lg { max-width: 760px; }
@keyframes popIn { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 16px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line-2); }
.confirm-text { color: var(--muted); }
.link-box { display: flex; gap: 8px; margin: 12px 0; }
.link-box input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; background: var(--navy-50); color: var(--text); }
.invite-row { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.action-list { display: grid; gap: 4px; }
.action-list button { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 10px; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.action-list button:hover { background: var(--navy-50); }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px 14px; }
.field { grid-column: span 6; display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 0; }
.field.half { grid-column: span 3; } .field.third { grid-column: span 2; } .field.full { grid-column: 1 / -1; }
.card > form > .field, .card .field { margin-bottom: 12px; }
.form-grid .field { margin-bottom: 0; }
.field > label { font-size: 13px; font-weight: 500; color: var(--navy-900); }
.req { color: var(--bad); margin-left: 3px; }
.hint { color: var(--faint); font-size: 12px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; height: 42px; border: 1px solid #d6dde9; border-radius: var(--radius-sm); padding: 0 12px; font: inherit; font-size: 15px; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6782' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 44px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(84,112,163,.18); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-prefix input { padding-left: 26px; }
.form-heading { margin-top: 8px; }
.form-heading h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-500); }
.form-heading p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 14px 0 0; }
form .form-error + .btn, form .form-grid + .btn, form > .btn[type=submit] { margin-top: 16px; }
.form-intro { color: var(--muted); font-size: 14px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.checkbox input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy-900); flex: none; }
.checkbox small { display: block; color: var(--faint); font-size: 12px; }
.field.check { justify-content: center; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card span { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; height: 100%; transition: all .15s; }
.radio-card b { font-weight: 500; display: block; font-size: 14px; }
.radio-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.radio-card input:checked + span { border-color: var(--navy-900); background: var(--navy-50); box-shadow: 0 0 0 1px var(--navy-900); }
.radio-card.bad input:checked + span { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 0 0 1px var(--bad); }
.radio-card.warn input:checked + span { border-color: var(--warn); background: var(--warn-bg); box-shadow: 0 0 0 1px var(--warn); }
.radio-card input:focus-visible + span { outline: 3px solid var(--navy-300); }

/* uploader */
.uploader { display: grid; gap: 10px; }
.up-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.up-list:empty { display: none; }
.up-item { position: relative; border-radius: 10px; overflow: hidden; background: var(--navy-50); aspect-ratio: 1; border: 1px solid var(--line); }
.up-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-item.busy img { opacity: .4; }
.up-item .spinner { position: absolute; top: 50%; left: 50%; margin: -8px 0 0 -8px; }
.up-doc { display: flex; align-items: center; justify-content: center; height: 70%; color: var(--navy-500); }
.up-doc .ic { width: 28px; height: 28px; }
.up-name { position: absolute; bottom: 0; left: 0; right: 0; font-size: 11px; padding: 3px 6px; background: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(3,15,51,.7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.up-x .ic { width: 14px; height: 14px; }
.up-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed #c5cfe0; border-radius: 12px; padding: 18px; cursor: pointer; text-align: center; color: var(--navy-700); background: #fafbfd; transition: all .15s; }
.up-drop:hover, .up-drop.over { border-color: var(--navy-500); background: var(--navy-50); }
.up-drop .ic { width: 24px; height: 24px; }
.up-drop span { font-weight: 500; font-size: 14px; }
.up-drop small { color: var(--faint); font-size: 12px; }
.upl-inline .up-drop { flex-direction: row; padding: 8px 12px; gap: 8px; }
.upl-inline .up-drop small { display: none; }
.upl-inline .up-list { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }

/* ---------- dashboard ---------- */
.onboarding { background: linear-gradient(120deg, #fff 60%, var(--navy-50)); }
.ob-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.ob-head img { width: 56px; }
.ob-head h2 { margin: 0 0 2px; }
.ob-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; counter-reset: s; }
.ob-steps a { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); height: 100%; text-decoration: none !important; }
.ob-steps a:hover { border-color: var(--navy-500); }
.ob-steps .ic { grid-row: span 2; color: var(--navy-700); margin-top: 2px; }
.ob-steps b { font-weight: 500; font-size: 14px; } .ob-steps span { font-size: 12px; color: var(--muted); }
.alert-list, .row-list, .agenda, .activity, .notice-list, .doc-list, .statement, .comp-mini { list-style: none; margin: 0; padding: 0; }
.alert-list li a { display: block; padding: 12px 20px 12px 34px; border-bottom: 1px solid var(--line-2); color: var(--text); position: relative; text-decoration: none !important; }
.alert-list li a:hover { background: var(--navy-50); }
.alert-list li a::before { content: ''; position: absolute; left: 18px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.alert-list li.high a::before { background: var(--bad); }
.alert-list b { font-weight: 500; display: block; font-size: 14px; } .alert-list span { font-size: 13px; color: var(--muted); }
.all-good { display: flex; gap: 12px; align-items: center; padding: 18px 20px; color: var(--ok); }
.all-good .ic { width: 28px; height: 28px; }
.all-good b { color: var(--text); font-weight: 500; } .all-good p { margin: 0; color: var(--muted); font-size: 14px; }
.card.pad .all-good { padding: 6px 0; }
.row-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.card.pad .row-list li { padding: 12px 0; }
.row-list li:last-child { border-bottom: 0; }
.row-list li.clickable { cursor: pointer; } .row-list li.clickable:hover { background: var(--navy-50); }
.row-list b { font-weight: 500; display: block; font-size: 14px; } .row-list small { color: var(--muted); font-size: 12px; }
.rl-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.agenda li { display: flex; gap: 14px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line-2); }
.agenda li:last-child { border-bottom: 0; }
.agenda li.clickable { cursor: pointer; } .agenda li.clickable:hover { background: var(--navy-50); }
.agenda li > div:nth-child(2) { flex: 1; min-width: 0; }
.agenda b { font-weight: 500; display: block; font-size: 14px; } .agenda small { color: var(--muted); font-size: 12px; }
.ag-date { width: 42px; text-align: center; flex: none; background: var(--navy-50); border-radius: 10px; padding: 4px 0; }
.ag-date b { font-size: 17px; line-height: 1.1; color: var(--navy-900); } .ag-date small { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.ev-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--navy-500); }
.ev-dot.rent, .cal-ev.rent { --c: #17804f; } .ev-dot.certificate, .cal-ev.certificate { --c: #c0392b; } .ev-dot.inspection, .cal-ev.inspection { --c: #2a4574; } .ev-dot.repair, .cal-ev.repair { --c: #a76510; } .ev-dot.tenancy, .cal-ev.tenancy { --c: #7b4fb5; } .ev-dot.finance, .cal-ev.finance { --c: #2b8a9b; }
.ev-dot { background: var(--c, var(--navy-500)); }
.activity li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 20px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.activity li:last-child { border: 0; }
.activity small { display: block; color: var(--faint); font-size: 12px; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.cal-head h2 { margin: 0 6px; font-size: 18px; min-width: 170px; text-align: center; }
.cal-legend { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; gap: 5px; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 8px; font-size: 12px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line-2); }
.cal-cell { min-height: 104px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.empty { background: #fafbfd; }
.cal-cell.today .cal-n { background: var(--navy-900); color: #fff; }
.cal-n { font-size: 12px; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.cal-ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; border-left: 2px solid var(--c); }

/* properties */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.prop-card { margin: 0; overflow: hidden; color: inherit; text-decoration: none !important; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.prop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pc-img { position: relative; aspect-ratio: 16/9; background: var(--navy-50); overflow: hidden; }
.pc-img > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-ph, .lc-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy-50), var(--navy-100)); position: relative; overflow: hidden; }
.pc-ph::after, .lc-ph::after { content: ''; position: absolute; width: 160%; height: 26px; background: rgba(255,255,255,.7); transform: rotate(-38deg); }
.pc-ph img, .lc-ph img { width: 72px; opacity: .55; position: relative; z-index: 1; }
.pc-status { position: absolute; top: 10px; left: 10px; }
.pc-status .badge { box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.pc-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.pc-body h3 { margin: 0; } .pc-body > p { margin: 2px 0 8px; font-size: 13px; }
.pc-meta { display: flex; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pc-meta span { display: inline-flex; gap: 4px; align-items: center; }
.pc-meta .ic { width: 15px; height: 15px; }
.pc-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.pc-foot small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; } .pc-foot b { font-weight: 500; font-size: 14px; }
.pc-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.flag { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; padding: 4px 9px; border-radius: 8px; }
.flag .ic { width: 13px; height: 13px; }
.flag.ok { background: var(--ok-bg); color: var(--ok); } .flag.warn { background: var(--warn-bg); color: var(--warn); } .flag.bad { background: var(--bad-bg); color: var(--bad); }
.score { font-weight: 500; font-size: 13px; padding: 3px 9px; border-radius: 999px; }
.score.ok { background: var(--ok-bg); color: var(--ok); } .score.warn { background: var(--warn-bg); color: var(--warn); } .score.bad { background: var(--bad-bg); color: var(--bad); }
.comp-mini li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.comp-mini li:last-child { border: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; border: 2px solid transparent; }
.photo.cover { border-color: var(--navy-900); }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo-acts { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; background: rgba(255,255,255,.9); border-radius: 9px; }
.photo-acts .icon-btn { width: 30px; height: 30px; }
.photo.cover .photo-acts .icon-btn:first-child { color: #d49b00; }
#photo-up { margin-bottom: 10px; }

/* compliance matrix */
.matrix th { text-align: center; } .matrix th:first-child { text-align: left; }
.mx { text-align: center; padding: 6px !important; }
.mx.na { color: var(--faint); }
.mx-cell { border: 0; font: inherit; font-size: 12px; font-weight: 500; padding: 6px 8px; border-radius: 8px; cursor: pointer; width: 100%; min-width: 74px; white-space: nowrap; }
.mx-cell.valid { background: var(--ok-bg); color: var(--ok); } .mx-cell.expiring { background: var(--warn-bg); color: var(--warn); } .mx-cell.expired { background: var(--bad); color: #fff; } .mx-cell.missing.legal { background: var(--bad-bg); color: var(--bad); border: 1px dashed var(--bad); } .mx-cell.missing { background: #f2f4f8; color: var(--faint); }
.mx-cell:hover { filter: brightness(.95); }
.guidance summary { cursor: pointer; font-weight: 500; display: flex; gap: 8px; align-items: center; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.guide-grid > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.guide-grid > div > b { font-weight: 500; display: block; margin-bottom: 4px; }
.guide-grid p { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* tenancy */
.checklist .cl-row { display: grid; grid-template-columns: 1fr 160px 70px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.checklist .cl-row input[type=date] { height: 36px; font-size: 14px; }
.checklist .btn { margin-top: 16px; }
.print-only { display: none; }
.menu-wrap { position: relative; display: inline-block; }

/* repairs */
.timeline { position: relative; margin: 10px 0 6px; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { display: flex; gap: 14px; padding: 8px 0; position: relative; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-50); color: var(--navy-700); display: flex; align-items: center; justify-content: center; flex: none; position: relative; z-index: 1; border: 3px solid #fff; }
.tl-dot .ic { width: 14px; height: 14px; }
.tl-item.internal .tl-body { background: #fff8e6; border: 1px dashed #e7c77a; }
.tl-item.comment .tl-body { background: var(--navy-50); }
.tl-body { flex: 1; min-width: 0; border-radius: 12px; padding: 8px 12px; }
.tl-item.status .tl-body, .tl-item.system .tl-body { padding: 6px 2px; }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tl-head b { font-weight: 500; } .tl-head small { color: var(--faint); margin-left: auto; }
.tl-body p { margin: 4px 0 0; font-size: 14px; }
.composer { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 10px; display: grid; gap: 10px; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.contact-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.contact-row b { font-weight: 500; }
.rooms { display: grid; gap: 8px; }
.room-row { display: grid; grid-template-columns: 1.1fr 120px 2fr 36px; gap: 8px; align-items: center; }
.room-row input, .room-row select { height: 38px; font-size: 14px; }

/* messages */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 200px); min-height: 480px; overflow: hidden; }
.msg-threads { border-right: 1px solid var(--line); overflow-y: auto; }
.thread { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none !important; position: relative; }
.thread:hover { background: var(--navy-50); } .thread.active { background: var(--navy-100); }
.thread > div { flex: 1; min-width: 0; }
.thread b { font-weight: 500; display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .snip { display: block; color: var(--faint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .unread { background: var(--navy-900); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.thread .when { flex: none; color: var(--faint); }
.msg-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.msg-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.msg-head > div { flex: 1; } .msg-head b { font-weight: 500; display: block; } .msg-head small { color: var(--muted); font-size: 12px; }
.back-mobile { display: none; }
.msg-list { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #fafbfd; }
.msg { max-width: 76%; display: flex; flex-direction: column; align-items: flex-start; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.bubble { background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: 14px; }
.msg.mine .bubble { background: var(--navy-900); color: #fff; border-color: var(--navy-900); border-radius: 16px 16px 4px 16px; }
.bubble p { margin: 0; }
.bubble .gallery { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); margin: 6px 0 0; min-width: 180px; }
.msg.mine .file-chip { color: var(--text); }
.msg > small { font-size: 11px; color: var(--faint); margin-top: 3px; }
.msg-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 40px; gap: 4px; }
.msg-empty .ic { width: 36px; height: 36px; opacity: .4; }
.msg-compose { border-top: 1px solid var(--line); padding: 10px 12px; background: #fff; display: grid; gap: 8px; }
.mc-row { display: flex; gap: 8px; align-items: flex-end; }
.mc-row textarea { min-height: 42px; max-height: 160px; resize: none; }
.mc-row .btn { width: 46px; padding: 0; height: 42px; flex: none; }
.msg-single { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 440px; overflow: hidden; }

/* notices / docs / enquiries */
.notice-list li { display: flex; gap: 12px; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.nl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.nl-head b { font-weight: 500; }
.notice-list p { margin: 4px 0; font-size: 14px; }
.doc-list li { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.doc-list li > div:nth-child(2) { flex: 1; min-width: 160px; }
.doc-list b { font-weight: 500; display: block; } .doc-list small { color: var(--muted); font-size: 12px; }
.enq-list { display: grid; gap: 12px; }
.enq { margin: 0; }
.enq-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.enq-head b { font-weight: 500; font-size: 16px; }
.enq-foot { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line-2); padding-top: 12px; }
.enq-foot select { width: 160px; height: 36px; font-size: 14px; } .enq-foot input { height: 36px; font-size: 14px; }

/* reports */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); } .chart .axis { font-size: 11px; fill: var(--faint); font-family: var(--font); }
.chart .bar-in { fill: var(--navy-900); } .chart .bar-out { fill: var(--navy-300); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-in { background: var(--navy-900); } .lg-out { background: var(--navy-300); }

/* ---------- tenant portal ---------- */
.t-hero { position: relative; overflow: hidden; background: var(--navy-900); color: #fff; border: 0; min-height: 150px; display: flex; align-items: flex-end; }
.t-hero::before { content: ''; position: absolute; width: 140%; height: 60px; background: rgba(255,255,255,.06); transform: rotate(-38deg); top: 40%; left: -20%; z-index: 1; }
.t-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.t-hero-body { position: relative; z-index: 2; padding: 26px; }
.t-hero h1 { color: #fff; margin: 0 0 4px; font-size: 28px; }
.t-hero p { margin: 0; color: rgba(255,255,255,.85); }
.t-hero .eyebrow { color: var(--navy-300); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.q { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .15s; }
.q:hover { transform: translateY(-2px); }
.q .ic { width: 26px; height: 26px; color: var(--navy-700); margin-bottom: 4px; }
.q b { font-weight: 500; } .q small { color: var(--muted); font-size: 12px; } .q small.hot { color: var(--bad); font-weight: 500; }
.q.primary { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.q.primary .ic { color: var(--navy-300); } .q.primary small { color: rgba(255,255,255,.7); }
.attention { border-left: 4px solid var(--warn); }
.attention h3 { display: flex; gap: 8px; align-items: center; color: var(--warn); }
.notice { border-left: 4px solid var(--navy-500); }
.notice.pinned { border-left-color: var(--navy-900); }
.notice .nl-head .ic { color: var(--navy-500); }
.notice .nl-head small { margin-left: auto; }
.rent-big { padding: 14px 16px; border-radius: 12px; background: var(--ok-bg); margin-bottom: 14px; }
.rent-big span { display: block; font-size: 13px; color: var(--muted); }
.rent-big b { font-size: 28px; font-weight: 500; color: var(--ok); display: flex; gap: 8px; align-items: center; }
.rent-big b .ic { width: 24px; height: 24px; }
.rent-big.arrears { background: var(--bad-bg); } .rent-big.arrears b { color: var(--bad); }
.rent-big.due { background: var(--info-bg); } .rent-big.due b { color: var(--navy-900); }
.contact-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.contact-card img { width: 44px; }
.contact-card > div:nth-child(2) { flex: 1; min-width: 160px; }
.contact-card b { font-weight: 500; display: block; } .contact-card small { display: block; color: var(--muted); font-size: 13px; }
.repair-card { display: flex; gap: 14px; align-items: center; padding: 12px 16px; margin: 0; color: var(--text); text-decoration: none !important; }
.repair-card > img, .rc-ic { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.rc-ic { display: flex; align-items: center; justify-content: center; background: var(--navy-50); color: var(--navy-700); }
.repair-card > div { flex: 1; min-width: 0; }
.repair-card b { font-weight: 500; display: block; } .repair-card small { color: var(--muted); font-size: 12px; display: block; margin-bottom: 6px; }
.repair-card .badges { margin: 0; }
.repair-card > .ic { color: var(--faint); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cat { cursor: pointer; position: relative; }
.cat input { position: absolute; opacity: 0; }
.cat span { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 500; height: 100%; transition: all .15s; }
.cat span .ic { color: var(--navy-500); width: 22px; height: 22px; }
.cat input:checked + span { border-color: var(--navy-900); background: var(--navy-50); box-shadow: 0 0 0 1px var(--navy-900); }
.cat input:focus-visible + span { outline: 3px solid var(--navy-300); }
.repair-form .form-grid { margin-top: 16px; }
.damp-note { margin-top: 12px; }
.tracker { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.tracker li { text-align: center; position: relative; font-size: 12px; color: var(--faint); }
.tracker li::before { content: ''; position: absolute; top: 15px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.tracker li:first-child::before { display: none; }
.tracker li.done::before, .tracker li.current::before { background: var(--navy-900); }
.tracker li span { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 500; margin-bottom: 6px; }
.tracker li span .ic { width: 16px; height: 16px; }
.tracker li.done span { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.tracker li.current span { border-color: var(--navy-900); color: var(--navy-900); box-shadow: 0 0 0 4px var(--navy-100); }
.tracker li.done, .tracker li.current { color: var(--navy-900); }
.tracker b { display: block; font-weight: 500; }
.rate { text-align: center; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 6px 0 12px; }
.stars button { font-size: 34px; background: none; border: 0; color: var(--line); cursor: pointer; line-height: 1; padding: 0 2px; }
.stars button.on { color: #e2a400; }
.rate textarea { max-width: 420px; margin: 0 auto 12px; display: block; }
.bank { display: grid; gap: 8px; margin: 10px 0 14px; }
.bank > div { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--navy-50); border-radius: 10px; }
.bank span { font-size: 12px; color: var(--muted); width: 120px; } .bank b { flex: 1; font-weight: 500; font-size: 16px; letter-spacing: .03em; }
.statement li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.statement b { font-weight: 500; display: block; font-size: 14px; } .statement small { color: var(--muted); font-size: 12px; display: block; }
.statement .amt { text-align: right; font-weight: 500; }
.statement li.payment b { color: var(--ok); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.cert-card { margin: 0; border-top: 4px solid var(--ok); }
.cert-card.expiring { border-top-color: var(--warn); } .cert-card.expired { border-top-color: var(--bad); }
.cc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cc-head b { font-weight: 500; display: block; } .cc-head small { color: var(--muted); font-size: 12px; }
.cc-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--navy-50); color: var(--navy-700); display: flex; align-items: center; justify-content: center; flex: none; }
.cc-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cc-foot .badge { margin-right: auto; }
.guide-grid .guide-item, .guide-item { display: flex; gap: 12px; align-items: flex-start; }
.gi-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--navy-50); color: var(--navy-700); display: flex; align-items: center; justify-content: center; flex: none; }
.guide-item small { display: block; color: var(--muted); font-size: 12px; } .guide-item b { font-weight: 500; }

/* ---------- public website ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.pub { background: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.pub > main { flex: 1; }
.pub-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.pub-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 16px; }
.pub-logo img { height: 48px; display: block; }
.pub-nav { display: flex; align-items: center; gap: 22px; }
.pub-nav > a:not(.btn) { color: var(--navy-900); font-weight: 500; font-size: 15px; }
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% 20%, #14306b, var(--navy-900) 60%); color: #fff; }
.hero-slash { position: absolute; width: 160%; height: 120px; background: linear-gradient(90deg, rgba(255,255,255,.02), rgba(255,255,255,.07), rgba(255,255,255,.02)); transform: rotate(-38deg); top: 48%; left: -30%; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; padding-top: 90px; padding-bottom: 100px; }
.hero h1 { color: #fff; font-size: clamp(32px, 4.6vw, 52px); font-weight: 500; line-height: 1.1; margin-bottom: 18px; letter-spacing: -.02em; }
.hero p { color: rgba(255,255,255,.8); font-size: 18px; max-width: 560px; margin-bottom: 30px; }
.hero .eyebrow { color: var(--navy-300); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-mark { display: flex; justify-content: center; }
.hero-mark img { width: min(340px, 100%); opacity: .95; filter: drop-shadow(0 20px 40px rgba(0,0,0,.25)); }
.section { padding: 80px 0; }
.section.alt { background: var(--navy-50); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: 32px; } .section-head p { color: var(--muted); font-size: 17px; }
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.listing-card { border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .2s, box-shadow .2s; }
.listing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.lc-img { aspect-ratio: 4/3; position: relative; background: var(--navy-50); }
.lc-img > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-tag { position: absolute; left: 12px; top: 12px; background: #fff; color: var(--navy-900); font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 999px; }
.lc-body { padding: 18px 20px 20px; }
.lc-body h3 { margin: 4px 0 2px; font-size: 17px; }
.lc-price { font-size: 22px; font-weight: 500; color: var(--navy-900); }
.lc-price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.lc-price.big { font-size: 30px; }
.lc-meta { display: flex; gap: 14px; color: var(--muted); font-size: 14px; margin-top: 10px; }
.lc-meta span { display: inline-flex; gap: 5px; align-items: center; }
.empty-soft { display: flex; gap: 16px; align-items: center; padding: 24px; max-width: 760px; margin: 0 auto; flex-wrap: wrap; }
.empty-soft > .ic { width: 36px; height: 36px; color: var(--navy-500); }
.empty-soft > div { flex: 1; min-width: 220px; } .empty-soft p { margin: 0; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px; }
.feature { background: #fff; border-radius: 16px; padding: 24px; border: 1px solid var(--line); }
.f-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--navy-900); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature h3 { font-size: 17px; } .feature p { color: var(--muted); margin: 0; font-size: 15px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-grid h2 { font-size: 32px; }
.contact-list { display: grid; gap: 12px; margin: 22px 0; }
.contact-list a, .contact-list span { display: flex; gap: 10px; align-items: center; font-size: 17px; color: var(--navy-900); }
.contact-list .ic { color: var(--navy-500); }
.success-box { text-align: center; padding: 26px 10px; }
.success-box > .ic { width: 44px; height: 44px; color: var(--ok); margin-bottom: 8px; }
.listing-page { padding-top: 24px; padding-bottom: 60px; }
.listing-gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 200px 200px; gap: 8px; border-radius: 18px; overflow: hidden; margin: 12px 0 28px; }
.listing-gallery button { padding: 0; border: 0; cursor: zoom-in; background: var(--navy-50); }
.listing-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-gallery .lg-main { grid-row: span 2; }
.listing-gallery.n1 { grid-template-columns: 1fr; grid-template-rows: 440px; }
.listing-gallery.n2 { grid-template-columns: 2fr 1fr; grid-template-rows: 220px 220px; }
.listing-gallery.n2 .lg-sub { grid-row: span 2; }
.listing-gallery.n1 .lg-main { grid-row: auto; }
.listing-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: start; }
.listing-body h1 { margin-top: 6px; }
.spec-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.spec-row span { display: inline-flex; gap: 6px; align-items: center; background: var(--navy-50); padding: 7px 12px; border-radius: 10px; font-size: 14px; }
.features { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.features li { display: flex; gap: 8px; align-items: center; }
.features .ic { color: var(--ok); }
.prose p { font-size: 16px; line-height: 1.65; }
.sticky { position: sticky; top: 96px; }
.pub-footer { background: var(--navy-950); color: rgba(255,255,255,.75); padding: 50px 0 26px; }
.pf-brand img { height: 52px; } .pf-brand p { margin-top: 10px; }
.pub-footer .wrap { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; }
.pf-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pf-cols h4 { color: #fff; margin: 0 0 10px; font-size: 14px; }
.pf-cols a, .pf-cols span { display: flex; gap: 8px; align-items: center; color: rgba(255,255,255,.75); font-size: 14px; margin-bottom: 8px; }
.pf-cols span { display: block; }
.pf-cols span a { display: inline; color: #fff; }
.pf-legal { grid-column: 1/-1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; font-size: 13px; color: rgba(255,255,255,.5); }

/* auth */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: #fff; }
.auth-side { position: relative; overflow: hidden; background: radial-gradient(900px 500px at 20% 10%, #14306b, var(--navy-900) 65%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side img { height: 56px; position: relative; }
.auth-slash { position: absolute; width: 170%; height: 110px; background: rgba(255,255,255,.05); transform: rotate(-38deg); top: 46%; left: -35%; }
.auth-copy { position: relative; }
.auth-copy h2 { color: #fff; font-size: 34px; max-width: 440px; line-height: 1.15; }
.auth-copy ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.auth-copy li { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.85); }
.auth-copy li .ic { color: var(--navy-300); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 28px; }
.auth-card form { margin-top: 22px; display: grid; gap: 4px; }
.auth-card .form-grid { gap: 14px; }
.auth-mobile-logo { display: none; height: 44px; margin-bottom: 26px; }
.auth-links { margin-top: 18px; font-size: 14px; text-align: center; }
.auth-foot { margin-top: 26px; font-size: 13px; color: var(--muted); text-align: center; border-top: 1px solid var(--line-2); padding-top: 18px; }
.bare { min-height: 100vh; background: var(--bg); }
.bare-head { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; text-align: center; }
.bare-head img { height: 40px; }
.bare-main { padding: 20px 16px 40px; }
.job { max-width: 760px; margin: 0 auto; }
.job-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats.four { grid-template-columns: repeat(2, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .app.sb-open .sidebar { transform: none; }
  .app.sb-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(3,15,51,.45); z-index: 35; }
  .burger, .tb-logo { display: inline-flex; }
  .topbar { padding: 0 12px; background: #fff; border-bottom-color: var(--line); }
  .content { padding: 4px 16px 40px; }
  .grid-2, .stats.three { grid-template-columns: 1fr; }
  .stats.six { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none !important; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 64px; }
  .hero-mark { display: none; }
  .feature-grid, .contact-grid, .listing-body { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-logo { display: block; }
  .msg-layout { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .msg-layout.has-thread .msg-threads { display: none; }
  .msg-layout:not(.has-thread) .msg-pane { display: none; }
  .back-mobile { display: inline-flex; }
  .pub-footer .wrap, .pf-cols { grid-template-columns: 1fr; }
  .listing-gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 120px; }
  .listing-gallery .lg-main { grid-column: span 2; grid-row: auto; }
  .listing-gallery .lg-sub:nth-child(n+4) { display: none; }
  .sticky { position: static; }
  .pub-nav > a:not(.btn) { display: none; }
  /* tenant bottom tab bar */
  .app.tenant { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; color: var(--muted); position: relative; text-decoration: none !important; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--navy-900); }
  .tabbar a.active .ic { color: var(--navy-900); }
  .tb-badge { position: absolute; top: 4px; left: 54%; background: var(--bad); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; }
  .msg-single { height: calc(100vh - 250px); }
  .app.tenant ~ #toasts, body:has(.app.tenant) #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .listing-gallery.n1, .listing-gallery.n2 { grid-template-columns: 1fr; grid-template-rows: 260px; }
  .listing-gallery.n2 .lg-sub { display: none; }
}
@media (max-width: 640px) {
  h1, .page-head h1 { font-size: 22px; }
  .page-head { align-items: flex-start; margin-bottom: 16px; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1; }
  .stats, .stats.four { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; gap: 10px; flex-direction: column; }
  .stat-ic { width: 34px; height: 34px; }
  .stat-value { font-size: 18px; }
  .kv, .kv.three { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.half, .field.third { grid-column: 1 / -1; }
  .quick { grid-template-columns: 1fr 1fr; }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-width: 100% !important; margin: 0; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-body { overflow-y: auto; }
  .tracker b { font-size: 10px; }
  .checklist .cl-row { grid-template-columns: 1fr 120px; }
  .checklist .cl-row .na { grid-column: 2; }
  .room-row { grid-template-columns: 1fr 100px 36px; }
  .room-row input[name=notes] { grid-column: 1 / 3; }
  .msg { max-width: 88%; }
  .section { padding: 56px 0; }
  .features { grid-template-columns: 1fr; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .pub-header .wrap { height: 64px; }
  .pub-logo img { height: 40px; }
  .t-hero h1 { font-size: 24px; }
  .bank span { width: 96px; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .tabbar, .ph-actions, .tabs, .btn, .icon-btn, .composer, .back, .uploader, #toasts, .pub-header, .pub-footer, .note.emergency { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .tab-pane[hidden] { display: none !important; }
  .print-only { display: block; }
  .print-statement { position: absolute; top: 0; right: 0; text-align: right; }
  .print-statement img { height: 40px; }
}
