/* ── Reset & base ────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #111827;
  background: #f9fafb;
}

/* ── Page layout ─────────────────────────────────────────────────────── */

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top nav */
.app-nav {
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-nav a { text-decoration: none; font-size: 0.875rem; }
.app-nav .app-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; text-decoration: none; }

/* Tailwind's text-white / text-white/80 / hover:text-white utilities live in
   @layer utilities, which always loses to the *unlayered* global `a` (line ~200)
   and `form.button_to button` (destructive-link default, further down) rules
   below, regardless of specificity — CSS Cascade Layers rules unlayered
   declarations above ALL layered ones, specificity notwithstanding. So the
   nav's white text has to be asserted here too, in the same unlayered origin,
   where normal specificity math actually applies again. The Tailwind classes
   stay in the markup for font-weight/border/transition, which aren't contested. */
.app-nav a,
.app-nav form.button_to button {
  color: rgba(255, 255, 255, 0.8);
}

/* Same Cascade Layers gotcha as above, hitting any filled bg-lens-primary
   button rendered as an <a> (e.g. the Financials tab's "Generate report"
   and "Upload" buttons) — Tailwind's text-white is layered and loses to the
   unlayered `a { color }` rule below, so the label renders in link-blue on
   a near-identical blue background instead of white. */
.btn-primary-link,
.btn-primary-link:hover {
  color: #fff;
}

.app-nav a:hover,
.app-nav a.font-semibold,
.app-nav form.button_to button:hover {
  color: #fff;
}

.app-nav .app-name { color: #fff; }
.app-nav form.button_to button { text-decoration: none; }

/* User menu — reuses the <details>/<summary> dropdown pattern already used
   for the Companion history item's "⋯" menu (no JS needed for open/close). */
.user-menu { position: relative; }

.user-menu__trigger {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}
.user-menu__trigger::-webkit-details-marker { display: none; }
.user-menu__trigger::after { content: "▾"; font-size: 0.6rem; opacity: 0.7; }
.user-menu__trigger:hover { background: rgba(255, 255, 255, 0.12); }

.user-menu__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 40;
  margin-top: 6px;
  min-width: 150px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  padding: 4px 0;
}

/* Same unlayered-rule gotcha as the .app-nav a / .btn-primary-link notes
   above, but a plain specificity tie rather than a Cascade Layers issue:
   .app-nav .user-menu__item (2 classes, 0 elements) beats .app-nav a
   (1 class, 1 element) fine, but ties on class-count against
   .app-nav form.button_to button (2 classes: .app-nav/.button_to, 2
   elements: form/button) — and loses the tiebreak on element count. That's
   why "Sign out" (a button_to) rendered white while "Profile" (a plain <a>)
   didn't. Scoping through .user-menu__dropdown adds a third class so both
   rules below win outright regardless of element count. */
.app-nav .user-menu__dropdown .user-menu__item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #334155;
  font-size: 0.8rem;
  font-family: inherit;
  text-align: left;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
}
.app-nav .user-menu__dropdown .user-menu__item:hover {
  background: #f1f5f9;
  color: #334155;
}

.sidebar-toggle-btn {
  position: fixed;
  top: 66px;
  left: 200px;
  z-index: 20;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.05rem;
  line-height: 1;
  color: #9ca3af;
  transition: left 0.2s ease;
}

.sidebar-toggle-btn:hover { color: #374151; }
body.sidebar-collapsed .sidebar-toggle-btn { left: 12px; }

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 52px);
}

body.sidebar-collapsed .sidebar { display: none; }

.app-nav .nav-badge {
  display: inline-block;
  min-width: 16px;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.app-nav .nav-badge-failed {
  background: #d97706;
}

.page-content {
  flex: 1;
  min-width: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
  flex: 0 0 240px;
  width: 240px;
  background: #f1f5f9;
  border-right: 1px solid #e2e8f0;
  box-shadow: 1px 0 4px rgba(15, 23, 42, 0.04), 2px 0 10px rgba(15, 23, 42, 0.03);
  padding: 20px 12px;
  position: sticky;
  top: 52px;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
}

.sidebar-flat-link {
  display: block;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  margin-bottom: 12px;
}

.sidebar-flat-link:hover { background: #e2e8f0; text-decoration: none; }
.sidebar-flat-link.active { color: #1d4ed8; background: #eff6ff; }

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #9ca3af;
  padding: 0 10px;
  margin-bottom: 6px;
}

.sidebar-tree-node { margin-bottom: 2px; }

.sidebar-tree-node__header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-tree-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 0.65rem;
  color: #9ca3af;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.1s ease;
}

.sidebar-tree-toggle[aria-expanded="true"] { transform: rotate(90deg); }

.sidebar-tree-node__label {
  flex: 1;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
}

.sidebar-tree-node__label:hover { background: #e2e8f0; text-decoration: none; }
.sidebar-tree-node__label.active { color: #1d4ed8; background: #eff6ff; }

.sidebar-tree-children {
  display: none;
  flex-direction: column;
  padding-left: 22px;
}

.sidebar-tree-children--open { display: flex; }

.sidebar-tree-child {
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.8125rem;
  color: #6b7280;
  text-decoration: none;
}

.sidebar-tree-child:hover { background: #e2e8f0; color: #374151; text-decoration: none; }
.sidebar-tree-child.active { color: #1d4ed8; background: #eff6ff; font-weight: 600; }

/* ── Typography ──────────────────────────────────────────────────────── */

h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 16px; color: #0f172a; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 24px 0 12px; color: #1e293b; }
h3 { font-size: 1rem;   font-weight: 600; margin: 20px 0 8px;  color: #1e293b; }

p { margin: 0 0 12px; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.draft-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 16px;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────── */

nav.breadcrumb, nav[class=""] {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 16px;
}

nav.breadcrumb a, nav[class=""] a { color: #4b5563; }

/* ── Flash messages ──────────────────────────────────────────────────── */

#notice, #alert {
  padding: 10px 16px;
  border-radius: 5px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

#notice { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
#alert  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Forms ───────────────────────────────────────────────────────────── */

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

input[type="submit"],
button[type="submit"],
.btn {
  display: inline-block;
  padding: 9px 18px;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: #1d4ed8;
  color: #fff;
  font-family: inherit;
  transition: background 0.15s;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.btn:hover { background: #1e40af; }

input[type="submit"]:disabled,
button:disabled { opacity: 0.6; cursor: not-allowed; }

form > div { margin-bottom: 14px; }

/* Devise / simple form wrappers */
.field        { margin-bottom: 14px; }
.actions      { margin-top: 20px; }

/* ── File drop zone ──────────────────────────────────────────────────── */

.dropzone {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover { border-color: #93c5fd; background: #f0f7ff; }

.dropzone.drag-over {
  border-color: #1d4ed8;
  background: #eff6ff;
}

.dropzone-text {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.upload-staging-table {
  margin-top: 12px;
  margin-bottom: 0;
}

.upload-staging-table td { vertical-align: middle; }
.upload-staging-table select { margin: 0; }
.upload-staging-table select:disabled { opacity: 0.6; cursor: not-allowed; }

.upload-row-status {
  font-size: 0.85rem;
  color: #9ca3af;
}

.upload-row-status--ok    { color: #059669; font-weight: 600; }
.upload-row-status--error { color: #dc2626; font-weight: 600; }

.dropzone-filename {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1d4ed8;
}

.dropzone-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dropzone-clear:hover { background: #fee2e2; color: #dc2626; }

.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.helper-text {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: -8px;
}

.error_notification { color: #dc2626; margin-bottom: 12px; font-size: 0.9rem; }
#error_explanation {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #991b1b;
  font-size: 0.875rem;
}
#error_explanation ul { margin: 6px 0 0 16px; padding: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover { background: #f9fafb; }

.btn-destructive {
  background: #fff;
  color: #dc2626;
  border: 1px solid #dc2626;
}
.btn-destructive:hover { background: #fef2f2; }

/* ── Inbound documents queue ─────────────────────────────────────────── */

.inbound-doc-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
}

.inbound-doc-type-select,
.inbound-property-select {
  width: 100%;
}

.inbound-doc-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Inline button_to forms don't add extra space */
form.button_to { display: inline; }
form.button_to button {
  background: none;
  border: none;
  padding: 0;
  color: #dc2626;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

form.button_to button.delete-x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

form.button_to button.delete-x-btn:hover { background: #fee2e2; color: #dc2626; }

/* ── Tables ──────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

thead th {
  text-align: left;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  font-weight: 600;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ── Badges ──────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 2px 7px;
  background: #e5e7eb;
  color: #374151;
}

.badge--capex        { background: #dbeafe; color: #1d4ed8; }
.badge--refinance    { background: #ede9fe; color: #6d28d9; }
.badge--acquisition  { background: #d1fae5; color: #065f46; }
.badge--disposition  { background: #fef3c7; color: #92400e; }
.badge--other        { background: #f3f4f6; color: #4b5563; }

/* ── Auth pages (Devise) ─────────────────────────────────────────────── */

.auth-container {
  max-width: 400px;
  margin: 80px auto;
  padding: 32px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.auth-container h2 { margin-top: 0; }
.auth-container .actions input { width: 100%; }

/* Devise wraps forms in a div with no class — target specifically */
body > div > h2 { /* Devise sign-in heading fallback */ }

/* ── Sections / cards ────────────────────────────────────────────────── */

section { margin-bottom: 40px; }

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

/* ── Property tab navigation ─────────────────────────────────── */

.property-tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 28px;
  gap: 0;
}

.property-tab {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}

.property-tab:hover { color: #374151; text-decoration: none; }
.property-tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

/* Snapshot date tabs on rent roll (reuse same style) */
.snapshot-tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 20px;
  gap: 0;
  flex-wrap: wrap;
}

.snapshot-tab {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.snapshot-tab:hover { color: #374151; text-decoration: none; }
.snapshot-tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

/* ── Month End Report ────────────────────────────────────────── */

.mer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.mer-panel { min-width: 0; }

.mer-full { margin-bottom: 28px; }

.mer-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #374151;
  margin: 0 0 10px;
}

.mer-col-label {
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #9ca3af;
  margin-left: 6px;
}

.mer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.mer-table thead th {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.mer-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #111827;
}

.mer-table tbody tr:last-child td { border-bottom: none; }

.mer-label-col { width: 55%; }
.mer-num-col   { text-align: right; font-variant-numeric: tabular-nums; }

.mer-subtotal td {
  font-weight: 600;
  background: #f9fafb;
  border-top: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
}

.mer-gap td {
  padding: 4px 0;
  border-bottom: none;
  background: transparent;
}

.mer-empty { color: #d1d5db; }

.inline-rate-form {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
}

.inline-rate-input {
  width: 5rem;
  padding: 2px 5px;
  font-size: 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  text-align: right;
}

.inline-rate-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.inline-rate-pct {
  font-size: 0.85rem;
  color: #6b7280;
}

.inline-rate-save {
  background: none;
  border: none;
  cursor: pointer;
  color: #059669;
  font-size: 0.9rem;
  padding: 2px 4px;
  border-radius: 4px;
}

.inline-rate-save:hover { background: #f0fdf4; }

/* ── Portfolio summary strip ─────────────────────────────────── */

.portfolio-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0 28px;
}

.portfolio-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Hover-reveal row actions ────────────────────────────────────────── */
/* CSS-only show/hide — no JS, no behavior change. .table-row is the class
   for non-<tr> "row" layouts (e.g. the Documents/Pinned redesigns) that
   still want this same reveal-on-hover behavior. */
.row-actions {
  visibility: hidden;
  display: flex;
  align-items: center;
  gap: 4px;
}

tr:hover .row-actions,
.table-row:hover .row-actions {
  visibility: visible;
}

.icon-btn {
  background: none;
  border: none;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  line-height: 0;
  text-decoration: none;
}

.icon-btn:hover { background: rgba(0, 0, 0, 0.06); }

.icon-btn--edit    { color: #F59E0B; }
.icon-btn--danger  { color: var(--color-lens-failed); }
.icon-btn--muted   { color: #6b7280; }

/* ── Documents tab (Dropbox-style row layout) ────────────────────────── */
.upload-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.upload-panel h2 { margin: 0 0 12px; font-size: 1rem; }

.document-list {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #fff;
}

.document-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f1f3;
}
.document-row:last-child { border-bottom: none; }
.document-row:hover { background: #f9fafb; }

.document-row__icon { flex-shrink: 0; display: flex; }

.document-row__main { flex: 1; min-width: 0; }

.document-row__filename {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-row__filename:hover { text-decoration: underline; }

.document-row__meta {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 2px;
}

.document-row__status { flex-shrink: 0; }

.document-row__review-link { font-size: 0.78rem; margin-left: 6px; }

.document-row__date {
  flex-shrink: 0;
  min-width: 84px;
  text-align: right;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ── Pinned insights tab ─────────────────────────────────────────────── */
.pin-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
}

.pin-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pin-card__meta { font-size: 11px; color: #6b7280; }
.pin-card__period-tag { font-size: 11px; color: #9ca3af; margin-top: 2px; }

.pin-card__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pin-visibility-select {
  font-size: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 6px;
  background: #f9fafb;
  color: #374151;
}

.pin-question {
  font-style: italic;
  font-size: 0.9rem;
  color: #111827;
  margin: 0 0 8px;
  cursor: text;
}

.pin-question-input {
  width: 100%;
  font-style: italic;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 8px;
  font-family: inherit;
}

.pin-answer {
  font-size: 0.9rem;
  color: #374151;
  cursor: text;
}

.pin-answer-input {
  width: 100%;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px;
  font-family: inherit;
}

.pin-edited-label {
  font-size: 10px;
  color: #9ca3af;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pin-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f1f3;
}

.pin-card__note { flex: 1; }

.pin-include-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #6b7280;
  white-space: nowrap;
}

.pin-empty-state {
  text-align: center;
  padding: 64px 16px;
  color: #9ca3af;
}
.pin-empty-state svg { margin: 0 auto 12px; }
.pin-empty-state__subtext { font-size: 0.85rem; margin-top: 4px; }

.portfolio-stat__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.portfolio-stat__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.portfolio-stat__value--positive { color: #059669; }
.portfolio-stat__value--negative { color: #dc2626; }
.portfolio-stat__value--muted    { color: #9ca3af; font-weight: 500; font-size: 1.1rem; }

.portfolio-noi-chart-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 24px 0;
}

.portfolio-noi-chart-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.portfolio-noi-chart-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portfolio-noi-chart-select {
  font-size: 0.8rem;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #374151;
  background: #f9fafb;
  cursor: pointer;
}

/* Month End Report: source notes and as-of flags */
.mer-tag { display: block; font-size: 0.68rem; font-weight: 400; color: #9ca3af; }
.mer-asof-flag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-radius: 3px;
  padding: 1px 5px;
}
.mer-sources { font-size: 0.8rem; color: #6b7280; margin: 0 0 14px; }
.mer-sources span.mer-source { margin-right: 16px; white-space: nowrap; }

/* Moonwalk shell: responsive navigation that preserves the existing routes. */
.app-nav {
  min-height: 58px;
  height: auto;
  padding: 6px 24px;
  gap: 26px;
  flex-wrap: wrap;
  background: #15151f;
  border-bottom: 1px solid rgba(196, 181, 253, 0.18);
}
.app-nav .app-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: #fff;
}
.app-name__mark { display: grid; place-items: center; width: 30px; height: 30px; color: #c4b5fd; }
.app-name__mark svg { width: 100%; height: 100%; }
.app-name__wordmark { display: flex; flex-direction: column; line-height: 1.05; font-size: 1.08rem; }
.app-name__company { margin-bottom: 3px; color: #c4b5fd; font-size: 0.52rem; font-weight: 700; letter-spacing: 0.16em; }
.app-nav__account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.app-nav a, .app-nav form.button_to button { min-height: 44px; display: inline-flex; align-items: center; }
.app-nav .user-menu__trigger { min-height: 44px; padding: 6px 10px; color: rgba(255, 255, 255, 0.88); font-weight: 600; }
.app-nav .user-menu__trigger:hover, .app-nav .user-menu[open] .user-menu__trigger { color: #fff; }
.app-nav a:focus-visible, .app-nav button:focus-visible, .user-menu__trigger:focus-visible,
.sidebar a:focus-visible, .sidebar button:focus-visible, .sidebar-toggle-btn:focus-visible {
  outline: 3px solid #c4b5fd;
  outline-offset: 3px;
  border-radius: 7px;
}
.sidebar-mobile-heading { display: none; }
.sidebar-backdrop { display: none; }

.mission-control {
  --mc-midnight: #15151f;
  --mc-graphite: #343244;
  --mc-violet: #8566eb;
  --mc-lavender: #c4b5fd;
  --mc-cloud: #f5f5f8;
  max-width: 1280px;
  margin: 0 auto;
  color: var(--mc-midnight);
}
.mission-control__header { margin: 0 0 12px; }
.mission-control__eyebrow, .mission-control__section-kicker {
  color: #6e6687;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mission-control__eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; }
.mission-control__orb { width: 8px; height: 8px; border-radius: 50%; background: var(--mc-violet); box-shadow: 0 0 0 4px rgba(133, 102, 235, 0.12); }
.mission-control__title-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.mission-control h1 { margin: 0; color: var(--mc-midnight); font-size: clamp(1.8rem, 3vw, 2.55rem); font-weight: 650; letter-spacing: -0.045em; line-height: 1.12; }
.mission-control__subtitle { margin: 5px 0 0; color: #696779; font-size: 0.97rem; }
.mission-control__as-of { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e5e3ed; border-radius: 999px; color: #555366; background: #fff; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.mission-control__status-dot { width: 7px; height: 7px; border-radius: 50%; background: #8c77da; }
.mission-control__prototype-note { display: flex; align-items: start; gap: 11px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid #ded6fb; border-radius: 12px; background: #f5f2ff; color: #494260; }
.mission-control__prototype-note p { margin: 0; font-size: 0.8rem; line-height: 1.55; }
.mission-control__prototype-note strong { color: #342a57; }
.mission-control__prototype-mark { display: grid; flex: 0 0 19px; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #8566eb; color: #fff; font-size: 0.72rem; font-weight: 700; }
.mission-control__pulse, .mission-control__portfolios { margin-bottom: 18px; }
.mission-control__section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.mission-control__section-kicker { margin: 0 0 3px; font-size: 0.66rem; }
.mission-control h2 { margin: 0; color: var(--mc-midnight); font-size: 1.22rem; font-weight: 650; letter-spacing: -0.025em; }
.mission-control__sample-label { padding: 4px 8px; border-radius: 999px; background: #efecf8; color: #675b8e; font-size: 0.65rem; font-weight: 700; white-space: nowrap; }
.mission-control__pulse-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mission-account-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 11px; }
.mission-account-metric { display: flex; min-width: 0; flex-direction: column; gap: 4px; padding: 11px 13px; border: 1px solid #e7e5ed; border-radius: 12px; background: #fff; }
.mission-account-metric > span { color: #777487; font-size: 0.68rem; font-weight: 650; }
.mission-account-metric > strong { color: var(--mc-midnight); font-size: 1.24rem; font-weight: 650; letter-spacing: -0.035em; }
.mission-account-metric small { color: #898695; font-size: 0.62rem; line-height: 1.4; }
.mission-control__reporting-freshness { margin: 8px 1px 0; color: #777487; font-size: 0.68rem; }
.mission-pulse-card { display: flex; flex-direction: column; min-height: 112px; padding: 13px 16px; border: 1px solid #e7e5ed; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(28, 25, 48, 0.035); }
.mission-pulse-card__label { display: flex; align-items: center; gap: 7px; color: #777487; font-size: 0.72rem; font-weight: 650; }
.mission-control__sample-dot { color: #7767a9; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.mission-pulse-card > strong { margin: 7px 0 2px; color: var(--mc-midnight); font-size: 1.7rem; font-weight: 650; letter-spacing: -0.05em; line-height: 1.05; }
.mission-pulse-card > strong span { font-size: 1.1rem; }
.mission-pulse-card__footnote { color: #8b8998; font-size: 0.68rem; }
.mission-pulse-card__meter { height: 5px; margin: 9px 0 6px; overflow: hidden; border-radius: 999px; background: #efedf4; }
.mission-pulse-card__meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8566eb, #b7a5f5); }
.mission-pulse-card--attention { border-color: #e8defb; background: linear-gradient(145deg, #fff 30%, #f8f5ff); }
.mission-pulse-card--attention > strong { color: #765ad0; }

.mission-control__attention { display: flex; align-items: start; gap: 12px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #e7e1f4; border-radius: 14px; background: #fff; }
.mission-control__attention-icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #f3efff; color: #7459cc; }
.mission-control__attention-icon svg { width: 21px; height: 21px; }
.mission-control__attention-copy { flex: 1; min-width: 0; }
.mission-control__attention-title { display: flex; align-items: center; gap: 10px; }
.mission-control__attention-title h2 { font-size: 0.94rem; }
.mission-control__attention-copy > p { margin: 3px 0 8px; color: #777487; font-size: 0.72rem; }
.mission-control__signal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mission-control__signal-item { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto 16px; align-items: center; gap: 9px; min-width: 0; padding: 9px 10px; border: 1px solid #ece9f3; border-radius: 10px; background: #fcfbfe; color: inherit; text-decoration: none; }
.mission-control__signal-item:hover { border-color: #d4c9fa; background: #f8f6ff; color: inherit; text-decoration: none; }
.mission-control__signal-indicator { width: 7px; height: 7px; border-radius: 50%; background: #9a7fe8; }
.mission-control__signal-detail { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.mission-control__signal-detail strong { overflow: hidden; color: #514d60; font-size: 0.7rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.mission-control__signal-detail small { color: #898594; font-size: 0.62rem; }
.mission-control__signal-target { color: #817d8d; font-size: 0.6rem; white-space: nowrap; }
.mission-control__signal-arrow { color: #8d7abf; font-size: 0.88rem; text-align: center; }
.mission-control__attention-count { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #f2edff; color: #7259c7; font-size: 0.78rem; font-weight: 750; }
.mission-control__section-heading--portfolios { align-items: center; margin-bottom: 10px; }
.mission-control__new-portfolio { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; border: 1px solid #d8d0f4; border-radius: 9px; background: #fff; color: #5e4ca6; font-size: 0.78rem; font-weight: 650; text-decoration: none; }
.mission-control__new-portfolio:hover { border-color: var(--mc-violet); background: #f7f5ff; color: #514093; text-decoration: none; }
.mission-control__new-portfolio svg { width: 16px; height: 16px; }
.mission-control__new-portfolio:focus-visible, .mission-portfolio-card:focus-visible { outline: 3px solid #8566eb; outline-offset: 3px; }

.mission-metric-selector { margin: 0 0 12px; padding: 0; border: 0; }
.mission-metric-selector legend { margin-bottom: 6px; color: #777487; font-size: 0.69rem; font-weight: 600; }
.mission-metric-selector__options { display: flex; flex-wrap: wrap; gap: 8px; }
.mission-metric-selector__option { position: relative; display: inline-flex; cursor: pointer; }
.mission-metric-selector__option input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.mission-metric-selector__button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 112px; min-height: 46px; padding: 0 13px; border: 1px solid #e2e0e9; border-radius: 10px; background: #fff; color: #656273; font-size: 0.78rem; font-weight: 650; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.mission-metric-selector__button svg { width: 18px; height: 18px; }
.mission-metric-selector__option input:checked + .mission-metric-selector__button { border-color: #8566eb; background: #f2efff; color: #56439f; box-shadow: inset 0 0 0 1px rgba(133, 102, 235, 0.18); }
.mission-metric-selector__option input:focus-visible + .mission-metric-selector__button { outline: 3px solid #8566eb; outline-offset: 3px; }
.mission-portfolio-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; }
.mission-portfolio-card { display: block; min-width: 0; padding: 18px 18px 15px; border: 1px solid #e6e3ed; border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(27, 23, 46, 0.045); color: inherit; text-decoration: none; transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease; }
.mission-portfolio-card:hover { transform: translateY(-2px); border-color: #d4c9fa; box-shadow: 0 12px 27px rgba(53, 42, 96, 0.095); color: inherit; text-decoration: none; }
.mission-portfolio-card__header, .mission-portfolio-card__identity, .mission-portfolio-card__metric-row, .mission-portfolio-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mission-portfolio-card__identity { justify-content: start; min-width: 0; }
.mission-portfolio-card__glyph { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #f1eff8; color: #725eb8; }
.mission-portfolio-card__glyph svg { width: 22px; height: 22px; }
.mission-portfolio-card__name-wrap { display: flex; flex-direction: column; min-width: 0; }
.mission-portfolio-card__name { overflow: hidden; color: #232230; font-size: 0.91rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mission-portfolio-card__subline { margin-top: 2px; color: #9592a1; font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; }
.mission-portfolio-card__arrow { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f8f7fb; color: #8b7dbd; }
.mission-portfolio-card__arrow svg { width: 17px; height: 17px; }
.mission-portfolio-card__stats { display: flex; gap: 26px; margin: 17px 0 15px; padding-bottom: 14px; border-bottom: 1px solid #f0eef4; }
.mission-portfolio-card__stats > div { display: flex; align-items: baseline; gap: 6px; }
.mission-portfolio-card__stats strong { color: #333141; font-size: 0.91rem; font-weight: 700; }
.mission-portfolio-card__stats span { color: #858292; font-size: 0.66rem; }
.mission-portfolio-card__metric { min-height: 58px; }
.mission-portfolio-card__metric-heading { display: flex; align-items: center; gap: 8px; color: #777487; font-size: 0.68rem; font-weight: 650; }
.mission-portfolio-card__metric-row { justify-content: start; gap: 10px; margin-top: 2px; }
.mission-portfolio-card__metric-row strong { color: #201e2b; font-size: 1.6rem; font-weight: 650; letter-spacing: -0.05em; line-height: 1.12; }
.mission-portfolio-card__change { color: #6e5aaf; font-size: 0.66rem; font-weight: 650; }
.mission-portfolio-card__metric-context { margin: 3px 0 0; color: #898695; font-size: 0.62rem; }
.mission-portfolio-card__trend { margin: 3px 0 10px; }
.mission-portfolio-card__chart { height: 60px; }
.mission-portfolio-card__trend figcaption { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; color: #9a97a5; font-size: 0.61rem; }
.mission-portfolio-card__footer { flex-wrap: wrap; padding-top: 11px; border-top: 1px solid #f0eef4; color: #898695; font-size: 0.63rem; }
.mission-portfolio-card__coverage { display: inline-flex; align-items: center; gap: 5px; }
.mission-portfolio-card__coverage i { width: 6px; height: 6px; border-radius: 50%; background: #9a80e8; }
.mission-portfolio-card__coverage strong { color: #5e547f; font-weight: 700; }
.mission-portfolio-card__freshness { text-align: right; }
.mission-control__empty-state { display: flex; flex-direction: column; align-items: center; padding: 46px 20px; border: 1px dashed #d9d5e4; border-radius: 16px; background: #fff; text-align: center; }
.mission-control__empty-icon { color: #8566eb; font-size: 1.7rem; }
.mission-control__empty-state h3 { margin: 9px 0 4px; color: #262432; font-size: 1rem; }
.mission-control__empty-state p { margin-bottom: 14px; color: #7f7c8a; font-size: 0.8rem; }

@media (min-width: 680px) {
  .mission-portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1120px) {
  .mission-portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .mission-control__pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-account-metrics { grid-template-columns: minmax(0, 1fr); }
  .mission-control__signal-list { grid-template-columns: minmax(0, 1fr); }
  .mission-control__signal-item { grid-template-columns: 7px minmax(0, 1fr) 16px; }
  .mission-control__signal-target { display: none; }
  .app-nav { gap: 14px; padding-right: 16px; padding-left: 16px; }
  .sidebar { flex-basis: 215px; width: 215px; }
  .page-content { padding-right: 20px; padding-left: 20px; }
}
@media (max-width: 760px) {
  .app-nav { min-height: 58px; padding: 6px 12px 6px 56px; gap: 2px 14px; }
  .app-nav .app-name { min-height: 46px; }
  .app-nav__account { min-height: 44px; }
  .app-nav a:not(.app-name), .app-nav form.button_to button { padding-top: 6px; padding-bottom: 6px; }
  .sidebar-toggle-btn { top: 9px; left: 8px; z-index: 70; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(196, 181, 253, 0.35); border-radius: 10px; background: #252433; color: #fff; }
  body.sidebar-collapsed .sidebar-toggle-btn { left: 8px; }
  .app-shell { min-height: calc(100vh - 58px); }
  .sidebar { display: none; position: fixed; z-index: 60; top: 58px; bottom: 0; left: 0; width: min(84vw, 320px); max-height: none; overflow-y: auto; padding: 15px 14px 28px; border-right: 1px solid #dedbe8; background: #fff; box-shadow: 10px 0 35px rgba(21, 21, 31, 0.16); }
  body.mobile-sidebar-open .sidebar { display: block; }
  .sidebar-mobile-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 13px; color: #716d7f; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
  .sidebar-mobile-heading button { min-height: 40px; padding: 0 10px; border: 1px solid #e4e1eb; border-radius: 8px; background: #fff; color: #514d60; font: inherit; letter-spacing: 0; text-transform: none; }
  .sidebar-backdrop { position: fixed; z-index: 55; inset: 58px 0 0; display: none; width: 100%; height: calc(100% - 58px); border: 0; background: rgba(21, 21, 31, 0.38); }
  body.mobile-sidebar-open .sidebar-backdrop { display: block; }
  .page-content { padding: 24px 16px 44px; }
  .mission-control__title-row { align-items: start; flex-direction: column; }
  .mission-control__as-of { align-self: start; }
  .mission-control__attention { gap: 10px; padding: 14px 12px; }
  .mission-control__attention-icon { flex-basis: 32px; width: 32px; height: 32px; }
  .mission-control__attention-count { flex-basis: 30px; width: 30px; height: 30px; }
}
@media (max-width: 440px) {
  .page-content { padding-right: 13px; padding-left: 13px; }
  .mission-control__header { margin-bottom: 12px; }
  .mission-control h1 { font-size: 1.75rem; }
  .mission-control__prototype-note { margin-bottom: 14px; padding: 10px 11px; }
  .mission-control__prototype-note p { font-size: 0.73rem; }
  .mission-control__pulse-grid { gap: 8px; }
  .mission-pulse-card { min-height: 105px; padding: 12px 11px; }
  .mission-pulse-card > strong { font-size: 1.48rem; }
  .mission-control__section-heading--portfolios { align-items: start; }
  .mission-control__new-portfolio { padding: 0 10px; font-size: 0.7rem; }
  .mission-metric-selector__options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mission-metric-selector__button { min-width: 0; width: 100%; min-height: 48px; padding: 0 6px; gap: 5px; font-size: 0.68rem; }
  .mission-metric-selector__button svg { width: 16px; height: 16px; }
  .mission-portfolio-card { padding: 15px 14px 13px; }
  .mission-control__signal-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mission-control__signal-item { grid-template-columns: 7px minmax(0, 1fr) 16px; }
  .mission-control__signal-target { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mission-portfolio-card, .mission-metric-selector__button { transition: none; }
}

/* ── Portfolio detail dashboard (pd-*) ───────────────────────────────────
   Same tokens as Mission Control (.mission-control): midnight text, #e7e5ed
   borders, 14–16px radii, soft violet-tinted shadows, violet #8566eb accents.
   The page uses the full workspace instead of the 1100px reading column. */
.page-content:has(> .pd) { max-width: 1480px; }
.pd { --pd-ink: #15151f; --pd-violet: #8566eb; --pd-line: #e7e5ed; color: var(--pd-ink); }
.pd h1, .pd h2, .pd h3, .pd p { margin: 0; }
.pd-kicker { margin: 0 0 3px; color: #8566eb; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

.pd-crumbs { margin-bottom: 12px; }
.pd-crumbs__link { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; color: #6e6a80; font-size: 0.78rem; font-weight: 600; }
.pd-crumbs__link:hover { color: #5e4ca6; text-decoration: none; }
.pd-crumbs__link svg { width: 15px; height: 15px; }

.pd-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; padding: 22px 26px; overflow: hidden; border: 1px solid var(--pd-line); border-radius: 18px; background: radial-gradient(120% 160% at 100% 0%, #f3efff 0%, rgba(243, 239, 255, 0) 55%), #fff; box-shadow: 0 7px 22px rgba(27, 23, 46, 0.045); }
.pd-header__identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.pd-header__glyph { display: grid; flex: 0 0 60px; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: #15151f; color: #c4b5fd; box-shadow: 0 8px 18px rgba(21, 21, 31, 0.18); }
.pd-header__glyph svg { width: 32px; height: 32px; }
.pd-header__copy { min-width: 0; }
.pd .pd-header h1 { color: var(--pd-ink); font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 650; letter-spacing: -0.045em; line-height: 1.12; }
.pd-header__description { max-width: 62ch; margin-top: 4px !important; color: #696779; font-size: 0.95rem; }
.pd-header__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.pd-header__chips li { padding: 5px 11px; border: 1px solid #e5e3ed; border-radius: 999px; background: #fff; color: #6a677a; font-size: 0.74rem; }
.pd-header__chips strong { color: var(--pd-ink); font-weight: 700; }
.pd-header__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.pd-header__delete { display: inline-flex !important; margin: 0; }

.pd .pd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: 0.8rem; font-weight: 650; line-height: 1; text-decoration: none; cursor: pointer; transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease; }
.pd-btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.pd .pd-btn:hover { text-decoration: none; }
.pd-btn:focus-visible, .pd-select:focus-visible, .pd-property:focus-visible { outline: 3px solid #8566eb; outline-offset: 3px; }
.pd .pd-btn--primary { background: #8566eb; color: #fff; box-shadow: 0 6px 14px rgba(133, 102, 235, 0.28); }
.pd .pd-btn--primary:hover { background: #7656dc; color: #fff; }
.pd .pd-btn--secondary { border-color: #d8d0f4; background: #fff; color: #5e4ca6; }
.pd .pd-btn--secondary:hover { border-color: #8566eb; background: #f7f5ff; color: #514093; }
.pd .pd-btn--danger { border-color: #ecd9de; background: #fff; color: #b0384f; text-decoration: none; }
.pd .pd-btn--danger:hover { border-color: #d98a99; background: #fff6f7; color: #9a2c42; }
.pd .pd-btn--ghost { min-height: 38px; padding: 0 12px; border-color: #e4e0f0; background: #fff; color: #5e4ca6; }
.pd .pd-btn--ghost:hover { border-color: #8566eb; background: #f7f5ff; color: #514093; }

.pd-section { margin-bottom: 28px; }
.pd-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.pd .pd-section h2 { margin: 0; color: var(--pd-ink); font-size: 1.22rem; font-weight: 650; letter-spacing: -0.025em; }
.pd-count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: #f2edff; color: #7259c7; font-size: 0.7rem; font-weight: 750; letter-spacing: 0; vertical-align: 2px; }

/* KPI cards — Mission Control's pulse-card, in a 6-up row */
.pd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pd-kpi { display: flex; flex-direction: column; min-height: 118px; padding: 14px 18px; border: 1px solid var(--pd-line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(28, 25, 48, 0.035); }
.pd-kpi--accent { border-color: #e8defb; background: linear-gradient(145deg, #fff 30%, #f8f5ff); }
.pd .pd-kpi__label { color: #777487; font-size: 0.72rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.pd .pd-kpi__value { margin: 8px 0 3px; color: var(--pd-ink); font-size: 1.7rem; font-weight: 650; letter-spacing: -0.05em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pd-kpi--accent .pd-kpi__value { color: #765ad0; }
.pd .pd-kpi__value--negative { color: #b0384f; }
.pd-kpi__foot { margin-top: auto; color: #8b8998; font-size: 0.68rem; }
.pd-kpi__meter { display: block; height: 5px; margin: auto 0 4px; overflow: hidden; border-radius: 999px; background: #efedf4; }
.pd-kpi__meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8566eb, #b7a5f5); }

/* Chart panels */
.pd-charts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }
.pd-charts > .pd-panel:only-child { grid-column: 1 / -1; }
.pd-panel { min-width: 0; padding: 18px 20px 16px; border: 1px solid #e6e3ed; border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(27, 23, 46, 0.045); }
.pd-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pd .pd-panel__title { color: #232230; font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.pd .pd-panel__sub { margin-top: 2px; color: #9592a1; font-size: 0.7rem; }
.pd .pd-select { flex: 0 0 auto; width: auto; min-width: 132px; min-height: 40px; padding: 0 34px 0 12px; border: 1px solid #e2e0e9; border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238566eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; color: #56439f; font: inherit; font-size: 0.78rem; font-weight: 650; appearance: none; cursor: pointer; }
.pd .pd-select:hover { border-color: #8566eb; background-color: #f7f5ff; }
.pd-chart { position: relative; height: 320px; }

/* Property table */
.pd-table-panel { padding: 0; overflow: hidden; }
.pd-table-scroll { overflow-x: auto; }
.pd-table { width: 100%; min-width: 720px; margin: 0; border-collapse: collapse; border-radius: 0; background: #fff; box-shadow: none; }
.pd-table thead th { padding: 13px 20px; border-bottom: 1px solid #eeebf4; background: #faf9fc; color: #8a8697; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.pd-table tbody td { padding: 14px 20px; border-bottom: 1px solid #f1eff6; color: #3a3849; font-size: 0.84rem; }
.pd-table tbody tr:hover { background: #faf8ff; }
.pd-table tbody tr:last-child td { border-bottom: 0; }
.pd-table .pd-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-table td.pd-num { font-weight: 600; color: #232230; }
.pd-table td.pd-num--negative { color: #b0384f; }
.pd-table__actions { width: 1%; text-align: right; white-space: nowrap; }
.pd-property { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: #232230; font-weight: 700; text-decoration: none; }
.pd-property:hover { color: #5e4ca6; text-decoration: none; }
.pd-property__glyph { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #f1eff8; color: #725eb8; font-size: 0.82rem; font-weight: 750; }
.pd-property__name { overflow: hidden; text-overflow: ellipsis; }
.pd-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #f2edff; color: #6347bd; font-size: 0.7rem; font-weight: 700; }
.pd-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pd-status--inactive { background: #f1f0f5; color: #6e6b7c; }
.pd-status--disposed { background: #f6eef0; color: #9a4a5b; }
.pd-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pd-empty { margin-top: 0; }

@media (max-width: 1100px) {
  .pd-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .pd-header { flex-direction: column; align-items: flex-start; padding: 18px 16px; }
  .pd-header__actions { justify-content: flex-start; width: 100%; }
  .pd-header__glyph { flex-basis: 48px; width: 48px; height: 48px; }
  .pd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pd-kpi { min-height: 108px; padding: 12px 12px; }
  .pd .pd-kpi__value { font-size: 1.28rem; }
  .pd-panel { padding: 14px 13px; }
  .pd-chart { height: 260px; }
  .pd-table { min-width: 0; }
  .pd-table thead { display: none; }
  .pd-table, .pd-table tbody { display: block; }
  .pd-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; padding: 14px; border-bottom: 1px solid #f1eff6; }
  .pd-table tbody tr:last-child { border-bottom: 0; }
  .pd-table tbody td { display: block; padding: 0; border: 0; text-align: left; }
  .pd-table tbody td.pd-table__name { grid-column: 1 / -1; }
  .pd-table tbody td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: #8a8697; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  .pd-table tbody td.pd-num { text-align: left; }
  .pd-table tbody td.pd-table__actions { grid-column: 1 / -1; width: auto; text-align: left; }
  .pd .pd-table__actions .pd-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pd .pd-btn { transition: none; }
}

/* ── Property pages (pd-prop) ─────────────────────────────────────────────
   Every property screen opens with _property_header; that wrapper also turns
   the full-width workspace on for the whole screen. */
.page-content:has(.pd-prop) { max-width: 1480px; }
.pd-crumbs--trail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 12px; font-size: 0.78rem; }
.pd-crumbs--trail .pd-crumbs__link { min-height: 28px; }
.pd-crumbs__sep { color: #bdb9cb; }
.pd-crumbs__current { color: #3a3849; font-weight: 650; }
.pd-header--property { margin-bottom: 16px; }
.pd-header--property .pd-header__chips li { display: inline-flex; align-items: center; gap: 4px; }
.pd-header--property .pd-header__chips li:has(.pd-status) { padding: 3px 4px 3px 4px; border-color: transparent; background: transparent; }

/* Tab bar — a segmented control in Mission Control's selector style */
.property-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; border: 0; }
.property-tab { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 0 16px; border: 1px solid #e2e0e9; border-radius: 10px; background: #fff; color: #656273; font-size: 0.8rem; font-weight: 650; text-decoration: none; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.property-tab:hover { border-color: #cfc6f2; background: #faf8ff; color: #56439f; text-decoration: none; }
.property-tab.active { border-color: #8566eb; background: #f2efff; color: #56439f; box-shadow: inset 0 0 0 1px rgba(133, 102, 235, 0.18); }
.property-tab:focus-visible { outline: 3px solid #8566eb; outline-offset: 3px; }

/* Overview pieces */
.pd-alert { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 13px 16px; border: 1px solid #e7e1f4; border-radius: 14px; background: #fff; }
.pd-alert__icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #f3efff; color: #7459cc; }
.pd-alert__icon svg { width: 21px; height: 21px; }
.pd-alert__copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 1px; }
.pd-alert__copy strong { color: var(--pd-ink); font-size: 0.9rem; }
.pd-alert__copy span { color: #777487; font-size: 0.74rem; }
.pd-kpis--compact { grid-template-columns: repeat(auto-fit, minmax(220px, 280px)); }
.pd .pd-kpi__value--good { color: #2f8f7b; }
.pd .pd-kpi__value--warn { color: #b7791f; }
.pd .pd-kpi__value--bad  { color: #b0384f; }
.pd-charts--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-chart--short { height: 260px; }
.pd-note { margin-top: 8px !important; color: #9592a1; font-size: 0.72rem; }
.pd-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; }
.pd-split--single { grid-template-columns: minmax(0, 1fr); }
.pd-occ { margin-bottom: 18px; }
.pd-occ__hero { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.pd .pd-occ__value { font-size: 2.3rem; font-weight: 650; letter-spacing: -0.05em; line-height: 1; }
.pd-occ__hero span { color: #777487; font-size: 0.78rem; font-weight: 650; }
.pd-occ__value--good { color: #2f8f7b; } .pd-occ__value--warn { color: #b7791f; } .pd-occ__value--bad { color: #b0384f; }
.pd-occ__bar { height: 8px; overflow: hidden; border-radius: 999px; background: #efedf4; }
.pd-occ__fill { display: block; height: 100%; border-radius: inherit; }
.pd-occ__fill--good { background: linear-gradient(90deg, #2f8f7b, #6cc1ae); }
.pd-occ__fill--warn { background: linear-gradient(90deg, #b7791f, #e0b25e); }
.pd-occ__fill--bad  { background: linear-gradient(90deg, #b0384f, #dc7f91); }
.pd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; margin: 0; padding-top: 16px; border-top: 1px solid #f0eef4; }
.pd-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-stat__value { color: #232230; font-size: 1.1rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pd-stat__label { color: #858292; font-size: 0.68rem; font-weight: 600; }
.pd-stat__value.pd-stat__bad { color: #b0384f; }
.pd-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-badge { display: flex; min-width: 96px; flex-direction: column; gap: 3px; padding: 12px 16px; border: 1px solid transparent; border-radius: 12px; }
.pd-badge strong { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1; }
.pd-badge span { font-size: 0.7rem; font-weight: 650; }
.pd-badge--bad  { border-color: #f0d6dc; background: #fbf0f2; color: #a23048; }
.pd-badge--warn { border-color: #efe0c0; background: #fcf6e8; color: #94610f; }
.pd-badge--ok   { border-color: #e1daf8; background: #f5f2ff; color: #5e4ca6; }
.pd-section .pd-section__heading .pd-btn { min-height: 38px; }

@media (max-width: 1100px) {
  .pd-charts--even, .pd-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .property-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .property-tab { flex: 0 0 auto; }
  .pd-alert { flex-wrap: wrap; }
  .pd-chart--short { height: 220px; }
}
.pd .pd-btn--disabled { border-color: #e6e3ed; background: #f4f3f8; color: #a09cae; cursor: not-allowed; box-shadow: none; }
.pd-header__period { display: inline-flex; gap: 8px; margin: 0; }
.pd-header__period > div { margin: 0; }

/* Inside property screens, the legacy blue submit buttons and links take the violet accent. */
.page-content:has(.pd-prop) :is(button[type="submit"], input[type="submit"], .btn, .btn-primary):not(.pd-btn) { background: #8566eb; border-radius: 9px; }
.page-content:has(.pd-prop) :is(button[type="submit"], input[type="submit"], .btn, .btn-primary):not(.pd-btn):hover { background: #7656dc; }
.page-content:has(.pd-prop) a:not(.pd-btn):not(.property-tab):not(.pd-crumbs__link):not(.pd-property):not(.sn-btn):not(.sn-flag) { color: #5e4ca6; }
.page-content:has(.pd-prop) input:focus, .page-content:has(.pd-prop) select:focus, .page-content:has(.pd-prop) textarea:focus { border-color: #8566eb; box-shadow: 0 0 0 3px rgba(133, 102, 235, 0.16); }

/* ── Mission Control, compact: cards first, one summary strip above them ── */
.page-content:has(> .mc--compact) { max-width: 1480px; }
.mc--compact { max-width: none; }
.mc--compact .mission-control__header { margin-bottom: 14px; }
.mc-universe { display: block; margin-top: 2px; color: #8b8998; font-size: 0.74rem; }
.mc-universe span { color: #a8a5b4; }
.mc-asof { position: relative; align-self: flex-end; }
.mc-asof > summary { list-style: none; cursor: pointer; }
.mc-asof > summary::-webkit-details-marker { display: none; }
.mc-asof > summary svg { width: 14px; height: 14px; margin-left: 2px; color: #8b7dbd; transition: transform 120ms ease; }
.mc-asof[open] > summary svg { transform: rotate(180deg); }
.mc-asof__panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(360px, 86vw); margin: 0; padding: 12px 14px; border: 1px solid #e5e3ed; border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgba(27, 23, 46, 0.12); color: #555366; font-size: 0.74rem; line-height: 1.5; }

.mc-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1.25fr)) minmax(0, 0.8fr) minmax(0, 0.9fr); gap: 10px; margin-bottom: 20px; }
.mc-strip__cell { display: flex; min-width: 0; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid #e7e5ed; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(28, 25, 48, 0.035); color: inherit; text-decoration: none; }
.mc-strip__cell > span { color: #777487; font-size: 0.68rem; font-weight: 650; }
.mc-strip__cell > strong { color: var(--mc-midnight, #15151f); font-size: 1.3rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1.15; }
.mc-strip__cell > strong i { color: #8b8998; font-size: 0.95rem; font-style: normal; }
.mc-strip__cell small { color: #898695; font-size: 0.62rem; line-height: 1.4; }
.mc-strip .mission-account-metric { gap: 3px; padding: 12px 14px; }
.mc-strip__cell--attention { border-color: #d9ccfa; background: linear-gradient(145deg, #fff 20%, #f3efff); }
.mc-strip__cell--attention > strong { color: #6a4fc4; }
a.mc-strip__cell--attention:hover { border-color: #8566eb; text-decoration: none; color: inherit; }
.mc-strip__cell--attention.is-clear { border-color: #e7e5ed; background: #fff; }
.mc-strip__cell--attention.is-clear > strong { color: #8b8998; }
.mc-strip__cell--attention:focus-visible { outline: 3px solid #8566eb; outline-offset: 3px; }

.mc-portfolios-head { align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.mc-portfolios-head__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mc-portfolios-head__controls .mission-metric-selector { margin: 0; }
.mc--compact .mission-control__attention { margin-top: 20px; }

@media (min-width: 1500px) {
  .mc--compact .mission-portfolio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .mc-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .mc-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mc-asof { align-self: flex-start; }
  .mc-asof__panel { right: auto; left: 0; }
}

/* ── Financials: snapshot cards (sn-*) ───────────────────────────────────
   Same card, tile, chip and button language as the portfolio and Overview
   pages. Markup hooks the tests rely on (.metric-label/.metric-value spans,
   the responsive grid classes) are kept; only the presentation changes. */
.sn-card { margin-bottom: 16px; padding: 18px 20px 16px; border: 1px solid #e6e3ed; border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(27, 23, 46, 0.045); }
.sn-card__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.sn-card__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.pd .sn-card__period { color: #232230; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.pd .sn-card__sub { margin: -6px 0 14px; color: #9592a1; font-size: 0.74rem; }
.sn-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.sn-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.sn-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sn-status--complete { background: #e8f5f1; color: #2a7d6b; }
.sn-status--draft { background: #fcf6e8; color: #94610f; }
.sn-status--archived { background: #f1f0f5; color: #6e6b7c; }
.sn-flag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #fbf0f2; color: #a23048; font-size: 0.7rem; font-weight: 700; text-decoration: none; }
.sn-flag:hover { background: #f6e2e7; text-decoration: none; }

.sn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 13px; border: 1px solid #ddd6f6; border-radius: 9px; background: #fff; color: #5e4ca6; font: inherit; font-size: 0.76rem; font-weight: 650; line-height: 1; text-decoration: none; cursor: pointer; transition: background 120ms ease, border-color 120ms ease; }
.sn-btn:hover { border-color: #8566eb; background: #f7f5ff; color: #514093; text-decoration: none; }
.sn-btn--solid { border-color: #8566eb; background: #8566eb; color: #fff; box-shadow: 0 5px 12px rgba(133, 102, 235, 0.22); }
.sn-btn--solid:hover { border-color: #7656dc; background: #7656dc; color: #fff; }
.sn-btn:focus-visible, .sn-flag:focus-visible { outline: 3px solid #8566eb; outline-offset: 3px; }
form.button_to .sn-btn--solid, .sn-timeline form.button_to button.sn-btn { text-decoration: none; }

/* KPI tiles */
.sn-card .sn-metrics { gap: 10px; }
.sn-card .metric-card { flex: none; gap: 5px; padding: 12px 14px; border: 1px solid #eeebf4; border-radius: 12px; background: #faf9fc; }
.sn-card .metric-label { color: #777487; font-size: 0.68rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.sn-card .metric-value { color: #15151f; font-size: 1.3rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sn-card .metric-positive .metric-value { color: #2f8f7b; }
.sn-card .metric-negative .metric-value { color: #b0384f; }
.sn-card .metric-accent { border-color: #e8defb; background: linear-gradient(145deg, #fff 30%, #f8f5ff); }
.sn-card .metric-accent .metric-value { color: #765ad0; }
.sn-card .metric-muted .metric-value { color: #a09cae; }

/* Documents chips */
.sn-docs { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0eef4; }
.sn-kicker { margin: 0 0 8px; color: #8566eb; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.pd .sn-kicker { margin: 0 0 8px; color: #8566eb; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.sn-docs__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sn-chip { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid #e4e1eb; border-radius: 999px; color: #8b8998; font-size: 0.7rem; font-weight: 600; }
.sn-chip--on { border-color: #d9ccfa; background: #f3efff; color: #5e4ca6; }
.sn-chip--on::before { content: "✓"; margin-right: 5px; font-size: 0.62rem; }

/* Loan row inside the card */
.sn-loan { display: block; margin-top: 14px; }
.sn-loan__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.8rem; }
.sn-loan__row--panel { padding: 8px 8px 8px 14px; border: 1px solid #eeebf4; border-radius: 12px; background: #faf9fc; }
.sn-loan__summary { display: flex; align-items: center; gap: 12px; color: #3a3849; }
.sn-loan__label { color: #232230; font-weight: 700; }
.sn-loan__muted { color: #9592a1; }
.sn-card .loan-toggle-track--on { background: #8566eb; }
.sn-note { margin-top: 8px; padding: 9px 13px; border: 1px solid #efe0c0; border-radius: 10px; background: #fcf6e8; color: #94610f; font-size: 0.78rem; }
.sn-card .new-line-item-form { margin-top: 10px; padding: 12px; border: 1px solid #eeebf4; border-radius: 12px; background: #faf9fc; }
.sn-card .amount-input, .sn-card .label-input { min-height: 38px; padding: 0 12px; border: 1px solid #e2e0e9; border-radius: 9px; background: #fff; font: inherit; font-size: 0.82rem; }
.sn-card .amount-input:focus, .sn-card .label-input:focus { outline: none; border-color: #8566eb; box-shadow: 0 0 0 3px rgba(133, 102, 235, 0.16); }
.sn-card .btn-save { min-height: 38px; padding: 0 16px; border-radius: 9px; background: #8566eb; font-weight: 650; }
.sn-card .btn-save:hover { background: #7656dc; }
.sn-card .cancel-link { color: #7a768a; font-weight: 600; }

/* Strip and lists around the cards */
.sn-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; padding: 14px 18px; border: 1px dashed #d4c9fa; border-radius: 14px; background: #faf8ff; color: #3a3849; font-size: 0.84rem; }
.sn-orphans, .sn-timeline { margin-top: 28px; }
.sn-orphans__list { margin: 0; padding: 0; overflow: hidden; border: 1px solid #e6e3ed; border-radius: 14px; background: #fff; list-style: none; }
.sn-orphans__list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border-bottom: 1px solid #f1eff6; font-size: 0.84rem; }
.sn-orphans__list li:last-child { border-bottom: 0; }
.pd .sn-orphans__note { margin-top: 8px; color: #9592a1; font-size: 0.74rem; }

@media (max-width: 760px) {
  .sn-card { padding: 14px 13px; }
  .sn-card__actions { width: 100%; }
  .sn-card .metric-value { font-size: 1.1rem; }
}

/* ── Rent Roll body (.rr) ─────────────────────────────────────── */
.rr { padding-top: 0; }
.rr .pd-panel + .pd-panel, .rr .rr-top { margin-bottom: 20px; }
.rr .rr-top { display: flex; gap: 16px; align-items: stretch; }
.rr .rr-leases { flex: 0 0 250px; }
.rr .rr-forecast { flex: 1; min-width: 0; }
.rr .rr-title { margin: 0 0 14px; color: #6f6b80; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.rr .rr-note { margin: 8px 0 0; color: #9a97a8; font-size: 0.72rem; }
.rr .snapshot-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; padding: 4px; border: 1px solid #e6e3ed; border-radius: 999px; background: #fff; }
.rr .snapshot-tab { margin: 0; padding: 6px 14px; border: 0; border-radius: 999px; color: #6f6b80; font-size: 0.8rem; font-weight: 600; }
.rr .snapshot-tab:hover { background: #f5f2ff; color: #5b43b8; }
.rr .snapshot-tab.active { background: #8566eb; color: #fff; }
.rr .summary-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin: 0 0 20px; }
.rr .metric-card { flex: none; gap: 5px; min-height: 92px; padding: 14px 16px; border: 1px solid #e6e3ed; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(28, 25, 48, 0.035); }
.rr .metric-label { color: #777487; font-size: 0.7rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.rr .metric-value { color: #15151f; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rr .metric-card .text-xs { color: #9a97a8; font-size: 0.68rem; }
.rr .rr-chronic { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding: 12px 18px; border: 1px solid #f1dcae; border-radius: 14px; background: #fffaf0; color: #5e4a1c; font-size: 0.85rem; }
.rr .rr-chronic__link { color: #765ad0; font-weight: 650; white-space: nowrap; }
.rr .rr-table-panel { margin-bottom: 24px; }
.rr .line-items-table { min-width: 960px; margin: 0; }
.rr .line-items-table th { padding: 13px 16px; border-bottom: 1px solid #eeebf4; background: #faf9fc; color: #8a8697; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; white-space: nowrap; }
.rr .line-items-table td { padding: 12px 16px; border-bottom: 1px solid #f1eff6; color: #3a3849; font-size: 0.84rem; }
.rr .line-items-table tbody tr:hover { background: #faf8ff; }
.rr .line-items-table tbody tr:last-child td { border-bottom: 0; }
.rr .sortable-th.active { color: #765ad0; }
.rr .rr-clone__form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rr .rr-clone p { margin: 0 0 12px; color: #777487; font-size: 0.85rem; }
.rr .rr-clone input[type="date"] { padding: 6px 10px; border: 1px solid #ddd9e8; border-radius: 10px; }
.rr .rr-empty { color: #777487; }
.rr .rr-empty p { margin: 0 0 8px; }
@media (max-width: 760px) {
  .rr .rr-top { flex-direction: column; }
  .rr .rr-leases { flex-basis: auto; }
}

/* ── Month End Report body (.mer) ─────────────────────────────── */
.mer .mer-sources { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.mer .mer-sources span.mer-source { margin: 0; padding: 4px 11px; border: 1px solid #e6e3ed; border-radius: 999px; background: #fff; color: #6f6b80; font-size: 0.72rem; white-space: normal; }
.mer .mer-grid { gap: 20px; margin-bottom: 20px; align-items: start; }
.mer .mer-panel, .mer .mer-full { min-width: 0; padding: 18px 20px 14px; border: 1px solid #e6e3ed; border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(27, 23, 46, 0.045); }
.mer .mer-full { margin-bottom: 20px; }
.mer .mer-section-title { margin: 0 0 12px; color: #6f6b80; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; }
.mer .mer-col-label { color: #9a97a8; }
.mer .mer-table { border: 0; border-radius: 0; font-size: 0.85rem; }
.mer .mer-table thead th { padding: 8px 10px; border-bottom: 1px solid #eeebf4; background: transparent; color: #8a8697; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; }
.mer .mer-table tbody td { padding: 9px 10px; border-bottom: 1px solid #f1eff6; color: #3a3849; }
.mer .mer-num-col { font-weight: 600; color: #232230; }
.mer .mer-table thead .mer-num-col { font-weight: 700; color: #8a8697; }
.mer .mer-subtotal td { border-top: 0; border-bottom: 1px solid #e6e0f7; background: #f8f5ff; color: #4d3a9c; font-weight: 700; }
.mer .mer-empty { color: #cbc8d6; }
.mer .mer-tag { color: #9a97a8; }
.mer .mer-asof-flag { border-radius: 999px; background: #fdf1d4; color: #8a5a0a; padding: 1px 8px; }
.mer .draft-meta { color: #8a8697; font-size: 0.78rem; }
.mer .inline-rate-input { border-color: #ddd9e8; border-radius: 8px; background: #faf9fc; }
.mer .inline-rate-input:hover { border-color: #8566eb; }
.mer [data-testid="integrity-panel"] { margin-top: 0 !important; }
@media (max-width: 900px) { .mer .mer-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .mer .mer-panel, .mer .mer-full { overflow-x: auto; } }
.rr .rr-top { align-items: flex-start; }
.rr a.snapshot-tab.active, .rr a.snapshot-tab.active:hover { background: #8566eb; color: #fff; }
.rr .line-items-table td { white-space: nowrap; }
.rr .line-items-table td:nth-child(5) { white-space: normal; min-width: 130px; }
.rr .line-items-table th a.sortable-th { color: inherit; }
.rr .line-items-table th a.sortable-th.active { color: #765ad0; }
.rr a.snapshot-tab.active, .rr a.snapshot-tab.active:hover { color: #fff !important; }
.rr .line-items-table th { color: #8a8697 !important; }
.rr .line-items-table th .sortable-th.active { color: #765ad0 !important; }

/* ── Expense Timeline (.tl-*) ─────────────────────────────────── */
.sn-timeline__head { margin-bottom: 12px; }
.sn-timeline .tl-note, .sn-timeline .tl-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 12px 18px; border: 1px solid #e6e3ed; border-radius: 14px; background: #fff; color: #3a3849; font-size: 0.85rem; }
.sn-timeline .tl-note--stop, .sn-timeline .tl-banner--stop { border-color: #f0c4cd; background: #fdf3f5; }
.sn-timeline .tl-note--ok { border-color: #bfe3d9; background: #f1faf7; }
.sn-timeline .tl-banner--review { border-color: #f1dcae; background: #fffaf0; }
.sn-timeline .tl-banner__stop { color: #b0384f; font-weight: 650; }
.sn-timeline a.tl-banner__link { padding: 6px 14px; border-radius: 10px; background: #8566eb; color: #fff; font-size: 0.8rem; font-weight: 650; }
.sn-timeline a.tl-banner__link:hover { background: #765ad0; }
.sn-timeline .tl-extend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sn-timeline .tl-empty { color: #777487; font-size: 0.85rem; }
.sn-timeline .tl-panel { margin-bottom: 16px; }
.sn-timeline .tl-scroll { overflow-x: auto; }
.sn-timeline .tl-table { width: max-content; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; background: #fff; border: 0; font-size: 0.82rem; }
.sn-timeline .tl-table th, .sn-timeline .tl-table td { padding: 10px 14px; border-bottom: 1px solid #f1eff6; white-space: nowrap; }
.sn-timeline .tl-table thead th { background: #faf9fc; color: #8a8697; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; border-bottom: 1px solid #eeebf4; }
.sn-timeline .tl-month { min-width: 92px; text-align: right; }
.sn-timeline .tl-month--sub { padding-top: 0 !important; padding-bottom: 8px !important; font-size: 0.64rem; letter-spacing: 0; text-transform: none; }
.sn-timeline .tl-sticky { position: sticky; left: 0; z-index: 2; min-width: 210px; text-align: left; border-right: 1px solid #eeebf4; }
.sn-timeline .tl-corner { background: #faf9fc; }
.sn-timeline .tl-corner--sub { padding-top: 0 !important; }
.sn-timeline .tl-label { background: #fff; color: #3a3849; font-weight: 550; }
.sn-timeline .tl-cell { text-align: right; color: #232230; font-variant-numeric: tabular-nums; font-weight: 550; }
.sn-timeline .tl-table tbody tr:hover td { background: #faf8ff; }
.sn-timeline .tl-table tbody tr:last-child td { border-bottom: 0; }
.sn-timeline .tl-cell[data-severity="note"] { background: #f5f2ff !important; }
.sn-timeline .tl-cell[data-severity="review"] { background: #fff6e0 !important; }
.sn-timeline .tl-cell[data-severity="stop"] { background: #fdeef1 !important; }
.sn-timeline .tl-none { color: #cbc8d6; }
.sn-timeline .tl-verified { color: #2f8f7b; font-weight: 650; }
.sn-timeline .tl-pending { color: #9a97a8; font-weight: 600; }
.sn-timeline .tl-dot { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 999px; vertical-align: middle; }
.tl-drawer { padding: 4px 2px; }
.tl-drawer__title { margin: 0 0 4px; color: #15151f; font-size: 1rem; font-weight: 650; }
.tl-drawer__progress { margin: 0 0 10px; color: #777487; font-size: 0.75rem; }
.tl-flags { margin: 0; padding: 0; list-style: none; }
.tl-flag { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid #eeebf4; }
.tl-flag__label { margin-left: 8px; color: #232230; font-weight: 650; }
.tl-flag__month { color: #777487; }
.tl-flag__delta { margin-top: 4px; color: #777487; font-size: 0.75rem; }
.tl-flag__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-flag form { margin: 0; }
.tl-action, .tl-flag form button.tl-action { display: inline-flex; align-items: center; padding: 6px 14px; border: 1px solid #ddd9e8; border-radius: 10px; background: #fff; color: #5b43b8; font-size: 0.8rem; font-weight: 650; cursor: pointer; }
.tl-action:hover { background: #f5f2ff; }
.tl-action--off, .tl-action--off:hover { background: #faf9fc; color: #a09cae; cursor: not-allowed; }
