@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   FieldCam — Shared Styles  (mobile-first)
   ============================================================ */

/* ── Page transition loader ────────────────────────────────────
   Covers the page content (NOT the chrome — sidebar/topbar stay
   visible) until JS-rendered chrome AND in-flight content fetches
   resolve. Activated by html.page-loading (set inline in each page's
   <head>); app.js removes the class once parts signal ready.
   Re-shown on internal link clicks for outgoing transitions.

   Only <main> (the page body) is hidden during loading — the
   sidebar/topbar stay in place so the navigation never feels blank.
   A semi-transparent backdrop with the PropSpot logo gently pulses
   in the center. */
/* Premium look: solid background that matches the page exactly (no
   jarring overlay or blur), a generously-sized PropSpot logo with a
   soft brand-green halo ring that gently pulses behind it, and a
   subtle wordmark beneath. */
html.page-loading main {
  opacity: 0 !important;
}
main {
  opacity: 1;
  transition: opacity 0.18s ease-in;
}
.os-page-loader {
  position: fixed; inset: 0;
  background: #ffffff;   /* logo PNG is now transparent — any bg works */
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0s 0.18s, visibility 0s 0.18s linear;
}
html.page-loading .os-page-loader,
.os-page-loader.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity 0.1s ease-out;
}

/* Centered stack: artwork + wordmark + loading bar. Small gap between
   artwork and wordmark; larger margin on the bar so it doesn't crowd
   the wordmark. */
.os-page-loader-stack {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
}
.os-page-loader-stack .os-page-loader-bar { margin-top: 24px; }

/* Horizontal lockup matching the topbar: dog+house icon + wordmark text. */
.os-page-loader-brand {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.os-page-loader-logo {
  width: 102px; height: 64px;   /* dog+house icon only, aspect ≈ 1.6:1 */
  background-image: url('/logo-icon.png?v=8');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* "propspot" wordmark, system-sans (no asset cropping risk). Only "spot"
   gets the brand accent — "prop" uses the base color, like the topbar. */
.os-page-loader-wordmark {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -.04em;
  color: #1a1f2e;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.os-page-loader-wordmark .ws-accent { color: #61B746; }

/* Loading bar — only animated element */
.os-page-loader-bar {
  width: 200px; height: 3px;
  border-radius: 2px;
  background: rgba(97,183,70,0.12);
  overflow: hidden;
  position: relative;
}
.os-page-loader-bar-fill {
  position: absolute;
  top: 0; bottom: 0;
  width: 45%;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(97,183,70,0)   0%,
    rgba(97,183,70,0.5) 30%,
    #61B746             50%,
    rgba(97,183,70,0.5) 70%,
    rgba(97,183,70,0)   100%);
  animation: os-loader-bar-slide 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes os-loader-bar-slide {
  0%   { left: -50%; }
  100% { left: 105%; }
}

/* Dark-mode overrides — must live here (not dark.css) to avoid flash */
html.theme-dark .os-page-loader      { background: #16171a; }
html.theme-dark .os-page-loader-logo {
  /* Outlined icon (halo baked in). Slightly larger box than the light icon to
     offset the transparent halo padding so the art renders at the same size. */
  width: 107px; height: 69px;
  background-image: url('/logo-icon-dark.png?v=10');
}
html.theme-dark .os-page-loader-wordmark { color: #d4d4d4; }
html.theme-dark .os-page-loader-wordmark .ws-accent { color: #5ab040; }
html.theme-dark .os-page-loader-bar { background: rgba(255,255,255,0.07); }
html.theme-dark .os-page-loader-bar-fill {
  background: linear-gradient(90deg,
    rgba(90,176,64,0)   0%,
    rgba(90,176,64,0.5) 30%,
    #5ab040             50%,
    rgba(90,176,64,0.5) 70%,
    rgba(90,176,64,0)   100%);
}

/* Brand wordmark swap: the light logo's black "propspot"/".io" text blends into
   dark surfaces, so in dark mode swap to the white-outlined sticker variant
   (same treatment as the loader mark above). content: on an <img> replaces the
   rendered source in WebKit/Blink, which is what this app targets. */
html.theme-dark .apps-rail-brand img,
html.theme-dark .login-logo-img { content: url('/logo-dark.png?v=10'); }

@media (prefers-reduced-motion: reduce) {
  .os-page-loader-bar-fill { animation: none; width: 100%; opacity: 0.5; }
  main { transition: none; }
}

:root {
  --brand:        #61B746;   /* company green */
  --brand-dark:   #4f9e38;
  --brand-light:  #edf7e9;
  --brand-deep:   #22402c;   /* v2: deep green for signature/dark cards */
  --surface:      #ffffff;
  --surface-tint: #f6faf4;   /* v2: subtle tinted inner fills, tracks */
  --bg:           #eef3ef;   /* solid fallback; body uses the gradient below */
  --text:         #16241c;   /* v2: green-tinted near-black */
  --text-muted:   #5e6f64;   /* v2: muted green-gray */
  --text-faint:   #9aa79f;   /* v2: tertiary / hints */
  --border:       #e5e7eb;   /* inputs/tables keep a visible edge */
  --hairline:     rgba(28,54,38,.07);  /* v2: barely-there card separators */
  --danger:       #e5564b;
  --success:      #54b864;
  --warn:         #e8a33d;
  /* geometric radius scale — hairline 2px, no pills */
  --radius:       2px;
  --radius-card:  2px;
  --radius-sm:    2px;
  --radius-pill:  2px;
  /* v2 soft, green-tinted elevation */
  --shadow:       0 1px 2px rgba(16,24,40,.04), 0 16px 40px -22px rgba(40,72,48,.30);
  --shadow-soft:  0 10px 30px -18px rgba(40,72,48,.28);
  --shadow-hover: 0 2px 6px rgba(16,24,40,.06), 0 26px 56px -22px rgba(40,72,48,.40);
  --nav-height:   64px;
  --header-height:56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f2f3f5;
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: var(--nav-height);
  -webkit-font-smoothing: antialiased;
}
/* Dark theme keeps a deep, tinted version of the same gradient */
html.theme-dark body {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(34,85,48,.45), transparent 60%),
    radial-gradient(820px 600px at 110% 6%, rgba(63,35,100,.40), transparent 55%),
    linear-gradient(168deg, #11201a 0%, #0f1a16 40%, #0d1714 100%);
  background-attachment: fixed;
}

/* ── Top Header ──────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.app-header .logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-header .logo-img {
  height: 36px;
  width: 36px;
  object-fit: contain;
}

.app-header .header-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header .back-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px 4px 0;
  line-height: 1;
}

.app-header .header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: 2px;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.3); }

/* ── Bottom Nav ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.07);
}

.nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .65rem;
  font-weight: 500;
  transition: color .15s;
}

.nav-link .nav-icon { font-size: 1.4rem; line-height: 1; }
.nav-link.active { color: var(--brand); }
.nav-link:hover  { color: var(--brand); }

/* These elements live in the sidebar on desktop, hidden on mobile */
.nav-brand        { display: none; }
.nav-spacer       { display: none; }
.nav-signout      { display: none; }
.nav-collapse-btn { display: none; }

/* ── Desktop Sidebar (≥900px) ────────────────────────────── */
@media (min-width: 900px) {
  :root {
    --sidebar-width: 220px;
    --nav-height: 0px;
  }

  body {
    padding-bottom: 0;
    padding-left: var(--sidebar-width);
    transition: padding-left .22s ease;
  }

  .bottom-nav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    right: auto;
    width: var(--sidebar-width);
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    border-top: none;
    border-right: 1px solid var(--border);
    box-shadow: none;
    padding: 0;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--surface);
    transition: width .22s ease;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--brand);
    letter-spacing: -.5px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
  }
  .nav-brand .nav-label { transition: opacity .15s ease; }

  .nav-spacer { display: block; flex: 1; }

  .nav-signout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin: 0 8px 8px;
    width: calc(100% - 16px);
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    text-align: left;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
  }
  .nav-signout:hover { background: #fee2e2; color: var(--danger); }

  .nav-link {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    font-size: .88rem;
    font-weight: 500;
    border-radius: 2px;
    margin: 0 8px;
    width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
  }
  .nav-link .nav-icon { font-size: 1.15rem; flex-shrink: 0; }
  .nav-link.active, .nav-link:hover {
    background: var(--brand-light);
    color: var(--brand);
  }

  .nav-collapse-btn {
    position: fixed;
    top: 22px;
    left: calc(var(--sidebar-width) - 12px);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-size: .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    transition: left .22s ease, background .15s, color .15s, border-color .15s;
    line-height: 1;
  }
  .nav-collapse-btn:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
  }

  html.sidebar-collapsed { --sidebar-width: 64px; }
  /* Hide every label-bearing span (and any bare text inside nav rows)
     when the sidebar is collapsed. Icons remain visible. */
  html.sidebar-collapsed .nav-label,
  html.sidebar-collapsed .nav-brand .nav-label,
  html.sidebar-collapsed .nav-link  .nav-label,
  html.sidebar-collapsed .nav-signout .nav-label { display: none; }
  html.sidebar-collapsed .nav-link,
  html.sidebar-collapsed .nav-signout            { font-size: 0; }
  html.sidebar-collapsed .nav-brand          { justify-content: center; padding: 20px 0 16px; gap: 0; }
  html.sidebar-collapsed .nav-link           { justify-content: center; padding: 12px 0; width: calc(100% - 8px); margin: 0 4px; gap: 0; }
  html.sidebar-collapsed .nav-link .nav-icon { font-size: 1.3rem; }
  html.sidebar-collapsed .nav-signout        { justify-content: center; padding: 12px 0; width: calc(100% - 8px); margin: 0 4px 8px; gap: 0; }
  html.sidebar-collapsed .nav-signout .nav-icon { font-size: 1.15rem; }

  /* Hide logo from top header — it's in the sidebar now */
  .app-header .logo { display: none; }
  .header-signout   { display: none; }

  .page { max-width: 1100px; }
}

/* ============================================================
   New OS layout: top header + slim left apps rail
   Opt-in via <body class="os-newlayout">
   ============================================================ */
body.os-newlayout {
  padding-top: var(--top-header-height, 56px);
  padding-left: var(--apps-rail-width, 64px);
  padding-bottom: 0;
  background: var(--bg);
  /* Hard stop against horizontal overflow on phones. chrome.css adds this
     too, but it loads asynchronously — declaring it here (in the synchronous
     <head> stylesheet) prevents a wide child from widening the mobile layout
     viewport on first paint, which otherwise breaks every max-width media
     query for the rest of the session. */
  overflow-x: hidden;
}
body.os-newlayout .app-header   { display: none; }   /* hide old mobile header */
body.os-newlayout .bottom-nav   { display: none; }   /* hide old left sidebar */
body.os-newlayout .nav-collapse-btn { display: none; }
/* Fluid by default: fills the viewport so wide monitors don't waste
   the right-hand third on dead space. Padding scales slightly with
   width via clamp(). A page can opt INTO a constrained reading
   width by adding the .page-narrow class on its main element. */
body.os-newlayout .page         { max-width: var(--page-max-width, none); padding: clamp(20px, 2vw, 32px); }
body.os-newlayout .page.page-narrow { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* ── Top header ────────────────────────────────────────────── */
.top-header {
  position: fixed; top: 0;
  left: var(--apps-rail-width, 64px); right: 0;
  height: var(--top-header-height, 56px);
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  gap: 12px; padding: 0 16px 0 20px;
}
.top-nav-links { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; }
.top-nav-link {
  padding: 8px 14px; border-radius: 2px;
  text-decoration: none; color: var(--text-muted);
  font-weight: 600; font-size: .92rem;
  white-space: nowrap;
  transition: color .12s, background .12s;
}
.top-nav-link:hover  { background: var(--brand-light); color: var(--brand-dark); }
.top-nav-link.active { color: var(--brand-dark); background: var(--brand-light); }

.top-nav-search {
  position: relative;
  flex: 1; max-width: 380px;
  display: flex; align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px; padding: 6px 10px;
  margin-left: auto;
}
.top-nav-search input {
  flex: 1; border: none; background: transparent;
  outline: none; font-size: .88rem; color: var(--text);
  min-width: 0;
}
.top-nav-search .search-icon { color: var(--text-muted); margin-right: 6px; flex-shrink: 0; }

/* Live search dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  max-height: 460px; overflow-y: auto;
  z-index: 250;
  display: none;
  padding: 4px 0;
}
.search-results.open { display: block; }
.search-section { padding: 4px 0; }
.search-section + .search-section { border-top: 1px solid var(--border); }
.search-section-header {
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
  padding: 8px 14px 4px;
}
.search-result {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  cursor: pointer; text-decoration: none; color: var(--text);
  font-size: .88rem;
}
.search-result:hover { background: var(--brand-light); }
.search-result-icon { font-size: 1.1rem; flex-shrink: 0; width: 22px; text-align: center; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-subtitle {
  font-size: .72rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-empty { padding: 14px; font-size: .82rem; color: var(--text-muted); text-align: center; }
.search-loading { padding: 14px; font-size: .82rem; color: var(--text-muted); text-align: center; }

.top-nav-icons { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }
.top-nav-icon-btn {
  background: none; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; text-decoration: none;
  color: var(--text-muted);
  position: relative;
}
.top-nav-icon-btn:hover { background: var(--brand-light); color: var(--brand-dark); }
.top-nav-icon-btn.active { background: var(--brand-light); color: var(--brand-dark); }

.top-nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem;
  cursor: pointer; border: none;
  overflow: hidden;
  padding: 0;
}

/* Profile picture rendered inside an avatar circle. The three size
   variants (default / --big / --xl) match the contexts where avatars
   render: topbar circle, user-menu header, edit-profile modal. */
.avatar-img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-avatar-big {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0; overflow: hidden;
}

/* ── User dropdown menu ──────────────────────────────────── */
.user-menu {
  position: fixed; top: calc(var(--top-header-height, 56px) + 4px);
  right: 12px; min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px; padding: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  z-index: 200;
  display: none;
}
.user-menu.open { display: block; }
.user-menu .user-info {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.user-menu .user-name  { font-weight: 700; font-size: .88rem; }
.user-menu .user-email { font-size: .72rem; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.user-menu a, .user-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px; border-radius: 2px;
  font-size: .88rem; text-align: left;
  background: none; border: none; cursor: pointer;
  text-decoration: none; color: var(--text);
}
.user-menu a:hover, .user-menu button:hover { background: var(--brand-light); color: var(--brand-dark); }
.user-menu .menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu button.danger:hover { background: #fee2e2; color: var(--danger); }

/* Quick-access rows at the top of the avatar dropdown
   (Create new / Notifications) — two-line cards with sub-label */
.user-menu .um-quick {
  align-items: center;
  padding: 9px 12px;
  border-radius: 2px;
  font-weight: 600;
  position: relative;
}
.user-menu .um-quick .user-menu-icon {
  width: 28px; height: 28px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(97,183,70,0.10);
  color: var(--brand-dark, #15803d);
  font-size: 14px;
  flex-shrink: 0;
}
.user-menu .um-quick:hover .user-menu-icon { background: var(--brand); color: #fff; }
.user-menu .um-quick .um-row-sub {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1px;
  letter-spacing: 0.01em;
  text-transform: none;
}
.user-menu .um-quick:hover .um-row-sub { color: var(--brand-dark, #15803d); opacity: 0.85; }
.user-menu .um-notif-count {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.14);
}

/* ── Slim left apps rail ─────────────────────────────────── */
.apps-rail {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--apps-rail-width, 64px);
  z-index: 100;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 14px; gap: 6px;
}
.apps-rail-brand {
  width: 44px; height: 44px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
  text-decoration: none; margin-bottom: 6px;
  font-size: 1.2rem; font-weight: 800;
  border: none; cursor: pointer;
  overflow: hidden;
}
.apps-rail-brand img { width: 28px; height: 28px; object-fit: contain; }
.apps-rail-link {
  width: 44px; height: 44px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text);
  text-decoration: none; font-size: 1.5rem;
  transition: background .12s, transform .1s;
  position: relative;
}
.apps-rail-link:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
}
.apps-rail-link.active { background: var(--brand-light); }
.apps-rail-link::after {
  content: attr(data-label);
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  background: var(--text); color: #fff;
  padding: 4px 10px; border-radius: 2px;
  font-size: .74rem; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .12s;
  z-index: 250;
}
.apps-rail-link:hover::after { opacity: 1; }
.apps-rail-spacer { flex: 1; }

/* Sign-out button in the rail — strip default <button> chrome so it
   inherits .apps-rail-link styling. */
.apps-rail-signout { border: none; cursor: pointer; padding: 0; font-family: inherit; }
.apps-rail-signout:hover { background: #fee2e2; color: var(--danger); }

/* Mobile (< 720px): top nav becomes sticky and apps rail moves to bottom */
@media (max-width: 720px) {
  body.os-newlayout {
    padding-top: var(--top-header-height, 56px);
    padding-left: 0;
    padding-bottom: var(--apps-rail-width, 64px);
  }
  .top-header   { left: 0; padding: 0 12px; gap: 8px; }
  .top-nav-links .top-nav-link { padding: 6px 10px; font-size: .82rem; }
  .top-nav-search { max-width: 180px; }
  body.os-newlayout:not(.os-newchrome) .apps-rail {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: var(--apps-rail-width, 64px);
    flex-direction: row; justify-content: space-around;
    border-right: none; border-top: 1px solid var(--border);
    padding: 6px 0;
  }
  body.os-newlayout:not(.os-newchrome) .apps-rail-brand,
  body.os-newlayout:not(.os-newchrome) .apps-rail-link { width: 44px; height: 44px; }
  body.os-newlayout:not(.os-newchrome) .apps-rail-link::after { display: none; }
  .user-menu { right: 8px; }
}

:root {
  --top-header-height: 56px;
  --apps-rail-width: 64px;
}

/* ── DataTable (sortable, resizable, reorderable) ──────────── */
.dt-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.dt-table { width: 100%; border-collapse: collapse; font-size: .88rem; table-layout: fixed; }
.dt-table thead th {
  position: relative;
  text-align: left; font-weight: 700; font-size: .72rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 12px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  user-select: none;
  white-space: nowrap;
}
.dt-table th.dt-sortable .dt-th-label { cursor: pointer; }
.dt-table th.dt-sortable .dt-th-label:hover { color: var(--brand-dark); }
.dt-table th.dt-dragging { opacity: .4; }
.dt-table th.dt-drop-target { background: var(--brand-light); color: var(--brand-dark); }
.dt-table .dt-resize {
  position: absolute; top: 0; right: -3px; width: 6px; height: 100%;
  cursor: col-resize; z-index: 5;
}
.dt-table .dt-resize:hover, .dt-table .dt-resize:active {
  background: var(--brand);
}
.dt-table tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; cursor: pointer; }
.dt-table tbody tr:last-child { border-bottom: none; }
.dt-table tbody tr:hover { background: var(--brand-light); }
.dt-table td {
  padding: 12px 14px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-table .dt-empty {
  text-align: center; color: var(--text-muted); font-style: italic;
  padding: 36px 14px;
}
.dt-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dt-reset-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .78rem; padding: 4px 8px; border-radius: 2px;
}
.dt-reset-btn:hover { background: var(--bg); color: var(--text); }

/* ── Phone: turn wide data tables into stacked cards ─────────────
   Every datatable (properties, database, contacts…) becomes readable
   cards instead of a table you have to scroll sideways. The first
   column is the card title; the rest show as label/value rows. */
@media (max-width: 768px) {
  .dt-wrap { overflow-x: visible; background: transparent; box-shadow: none; border-radius: 0; }
  .dt-table { display: block; table-layout: auto; font-size: .9rem; }
  .dt-table thead { display: none; }
  .dt-table tbody { display: block; }
  .dt-table tbody tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin-bottom: 12px;
  }
  .dt-table tbody tr:hover { background: var(--surface); }
  .dt-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 7px 0; border-bottom: 1px solid var(--border);
    white-space: normal; overflow: visible; text-overflow: clip; text-align: right;
  }
  .dt-table td:last-child { border-bottom: none; }
  .dt-table td::before {
    content: attr(data-label);
    font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); text-align: left; flex: 0 0 auto; margin-right: auto;
  }
  /* First column = card title (full width, no label) */
  .dt-table td:first-child {
    display: block; text-align: left; padding: 0 0 8px; margin-bottom: 4px;
    font-weight: 700; font-size: 1rem;
  }
  .dt-table td:first-child::before { content: none; }
  .dt-table .dt-empty { display: block; text-align: center; }
  .dt-table .dt-empty::before { content: none; }
}

/* ── Page / Content ──────────────────────────────────────── */
.page { padding: 16px; max-width: 600px; margin: 0 auto; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body { padding: 16px; }

/* ── Property Card ───────────────────────────────────────── */
.property-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block;
  margin-bottom: 12px;
  transition: transform .15s, box-shadow .15s;
}
.property-card:active { transform: scale(.98); }

.property-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg);
  display: block;
}

.property-thumb-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #ccc;
}

.property-info { padding: 12px 16px 16px; }
.property-name { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.property-address { font-size: .82rem; color: var(--text-muted); }
.property-meta { display: flex; gap: 12px; margin-top: 8px; font-size: .78rem; color: var(--text-muted); }
.property-meta span { display: flex; align-items: center; gap: 4px; }

/* ── Photo Grid ──────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
}

.photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.photo-thumb-wrap:hover img { transform: scale(1.05); }

.photo-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px;
  font-size: .65rem;
  opacity: 0;
  transition: opacity .2s;
}
.photo-thumb-wrap:hover .photo-thumb-overlay { opacity: 1; }

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 100vw;
  max-height: 80dvh;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-meta {
  color: #fff;
  margin-top: 12px;
  font-size: .85rem;
  text-align: center;
  padding: 0 24px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-delete {
  margin-top: 16px;
  background: var(--danger);
  border: none;
  color: #fff;
  padding: 8px 20px;
  border-radius: 2px;
  cursor: pointer;
  font-size: .9rem;
}

/* ── Shared attachment viewer (PSViewer) ─────────────────── */
.psv { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; padding: 24px; }
.psv.open { display: flex; }
.psv-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); }
.psv-panel { position: relative; z-index: 1; display: flex; flex-direction: column;
  width: 100%; max-width: 1000px; max-height: 92vh;
  background: var(--surface, #fff); border-radius: 2px; overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,.35); }
.psv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border, #e5e7eb); flex-shrink: 0; }
.psv-name { font-size: .9rem; font-weight: 600; color: var(--text, #111);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psv-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.psv-dl { font-size: .8rem; color: var(--brand, #2563eb); text-decoration: none; font-weight: 600; }
.psv-close { background: none; border: none; font-size: 1.6rem; line-height: 1;
  color: var(--text-muted, #6b7280); cursor: pointer; padding: 0 4px; }
.psv-content { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: #0b0b0b; overflow: auto; }
.psv-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.psv-frame { width: 100%; height: 80vh; border: 0; background: #fff; }
.psv-media { max-width: 100%; }
.psv-fallback { color: #fff; text-align: center; padding: 48px 24px; }
.psv-fallback-icon { font-size: 2.5rem; }
.psv-fallback .btn { display: inline-block; margin-top: 12px; background: var(--brand, #2563eb);
  color: #fff; padding: 8px 18px; border-radius: 2px; text-decoration: none; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(97,183,70,.12);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s, filter .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px rgba(79,158,56,.7); }
.btn-primary:hover { background: var(--brand-dark); filter: brightness(1.02); }

.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--hairline); box-shadow: var(--shadow-soft); }
.btn-secondary:hover { background: var(--surface-tint); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }

/* ── FAB (Floating Action Button) ────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(97,183,70,.5);
  cursor: pointer;
  text-decoration: none;
  z-index: 90;
  transition: transform .15s, box-shadow .15s;
}
.fab:hover { transform: scale(1.07); box-shadow: 0 6px 20px rgba(97,183,70,.6); }

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red   { background: #fee2e2; color: #b91c1c; }

/* Property status badge (colors set inline per-status) */
.status-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 2px;
  white-space: nowrap;
}

/* ── Nearby Banner ───────────────────────────────────────── */
.nearby-banner {
  background: linear-gradient(135deg, var(--brand), #86d468);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.nearby-banner .nearby-icon { font-size: 2rem; }
.nearby-banner .nearby-text strong { font-size: 1rem; display: block; }
.nearby-banner .nearby-text span  { font-size: .8rem; opacity: .9; }

/* ── Section Header ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 1rem; font-weight: 700; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 20px; }

/* ── Avatar / Team ───────────────────────────────────────── */
.team-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.team-row:last-child { border-bottom: none; }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.team-info { flex: 1; }
.team-name  { font-weight: 600; font-size: .95rem; }
.team-email { font-size: .8rem; color: var(--text-muted); }

/* ── Camera Page ─────────────────────────────────────────── */
.camera-preview {
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.camera-preview video,
.camera-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.camera-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
}

.shutter-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--brand);
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--brand);
  cursor: pointer;
  transition: transform .1s;
}
.shutter-btn:active { transform: scale(.93); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 2px;
  font-size: .9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error   { background: var(--danger); }

/* App-styled confirm/alert dialog (appConfirm / appAlert) — replaces native popups. */
.app-dialog-back {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.app-dialog {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  width: min(440px, 94vw); padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.app-dialog-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 8px; color: var(--text, #111827); }
.app-dialog-msg {
  color: var(--text-muted, #5b6577); font-size: .92rem; line-height: 1.55;
  white-space: pre-line; margin: 0 0 20px;
}
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.app-dialog-actions .btn { padding: 8px 18px; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── GPS Pill ────────────────────────────────────────────── */
.gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #15803d;
  border-radius: 2px;
  padding: 4px 12px;
  font-size: .8rem;
  font-weight: 500;
}
.gps-pill.warn { background: #fef3c7; color: #92400e; }
.gps-pill.err  { background: #fee2e2; color: #b91c1c; }

/* ── Login Page ──────────────────────────────────────────── */
.login-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #edf7e9 0%, #ffffff 100%);
  overflow-y: auto;
  text-align: center;
}

.login-logo-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-bottom: 4px;
  display: block;
}

.login-logo {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--brand);
  margin-bottom: 4px;
  letter-spacing: -1px;
}
.login-tagline {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: .95rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
  padding: 28px 24px;
}

.tab-row {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Search Box ──────────────────────────────────────────── */
.search-box {
  position: relative;
  margin-bottom: 16px;
}
.search-box input {
  padding-left: 40px;
}
.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: .8rem;
  margin: 16px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Scrollable Photo Row ────────────────────────────────── */
.photo-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.photo-row::-webkit-scrollbar { display: none; }
.photo-row-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 2px;
  object-fit: cover;
  cursor: pointer;
}

/* ── Kanban board (shared across lifecycle pages) ────────── */
/* Horizontal scroll instead of grid collapse — keeps every lane
   visible side-by-side regardless of viewport width. */
.kanban {
  display: flex;
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.kanban::-webkit-scrollbar { height: 10px; }
.kanban::-webkit-scrollbar-track { background: transparent; }
.kanban::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.kanban::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 0 0 300px;
  scroll-snap-align: start;
}
@media (max-width: 720px) {
  .kanban-col { flex: 0 0 85vw; }   /* phones: one lane at a time, snap to next */
}
.kanban-col.drag-over {
  outline: 2px dashed var(--brand);
  outline-offset: -2px;
  background: var(--brand-light);
}
.kanban-col-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.kanban-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.kanban-title { font-weight: 700; font-size: .92rem; }
.kanban-count {
  font-size: .72rem; padding: 2px 8px; border-radius: 2px;
  background: var(--bg); color: var(--text-muted); font-weight: 600;
  margin-left: auto;
}
.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  /* Consistent lane height across every pipeline view — long lanes (e.g. a
     "Contract Cancelled" column with 100+ deals) scroll inside the lane
     instead of stretching the whole page. */
  max-height: min(68vh, 760px);
  overflow-y: auto;
}
.kanban-col-body::-webkit-scrollbar { width: 8px; }
.kanban-col-body::-webkit-scrollbar-track { background: transparent; }
.kanban-col-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.kanban-col-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.kanban-col-body .empty-lane {
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  padding: 18px 8px;
  border: 1px dashed var(--border);
  border-radius: 2px;
}
.kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow .12s ease, transform .08s ease;
  user-select: none;
}
.kanban-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .45; transform: scale(.98); }
.kanban-addr-link {
  display: block;
  color: var(--text);
  font-weight: 700;
  font-size: .92rem;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.kanban-addr-link:hover { color: var(--brand); text-decoration-color: var(--brand); }
.kanban-meta {
  color: var(--text-muted);
  font-size: .76rem;
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kanban-meta .dot { opacity: .5; }

/* Toast used by kanban moves and other transient feedback. */
.kb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 2px;
  font-size: .85rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 200;
}
.kb-toast.show { opacity: 1; }
.kb-toast.error { background: #b91c1c; }

/* ── View toggle pills (Kanban | Table) ──────────────────── */
.view-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px;
  gap: 2px;
}
.view-toggle button {
  background: transparent;
  border: none;
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 2px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s ease, color .12s ease;
}
.view-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.view-toggle button:not(.active):hover { color: var(--text); }

/* ── Utilities ───────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: .85rem; }
.text-xs    { font-size: .75rem; }
.font-bold  { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ============================================================
   Premium page chrome — hero / KPI / panel / section-head
   Shared by dashboard, property, underwriting, fieldcam,
   holdings-desk, acquisitions, dispositions, etc.
   ============================================================ */

/* Hero banner */
/* Flat page header — no card, no gradient. Title/eyebrow/subtitle sit
   directly on the canvas; the CTA floats to the top-right; KPI tiles
   below read as their own bento row. (Was a gradient hero card.) */
.os-hero {
  position: relative;
  padding: 2px 0 0;
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 20px;
  overflow: visible;
}
.os-hero::after { display: none; }
.os-hero-title {
  font-size: 1.55rem; font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text); margin: 0 0 4px; line-height: 1.15;
}
.os-hero-subtitle {
  font-size: 0.88rem; color: var(--text-muted);
  margin: 0 0 18px;
}
.os-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--brand); margin-bottom: 8px;
}
.os-hero-eyebrow::before {
  content: ''; width: 16px; height: 2px;
  background: var(--brand); border-radius: 2px; flex: 0 0 auto;
}
/* CTA pinned top-right of the header block (short titles → no overlap;
   mobile.css drops this back into flow). */
.os-hero-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  position: absolute; top: 2px; right: 0;
  margin: 0 !important; z-index: 2;
}

/* ── KPI stats — "hero metric + supporting rail" ─────────────────
   The first tile in the row is the page's headline number (large,
   left, spanning full height). Every tile after it collapses into a
   compact label↔value rail on the right, separated by hairlines. No
   individual boxes — the row reads as one cohesive stat unit. This is
   the shared layout across all pages with an .os-kpi-row. */
.os-kpi-row {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  gap: 0;
  position: relative; z-index: 1;
  align-items: stretch;
}
.os-kpi {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  text-decoration: none; color: inherit;
  position: relative; overflow: visible;
  transition: color .15s;
}
/* Hero — first tile, big number, spans the left column full height.
   Anchored by a 3px brand-green accent bar; the number itself is brand
   green for headline pop (semantic warn/danger values keep their color). */
.os-kpi-row > .os-kpi:first-child {
  grid-column: 1;
  grid-row: 1 / -1;
  padding: 2px 28px 2px 16px;
  border-left: 3px solid var(--brand);
}
.os-kpi-row > .os-kpi:first-child .os-kpi-label { font-size: 0.74rem; margin-bottom: 8px; }
.os-kpi-row > .os-kpi:first-child .os-kpi-value { font-size: 2.7rem; }
.os-kpi-row > .os-kpi:first-child .os-kpi-value:not(.warn):not(.danger) { color: var(--brand-dark); }
.os-kpi-row > .os-kpi:first-child .os-kpi-sub   { font-size: 0.76rem; margin-top: 8px; }
/* Rail — each subsequent tile: label left, value right, divider lines */
.os-kpi-row > .os-kpi:not(:first-child) {
  grid-column: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px 11px 24px;
  border-left: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  transition: background .15s, border-color .15s;
}
.os-kpi-row > .os-kpi:not(:first-child):last-child { border-bottom: none; }
.os-kpi-row > .os-kpi:not(:first-child) .os-kpi-label {
  margin: 0; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.os-kpi-row > .os-kpi:not(:first-child) .os-kpi-value {
  font-size: 1.2rem; flex: 0 1 auto; min-width: 0; max-width: 62%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
}
.os-kpi-row > .os-kpi:not(:first-child) .os-kpi-sub   { display: none; }
/* clickable rail rows get a green tint + green accent on hover */
a.os-kpi:hover { color: var(--brand-dark); }
a.os-kpi:hover .os-kpi-value { color: var(--brand-dark); }
.os-kpi-row > a.os-kpi:not(:first-child):hover {
  background: rgba(97,183,70,0.07);
  border-left-color: var(--brand);
}
.os-kpi-label {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted); margin-bottom: 6px;
}
.os-kpi-value {
  font-size: 1.55rem; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.os-kpi-sub {
  font-size: 0.72rem; color: var(--text-muted);
  margin-top: 4px; font-weight: 500;
}
.os-kpi-value.brand   { color: var(--brand-dark, #15803d); }
.os-kpi-value.warn    { color: #d97706; }
.os-kpi-value.danger  { color: #ef4444; }

/* ── KPI pop: sparkline + delta chip ─────────────────────────────
   Sparkline lives in the hero; the chip is a small week-over-week delta. */
.os-kpi-spark {
  display: block; width: 200px; max-width: 100%; height: 38px; margin-top: 10px;
}
.os-kpi-chip {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0;
  background: rgba(97,183,70,0.14); color: var(--brand-dark, #15803d);
  padding: 2px 7px; border-radius: 20px; vertical-align: middle;
  margin-left: 9px; position: relative; top: -4px;
}

/* Section head */
.os-section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px;
}
.os-section-title {
  font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.os-section-line { flex: 1; height: 1px; background: var(--border); }
.os-section-link {
  font-size: 0.78rem; font-weight: 600;
  color: var(--brand-dark, #15803d);
  text-decoration: none;
  padding: 3px 8px; border-radius: 2px;
  transition: background .12s;
}
.os-section-link:hover { background: rgba(97,183,70,0.10); }

/* Panel card (replaces ad-hoc `.card` use where you want the polished header) */
.os-panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}
.os-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
}
.os-panel-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -.01em; color: var(--text); margin: 0; }
.os-panel-link {
  font-size: 0.74rem; font-weight: 600;
  color: var(--brand-dark, #15803d);
  text-decoration: none;
}
.os-panel-link:hover { color: var(--brand); }
.os-panel-body { padding: 14px 18px 18px; }

/* Two-column panel grid */
.os-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-bottom: 18px;
}
@media (max-width: 880px) { .os-2col { grid-template-columns: 1fr; } }

/* Status pill — small chip used inline */
.os-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 2px;
  background: rgba(97,183,70,0.14); color: var(--brand-dark, #15803d);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.os-status-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
}

/* ── Timesheets ─────────────────────────────────────────────────────── */
.ts-clock-card { display: flex; flex-direction: column; align-items: center;
                 gap: 1rem; padding: 2rem; background: var(--surface);
                 border-radius: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.ts-tag-row    { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.ts-tag        { padding: 0.5rem 0.75rem; border-radius: 0.5rem;
                 border: 1px solid var(--border); background: var(--bg); }
.ts-clock-btn  { font-size: 1.25rem; font-weight: 600; padding: 1rem 3rem;
                 border-radius: 2px; border: 0; color: white; cursor: pointer;
                 transition: background 150ms; }
.ts-clock-btn.idle   { background: #16a34a; }
.ts-clock-btn.idle:hover   { background: #15803d; }
.ts-clock-btn.active { background: #dc2626; }
.ts-clock-btn.active:hover { background: #b91c1c; }
.ts-timer      { font-family: monospace; font-size: 1.75rem; color: var(--muted); }
.ts-switch     { background: transparent; color: var(--accent); border: 0;
                 cursor: pointer; text-decoration: underline; }
.ts-summary    { display: flex; justify-content: space-between;
                 padding: 1rem; font-size: 1rem; color: var(--muted); }
.ts-entry-list { list-style: none; padding: 0; }
.ts-entry      { display: grid; grid-template-columns: 1fr auto auto;
                 gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.ts-empty      { color: var(--muted); padding: 1rem 0; }
.ts-secondary  { background: transparent; border: 1px dashed var(--border);
                 padding: 0.5rem 1rem; border-radius: 0.5rem; cursor: pointer; }

.ts-modal { padding: 1.5rem; border: 0; border-radius: 0.75rem; min-width: 400px; }
.ts-modal label { display: block; margin-bottom: 1rem; }
.ts-modal input, .ts-modal select, .ts-modal textarea { width: 100%; padding: 0.5rem; }

.ts-live-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 0.75rem 0; }
.ts-live-chip  { background: #16a34a; color: white; padding: 0.25rem 0.75rem;
                 border-radius: 2px; font-size: 0.875rem; }
.ts-live-empty { color: var(--muted); padding: 0.75rem 0; }
.ts-table      { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.ts-table th, .ts-table td { padding: 0.5rem; border-bottom: 1px solid var(--border);
                              text-align: left; }
.ts-primary    { background: var(--accent); color: white; padding: 0.75rem 1.5rem;
                 border: 0; border-radius: 0.5rem; cursor: pointer; }
.ts-approve    { background: #16a34a; color: white; padding: 0.25rem 0.75rem;
                 border: 0; border-radius: 0.25rem; cursor: pointer; }
.ts-anomaly    { background: #f59e0b; color: white; padding: 0.125rem 0.5rem;
                 border-radius: 2px; font-size: 0.75rem; font-weight: 600; }
.ts-modal menu { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0; }

/* ── Global: hide all scrollbars (keep scroll functional) ──────────────
   Scrollable regions still scroll via wheel / trackpad / touch; only the
   visible scrollbar track + thumb are removed, app-wide. */
* { scrollbar-width: none !important; -ms-overflow-style: none !important; }
*::-webkit-scrollbar,
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-corner {
  width: 0 !important; height: 0 !important;
  background: transparent !important; display: none !important;
}
