/* ============================================================================
   PrimeHold Private Client Office — design system
   Palette and type pulled directly from primeholdconcierge.com so the portal
   reads as one brand with the marketing site.
   ========================================================================== */

:root {
  --navy: #061827;
  --navy-mid: #0a253a;
  --navy-soft: #12344a;
  --gold: #c99a45;
  --gold-light: #e0bd75;
  --ivory: #f4efe5;
  --paper: #faf7f0;
  --ink: #0b1d2d;
  --muted: #6d6a62;
  --line: rgba(201, 154, 69, 0.42);
  --white-line: rgba(255, 255, 255, 0.16);
  /* Verified directly against primeholdconcierge.com's computed styles
     (no <link> font tags, empty document.fonts — the site loads no webfont
     at all and relies entirely on these system stacks). Do not "upgrade" to
     a nicer-looking webfont without re-checking the live site first — this
     pairing is deliberately what's actually there, not a placeholder. */
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
  --font-display: var(--serif);
  --font-interface: var(--sans);
  --shadow: 0 28px 80px rgba(2, 14, 24, 0.2);

  --danger: #9b3b3b;
  --danger-bg: #fbeceb;
  --warn: #9b702d;
  --warn-bg: #fbf2e1;
  --ok: #3b7a5a;
  --ok-bg: #ebf5ef;
  --info: #2d5f9b;
  --info-bg: #e9f1fb;

  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; margin: 0 0 0.4em; color: var(--navy); }
p { margin: 0 0 1em; }
a { color: inherit; }
button { font-family: var(--font-interface); cursor: pointer; }
::selection { background: var(--gold-light); color: var(--navy); }

/* ---------------------------------------------------------------------- */
/* Typography hierarchy (matched against primeholdconcierge.com's own      */
/* computed styles: Georgia/serif for display, Segoe UI/Arial for         */
/* interface — see the --font-display / --font-interface note above).     */
/* Sizes below follow the brief's exact scale, with one deliberate         */
/* deviation: Georgia has no 500 weight, so display headings stay at 400   */
/* rather than synthesizing a fake bold the browser would have to fake.    */
/* ---------------------------------------------------------------------- */
h1.page-title, .page-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(32px, 3vw, 52px);
  line-height: 1.06; letter-spacing: -0.02em; margin: 0;
}
.command-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin: -4px 0 0;
}
.command-hero .page-title { font-size: clamp(28px, 2.4vw, 40px); }
.section-title { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.2; margin: 0; }
.card-title, .card-heading { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.25; margin: 0; }
.body-copy { font-family: var(--font-interface); font-weight: 400; font-size: 15px; line-height: 1.65; }
.form-label, .table-heading { font-family: var(--font-interface); font-weight: 600; font-size: 13.5px; }
.dashboard-label, .stat-label { font-family: var(--font-interface); font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.table-cell, table td { font-size: 13.5px; line-height: 1.5; }
.eyebrow {
  font-family: var(--font-interface); font-size: 11px; font-weight: 650;
  letter-spacing: 3.5px; text-transform: uppercase; color: var(--muted);
}
.tabular-nums { font-variant-numeric: tabular-nums; }
.view-all-link { font-family: var(--font-interface); font-size: 13.5px; font-weight: 600; color: var(--gold); text-decoration: none; }
.view-all-link:hover { text-decoration: underline; }
.filter-select-sm { font-size: 12.5px; padding: 5px 8px; max-width: 150px; }

/* ---------------------------------------------------------------------- */
/* App shell                                                               */
/* ---------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 290px;
  flex-shrink: 0;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 4px;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.18s ease;
}
#sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
#sidebar-nav::-webkit-scrollbar { width: 6px; }
#sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
#sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-collapsed { width: 84px; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .sidebar-user-copy,
.sidebar-collapsed .nav-link-label, .sidebar-collapsed .nav-section-label,
.sidebar-collapsed .sidebar-search, .sidebar-collapsed .sidebar-user > svg,
.sidebar-collapsed .sidebar-security-panel > div, .sidebar-collapsed .nav-counter,
.sidebar-collapsed .sidebar-user-menu { display: none; }
.sidebar-collapsed .nav-link { justify-content: center; }
.sidebar-collapsed .sidebar-user { justify-content: center; }
.sidebar-collapsed .sidebar-footer .btn span.label-text { display: none; }

.sidebar-toggle {
  background: none; border: 1px solid var(--white-line); border-radius: 8px;
  color: rgba(255,255,255,0.6); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.06); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  color: var(--gold-light);
  font-size: 14px;
  flex-shrink: 0;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.brand-copy strong { font-family: var(--serif); font-size: 16px; font-weight: 400; }
.brand-copy small { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); }

.sidebar-search {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 6px; padding: 8px 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--white-line); border-radius: 8px;
  color: rgba(255,255,255,0.5);
}
.sidebar-search input {
  background: none; border: none; color: #fff; font-size: 13px; padding: 0; width: 100%;
}
.sidebar-search input::placeholder { color: rgba(255,255,255,0.4); }
.sidebar-search input:focus { box-shadow: none; }
.sidebar-search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; z-index: 60; max-height: 260px; overflow-y: auto;
}
.sidebar-search-results.open { display: block; }
.sidebar-search-item { padding: 9px 12px; font-size: 13px; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.sidebar-search-item:hover { background: rgba(201,154,69,0.08); }

.sidebar-user {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px; margin: 4px 0 8px; border-radius: 10px; cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(201,154,69,0.18); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.sidebar-user-copy { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-user-copy strong { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user > svg { color: rgba(255,255,255,0.4); flex-shrink: 0; }
.sidebar-user-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 10px; right: 10px;
  background: #fff; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; z-index: 60;
}
.sidebar-user-menu.open { display: block; }
.sidebar-user-menu a, .sidebar-user-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 14px; font-size: 13px;
  color: var(--ink); background: none; border: none; text-decoration: none;
}
.sidebar-user-menu a:hover, .sidebar-user-menu button:hover { background: rgba(201,154,69,0.08); }

.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-family: var(--font-interface);
  font-size: 15px;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link-icon { display: flex; flex-shrink: 0; opacity: 0.85; }
.nav-link-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link:hover .nav-link-icon { opacity: 1; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(210, 160, 59, 0.22), rgba(210, 160, 59, 0.06));
  border-left: 3px solid var(--gold);
  color: #ffffff;
}
.nav-link.active .nav-link-icon { color: var(--gold-light); opacity: 1; }
.nav-counter {
  background: var(--gold); color: var(--navy); font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; flex-shrink: 0;
}
.nav-section-label {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  color: rgba(255, 255, 255, 0.4); padding: 16px 12px 4px;
}

/* #quick-actions-menu reuses .sidebar-user-menu's own styling verbatim
   (white flyout, dark text, same hover) — it's a flyout off a small
   always-visible header trigger, not permanent sidebar space, so it never
   competes with the main nav for room and is never buried by a long scroll
   the way two earlier attempts at an inline block were. */

.sidebar-security-panel {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; margin-bottom: 8px; color: rgba(255,255,255,0.75);
}
.sidebar-security-panel svg { color: var(--gold-light); flex-shrink: 0; }
.sidebar-security-panel strong { font-size: 12.5px; color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--white-line); font-size: 12px; color: rgba(255,255,255,0.5); }
.sidebar-user { padding: 8px 12px; }
.sidebar-user strong { display: block; color: #fff; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: var(--paper);
  border-bottom: 1px solid rgba(11, 29, 45, 0.08);
}
.breadcrumbs { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumbs a { text-decoration: none; color: var(--navy-mid); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.content { flex: 1; padding: 24px 28px 60px; overflow-y: auto; }
.content-narrow { max-width: 1080px; }

/* ---------------------------------------------------------------------- */
/* Mobile / tablet — the sidebar was a fixed 248px column at every width,  */
/* which on a phone squeezed breadcrumbs/content into a sliver and forced */
/* horizontal scrolling. Below 880px it becomes a slim horizontal bar     */
/* instead, so nothing needs to be hidden behind a hamburger to stay      */
/* usable.                                                                 */
/* ---------------------------------------------------------------------- */
@media (max-width: 880px) {
  .app-shell { flex-direction: column; min-height: 100vh; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 4px;
    padding: 10px 12px; overflow-x: visible; overflow-y: visible;
  }
  .brand { border-bottom: none; margin-bottom: 0; padding: 4px 8px; flex-shrink: 0; }
  .sidebar-user, .sidebar-search, .sidebar-toggle, .sidebar-security-panel { display: none; }
  .sidebar.sidebar-collapsed { width: 100%; }
  #sidebar-nav {
    display: flex; flex-direction: row; gap: 4px; overflow-x: auto;
    flex: 1 1 0; min-width: 0; min-height: auto;
  }
  .nav-link { white-space: nowrap; padding: 8px 10px; font-size: 13px; border-left: none; border-bottom: 3px solid transparent; }
  .nav-link.active { border-left: none; border-bottom: 3px solid var(--gold); }
  .nav-link-icon { display: none; }
  .nav-section-label { display: none; }
  .sidebar-footer { margin-top: 0; padding-top: 0; border-top: none; flex-shrink: 0; }
  .sidebar-footer .btn { white-space: nowrap; }

  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  .breadcrumbs { font-size: 12px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }

  .content { padding: 16px 16px 40px; }
  .page-title { font-size: 21px; }
  .login-visual-headline { font-size: 30px; }

  /* Wide tables (Matters, Activity, etc.) were shrinking columns until cell
     text wrapped into an unreadable mess instead of scrolling horizontally
     within their card — force natural column widths so .card's own
     overflow-x:auto does the scrolling instead. */
  table { width: max-content; min-width: 100%; }
  td, th { white-space: nowrap; }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-interface);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  color: var(--navy);
  white-space: nowrap;
}
.btn-primary { background: var(--gold-light); color: var(--navy); border-color: var(--gold-light); }
.btn-primary:hover { background: var(--gold); }
.btn-outline { border-color: rgba(201, 154, 69, 0.5); color: var(--navy-mid); }
.btn-outline:hover { background: rgba(201, 154, 69, 0.08); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: rgba(11,29,45,0.04); }
.btn-danger { color: var(--danger); border-color: rgba(155, 59, 59, 0.4); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* Cards, tables, panels                                                   */
/* ---------------------------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid rgba(11, 29, 45, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  overflow-x: auto;
}
.card + .card { margin-top: 16px; }
.grid .card + .card { margin-top: 0; }
.card-compact { padding: 12px 22px; }
.card-compact .card-header { margin-bottom: 0; }
.card-compact p.muted { margin: 4px 0 0; }
.density-compact .card { padding: 12px 16px; }
.density-compact .card + .card { margin-top: 10px; }
.density-compact .card-header { margin-bottom: 8px; }
.density-compact table td, .density-compact table th { padding: 6px 10px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card-header h3 { margin: 0; font-size: 20px; font-family: var(--font-display); font-weight: 400; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.command-centre-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .command-centre-grid { grid-template-columns: 1fr; } }

.stat { padding: 4px 0; }
.stat-label { font-family: var(--font-interface); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 24px; color: var(--navy); margin-top: 2px; font-variant-numeric: tabular-nums; }

.metric-card {
  min-height: 118px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 18px;
  background: var(--paper); border: 1px solid rgba(11, 29, 45, 0.08); border-radius: var(--radius-lg);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.metric-card:hover { box-shadow: 0 10px 26px rgba(11,29,45,0.1); border-color: var(--line); transform: translateY(-1px); }
.metric-card__label { font-family: var(--font-interface); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.metric-card__value { margin-top: 8px; font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.metric-card__link { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--gold); }

/* ---------------------------------------------------------------------- */
/* PrimeHold AI                                                            */
/* ---------------------------------------------------------------------- */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.45fr); gap: 20px; align-items: start; margin-top: 16px; }
@media (max-width: 1100px) { .ai-layout { grid-template-columns: 1fr; } }
.ai-context-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ai-conversation { display: flex; flex-direction: column; min-height: 480px; }
#ai-messages { flex: 1; overflow-y: auto; max-height: 480px; padding-right: 4px; margin-bottom: 12px; }
.ai-message { display: flex; margin-bottom: 12px; }
.ai-message--user { justify-content: flex-end; }
.ai-message--ai { justify-content: flex-start; }
.ai-bubble {
  max-width: 80%; padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap;
}
.ai-message--user .ai-bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.ai-message--ai .ai-bubble { background: var(--ivory); border: 1px solid rgba(11,29,45,0.08); border-bottom-left-radius: 4px; }
.ai-message--error .ai-bubble { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.ai-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ai-prompt-chip {
  font-family: var(--font-interface); font-size: 12.5px; padding: 7px 12px; border-radius: 99px;
  border: 1px solid rgba(201,154,69,0.4); background: transparent; color: var(--navy-mid); cursor: pointer;
}
.ai-prompt-chip:hover { background: rgba(201,154,69,0.08); }
.ai-input-row { display: flex; gap: 10px; }
.ai-input-row input { flex: 1; }
.ai-source-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(11,29,45,0.06); }
.ai-source-item:last-child { border-bottom: none; }
.ai-source-item a { color: var(--navy-mid); text-decoration: none; }
.ai-source-item a:hover { text-decoration: underline; }

.health-segment { transition: opacity 0.15s ease; }
.health-segment:hover { opacity: 0.82; }
.health-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; align-items: center; }
.health-legend-item { display: inline-flex; align-items: center; gap: 6px; }

.control-strip {
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center;
  font-size: 12.5px; color: var(--muted); margin: 12px 0 20px; padding: 10px 16px;
  background: var(--bg-alt, #f7f8f9); border-radius: var(--radius);
}
.control-strip-item { display: inline-flex; align-items: center; gap: 4px; }
.control-strip-item strong { color: var(--ink, #0b1d2d); font-family: var(--font-display); }

.finding-card { border: 1px solid rgba(11,29,45,0.08); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.finding-card:last-child { margin-bottom: 0; }

/* Stacked rows for the Matters table — no fixed column widths, so it never
   needs a horizontal scrollbar at any width down to mobile. */
.matter-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 4px; border-bottom: 1px solid rgba(11,29,45,0.06); cursor: pointer;
}
.matter-row:last-child { border-bottom: none; }
.matter-row:hover { background: rgba(201, 154, 69, 0.06); }
.matter-row__main { flex: 1 1 320px; min-width: 0; }
.matter-row__action { font-size: 13px; color: var(--muted); margin-top: 2px; }
.matter-row__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
.matter-row__buttons { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-family: var(--font-interface); font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid rgba(11,29,45,0.1); }
td { padding: 11px 10px; border-bottom: 1px solid rgba(11,29,45,0.06); vertical-align: top; font-size: 13.5px; line-height: 1.5; text-align: left; }
.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(201, 154, 69, 0.06); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-interface);
  font-size: 11px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(11,29,45,0.06); color: var(--navy-mid);
}
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-gold { background: rgba(201,154,69,0.16); color: #8a672a; }

.badge-internal {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--danger); border: 1px solid rgba(155,59,59,0.35);
  padding: 2px 8px; border-radius: 999px;
}

/* ---------------------------------------------------------------------- */
/* Tabs                                                                    */
/* ---------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(11,29,45,0.1); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 10px 14px; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; text-decoration: none;
}
.tab.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.tab:hover { color: var(--navy); }

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
label { display: block; font-family: var(--font-interface); font-size: 13px; font-weight: 600; color: var(--navy-mid); margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  font-family: var(--font-interface);
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid rgba(11,29,45,0.16);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,69,0.15); }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.helptext { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------------- */
/* Modal                                                                   */
/* ---------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 24, 39, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow);
  width: 100%; max-width: 640px; padding: 26px 28px;
}
.modal-wide { max-width: 980px; }
.split-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .split-review { grid-template-columns: 1fr; } }
.split-review__source { background: var(--bg-alt, #f7f8f9); border-radius: var(--radius); padding: 14px; max-height: 70vh; overflow-y: auto; }
.split-review__source pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 12.5px; margin: 0; }
.finance-breakdown-row td { padding-top: 0 !important; padding-bottom: 10px !important; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------------------------------------------------------------------- */
/* Drawer (right-anchored slide-in panel, e.g. Command Centre matter detail) */
/* ---------------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(6, 24, 39, 0.5);
  display: flex; align-items: stretch; justify-content: flex-end;
  z-index: 100;
}
.drawer {
  background: #fff; box-shadow: var(--shadow);
  width: 100%; max-width: 460px; height: 100%; padding: 26px 28px;
  overflow-y: auto;
  animation: drawer-slide-in 0.2s ease-out;
}
@keyframes drawer-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.drawer-header h3 { font-size: 18px; margin: 0; }
@media (max-width: 560px) { .drawer { max-width: 100%; } }

.hover-preview-card {
  display: none; position: absolute; z-index: 500; width: 270px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(11,29,45,0.18); padding: 14px 16px; font-size: 12.5px;
}
.hover-preview-card h4 { margin: 0 0 8px; font-family: var(--font-display); font-size: 15px; font-weight: 400; color: var(--navy); }
.hover-preview-card .hpc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; }
.hover-preview-card .hpc-label { color: var(--muted); }
@media (max-width: 560px) { .hover-preview-card { display: none !important; } }

/* ---------------------------------------------------------------------- */
/* Login page                                                              */
/* ---------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect width='100' height='100' fill='none'/%3E%3C/svg%3E");
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 32px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .brand-mark { margin: 0 auto 10px; width: 44px; height: 44px; font-size: 18px; border-color: var(--gold); color: var(--gold); }
.login-brand strong { font-family: var(--serif); font-size: 20px; color: var(--navy); display: block; }
.login-brand small { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.login-error { background: var(--danger-bg); color: var(--danger); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }

/* ---------------------------------------------------------------------- */
/* Sign-in screen — split visual + form                                    */
/* Every dimension below is a fraction/min()/clamp() rather than a fixed   */
/* pixel floor specifically so nothing can force horizontal overflow —    */
/* tested at 360x800 through 1920x1080, see DEPLOY.md for the exact list. */
/* ---------------------------------------------------------------------- */
.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--navy);
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(4,21,43,0.94) 0%, rgba(4,21,43,0.82) 42%, rgba(4,21,43,0.4) 72%, rgba(4,21,43,0.18) 100%),
    linear-gradient(0deg, rgba(4,21,43,0.55) 0%, rgba(4,21,43,0.05) 30%),
    url("https://primeholdconcierge.com/assets/images/residence-detail.jpg") center/cover no-repeat;
}
.hero-content {
  position: relative; z-index: 2;
  width: min(480px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.login-visual-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.login-visual-brand .brand-mark { width: 46px; height: 46px; font-size: 18px; border-color: var(--gold); color: var(--gold-light); flex-shrink: 0; }
.login-visual-brand strong { font-family: var(--font-display); font-size: 20px; font-weight: 400; display: block; white-space: nowrap; }
.login-visual-brand small { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-light); white-space: nowrap; }

.login-visual-headline {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(34px, 3.4vw, 54px); line-height: 1.08; letter-spacing: -0.01em;
  margin: 0 0 18px; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.35);
}
.login-visual-rule { width: 54px; height: 2px; background: var(--gold); border: none; margin: 0 0 18px; }
.login-visual-copy { font-family: var(--font-interface); font-size: 16px; line-height: 1.6; color: rgba(255,255,255,0.86); margin: 0; }

.login-visual-trust { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.75); }
.login-visual-trust svg { flex-shrink: 0; color: var(--gold-light); margin-top: 2px; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-width: 0;
}
.login-panel-card {
  width: min(580px, 100%);
  padding: clamp(32px, 4vw, 56px) clamp(24px, 3.5vw, 52px);
  border: 1px solid rgba(210, 160, 59, 0.55);
  border-radius: 26px;
  background: rgba(8, 31, 56, 0.92);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
.login-panel-brand { display: flex; justify-content: center; margin-bottom: 20px; }
.login-panel-brand .brand-mark { width: 52px; height: 52px; font-size: 19px; border-color: var(--gold); color: var(--gold-light); }
.login-panel-card h1 { font-family: var(--font-display); color: #fff; text-align: center; font-size: clamp(26px, 2.4vw, 34px); margin-bottom: 8px; }
.login-panel-rule { width: 40px; height: 2px; background: var(--gold); border: none; margin: 0 auto 18px; }
.login-panel-subtitle { font-family: var(--font-interface); text-align: center; color: rgba(255,255,255,0.65); font-size: 16px; line-height: 1.6; margin: 0 0 28px; }

.login-panel label { font-family: var(--font-interface); color: rgba(255,255,255,0.75); font-size: 14px; font-weight: 600; }
.field-icon { position: relative; }
.field-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); pointer-events: none; }
.field-icon input {
  padding-left: 42px;
  min-height: 58px;
  font-size: 16px;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.16);
  color: #fff;
}
.field-icon input::placeholder { color: rgba(255,255,255,0.35); }
.field-icon input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(210, 160, 59, 0.16);
  outline: none;
}
.field-icon .toggle-visibility {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius); color: rgba(255,255,255,0.5);
}
.field-icon .toggle-visibility:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.06); }
.field-icon .toggle-visibility:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.login-panel-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; font-size: 13.5px; }
.login-panel-row label { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,0.7); margin: 0; font-weight: 400; font-size: 13.5px; }
.login-panel-row a { color: var(--gold-light); text-decoration: none; }
.login-panel-row a:hover, .login-panel-row a:focus-visible { text-decoration: underline; }

.login-button {
  width: 100%; justify-content: center;
  min-height: 58px; font-size: 16px; font-weight: 700;
  background: linear-gradient(180deg, #e2bd68 0%, #cc9833 100%);
  color: #061a33;
  border: 1px solid #e4c778;
  border-radius: 12px;
}
.login-button:hover { filter: brightness(1.04); }
.login-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; font-size: 12px; color: rgba(255,255,255,0.4); }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.14); }

.login-alt-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-alt-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 11px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.85); font-size: 13.5px; font-weight: 600;
  text-transform: none; letter-spacing: normal;
}
.login-alt-btn:hover { background: rgba(255,255,255,0.08); }
.login-alt-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.login-panel-footer {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 26px; font-size: 13px; line-height: 1.6; color: rgba(255,255,255,0.45); text-align: left;
}
.login-panel-footer svg { color: var(--gold-light); flex-shrink: 0; margin-top: 2px; }

@media (max-width: 1100px) {
  .login-split { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 24px 16px; }
}
@media (max-width: 420px) {
  .login-panel-card { padding: 28px 20px; border-radius: 20px; }
  .login-alt-methods { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .login-button, .login-alt-btn, .field-icon .toggle-visibility { transition: none; }
}

/* ---------------------------------------------------------------------- */
/* Misc                                                                    */
/* ---------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.muted { color: var(--muted); }
.visibility-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.timeline-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(11,29,45,0.06); }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.timeline-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 22px 0 10px; }
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: #fff;
  padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 13.5px; z-index: 200;
}
.loading-bar { height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---------------------------------------------------------------------- */
/* Print (report export to PDF via the browser's native print dialog)     */
/* ---------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .breadcrumbs, .tabs, .no-print { display: none !important; }
  .main, .content { padding: 0; margin: 0; overflow: visible; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; padding: 0; }
  a { text-decoration: none; color: inherit; }
}
