/* ============================================================
   COMPONENTS.CSS — panels, cards, badges, buttons, forms, tables
   ============================================================ */

/* ── Buttons — iOS filled, sentence case, press scale ────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 34px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.006em;
  text-transform: none;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition),
              transform 120ms var(--ease-ios);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

/* Primary = midnight fill, white text */
.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--midnight-deep);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .btn-primary {
  background: var(--accent-2);
  color: #FFFFFF;
}
[data-theme="dark"] .btn-primary:hover { background: var(--cobalt-bright); }

/* Secondary = iOS gray fill */
.btn-secondary {
  background: var(--bg-highlight);
  color: var(--text-primary);
  border-color: transparent;
}
.btn-secondary:hover {
  background: var(--border-subtle);
}

.btn-navy {
  background: var(--blue-dim);
  color: var(--accent-2);
  border-color: transparent;
}
.btn-navy:hover { background: var(--blue-glow); }

.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border-color: transparent;
}
.btn-success:hover { filter: brightness(0.97); }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover { filter: brightness(0.97); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-highlight); }

.btn-sm {
  height: 28px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  height: 42px;
  padding: 0 var(--space-6);
  font-size: var(--text-md);
  border-radius: var(--radius-md);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* AI generate button — cobalt tinted fill + ✦ */
.btn-ai {
  background: var(--blue-dim);
  color: var(--accent-2);
  border: none;
  position: relative;
  font-weight: 600;
}
.btn-ai::before {
  content: '✦';
  font-size: 12px;
  margin-right: 4px;
  color: var(--accent-2);
}
.btn-ai:hover {
  background: var(--blue-glow);
  color: var(--cobalt-bright);
}

/* ── Cards / Panels — iOS soft elevation ─────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-md), transform var(--transition-md);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-3);
}

.card-title {
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.012em;
  text-transform: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-body { padding: var(--space-5); }

.card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
}

/* Metric / KPI card — iOS stat tile, hairline accent kept for scanning */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-md), transform var(--transition-md);
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-2), transparent);
  opacity: 0.85;
}

.metric-card.office::before   { background: linear-gradient(90deg, var(--office-accent), transparent); }
.metric-card.industrial::before { background: linear-gradient(90deg, var(--industrial-accent), transparent); }
.metric-card.retail::before   { background: linear-gradient(90deg, var(--retail-accent), transparent); }
.metric-card.multifamily::before { background: linear-gradient(90deg, var(--multifamily-accent), transparent); }
.metric-card.success::before  { background: linear-gradient(90deg, var(--success), transparent); }
.metric-card.warning::before  { background: linear-gradient(90deg, var(--warning), transparent); }
.metric-card.danger::before   { background: linear-gradient(90deg, var(--danger), transparent); }
.metric-card.primary::before  { background: linear-gradient(90deg, var(--brass), transparent); }
.metric-card.info::before     { background: linear-gradient(90deg, var(--info), transparent); }

.metric-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: -0.006em;
  font-weight: 500;
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--font-display);
  /* Shrink to fit narrow tiles so long figures (e.g. $3,052,300) never clip. */
  font-size: clamp(17px, 2vw, 30px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 6px;
  font-feature-settings: 'tnum';
  overflow-wrap: anywhere;
}

/* Animated gradient color-shift on dashboard KPI figures (Jake 2026-06-13).
   Each tile passes its accent via --kpi-c; the figure shifts within that hue. */
.kpi-figure { color: var(--kpi-c, var(--accent)); } /* solid fallback — number always visible */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .kpi-figure {
    background-image: linear-gradient(
      100deg,
      var(--kpi-c, var(--accent)) 0%,
      color-mix(in srgb, var(--kpi-c, var(--accent)) 45%, #ffffff) 50%,
      var(--kpi-c, var(--accent)) 100%
    );
    background-size: 100% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* static gradient — no animation (Jake 2026-06-28) */
  }
}
@keyframes kpiShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi-figure { animation: none; }
}

/* Asset-class Market Snapshot boxes: lift on hover (they open a zoom detail). */
.asset-snapshot-box { transition: box-shadow var(--transition-md, .2s), transform var(--transition-md, .2s); }
.asset-snapshot-box:hover { box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.12)); transform: translateY(-2px); }

/* Data-import drop zone (Research + CRM "Import your data"). */
.datadrop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.datadrop-zone:hover { border-color: var(--blue-accent); }
.datadrop-zone.over { border-color: var(--blue-accent); background: rgba(59,111,224,.06); }

/* Document Center Files drop zone (Task 5) — same look as .datadrop-zone. */
.doc-files-drop {
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.doc-files-drop:hover { border-color: var(--blue-accent); }
.doc-files-drop.over { border-color: var(--blue-accent); background: rgba(59,111,224,.06); }

/* Agent dispatch status badges (Agents tab). */
.agent-status { display:inline-flex; align-items:center; gap:5px; font-size:10px; font-weight:600;
  text-transform:uppercase; letter-spacing:.04em; padding:2px 7px; border-radius:99px; margin-top:5px;
  border:1px solid var(--border-color); color:var(--text-muted); background:var(--bg-elevated); }
.agent-status-dot { width:7px; height:7px; border-radius:50%; background:currentColor; flex-shrink:0; }
.agent-status-working { color:var(--warning); border-color:var(--warning); }
.agent-status-working .agent-status-dot { animation:agentPulse 1s ease-in-out infinite; }
.agent-status-done { color:var(--success); border-color:var(--success); }
.agent-status-error { color:var(--danger); border-color:var(--danger); }
@keyframes agentPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(.6)} }

/* Keyboard focus ring for sidebar nav (no-mouse navigation). */
.nav-item:focus-visible { outline: 2px solid var(--blue-accent); outline-offset: -2px; border-radius: 8px; }

.metric-change {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-change.up   { color: var(--success); }
.metric-change.down { color: var(--danger); }
.metric-change.flat { color: var(--text-muted); }

.metric-icon {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: 26px;
  opacity: 0.10;
}

/* ── Badges — iOS tinted pills ───────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: capitalize;
  white-space: nowrap;
  background: var(--bg-highlight);
  border: none;
}

.badge-default  { color: var(--text-secondary); background: var(--bg-highlight); }
.badge-blue     { color: var(--accent-2); background: var(--blue-dim); }
.badge-success  { color: var(--success); background: var(--success-dim); }
.badge-warning  { color: var(--warning); background: var(--warning-dim); }
.badge-danger   { color: var(--danger); background: var(--danger-dim); }
.badge-navy     { color: #FFFFFF; background: var(--accent); }
.badge-brass    { color: var(--accent-2); background: var(--blue-dim); }

/* Property type badges — tinted fills */
.badge-office      { color: var(--office-accent);      background: var(--office-bg); }
.badge-industrial  { color: var(--industrial-accent);  background: var(--industrial-bg); }
.badge-retail      { color: var(--retail-accent);      background: var(--retail-bg); }
.badge-multifamily { color: var(--multifamily-accent); background: var(--multifamily-bg); }
.badge-flex        { color: var(--flex-accent);        background: var(--flex-bg); }
.badge-mixed-use   { color: var(--mixed-use-accent);   background: var(--mixed-use-bg); }
.badge-land        { color: var(--land-accent);        background: var(--land-bg); }
.badge-hospitality { color: var(--hospitality-accent); background: var(--hospitality-bg); }
.badge-health-care { color: var(--health-care-accent); background: var(--health-care-bg); }
.badge-specialty   { color: var(--specialty-accent);   background: var(--specialty-bg); }
.badge-sports-entertainment { color: var(--sports-entertainment-accent); background: var(--sports-entertainment-bg); }
.badge-residential { color: var(--residential-accent); background: var(--residential-bg); }
.badge-unclassified{ color: var(--unclassified-accent);background: var(--unclassified-bg); }

/* Lead score badges */
.badge-hot  { color: var(--danger);  background: var(--danger-dim); }
.badge-warm { color: var(--warning); background: var(--warning-dim); }
.badge-cold { color: var(--slate-cool); background: var(--bg-highlight); }

/* ── Tables — iOS inset list: clean rows, hairline separators ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: var(--text-base);
}

.data-table thead th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: none;
  letter-spacing: -0.006em;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: var(--bg-highlight); cursor: pointer; }

.data-table tbody td {
  padding: 11px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tfoot td {
  padding: 11px 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-weight: 600;
  border-top: 1px solid var(--border-strong);
}

/* ── Forms — terminal density ────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.form-label {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: -0.006em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 9px var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  letter-spacing: -0.006em;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3.5px var(--cobalt-wash);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── Panel / Section ─────────────────────────────────────── */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.panel-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.panel-body { padding: var(--space-4) var(--space-5); }

/* ── Activity / Feed items ───────────────────────────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.activity-content { flex: 1; min-width: 0; }
.activity-title {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 500;
}
.activity-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Listing / Property card ─────────────────────────────── */
.listing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-md), transform var(--transition-md);
  cursor: pointer;
}

.listing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.listing-card-header {
  background: var(--navy-dark);
  padding: var(--space-4);
  position: relative;
}

.listing-type-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.listing-card-body { padding: var(--space-4); }

.listing-address {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 2px;
}

.listing-specs {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-2) 0;
}

.listing-spec {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.listing-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--blue-accent);
}

/* ── Pipeline stage pills ────────────────────────────────── */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Theme-aware tints (class names track data.js raw stage keys — do not rename) */
.stage-prospect   { background: var(--bg-highlight); color: var(--text-secondary); }
.stage-qualifying { background: var(--warning-dim); color: var(--warning); }
.stage-loi        { background: var(--blue-dim); color: var(--blue-accent); }
.stage-contract   { background: var(--multifamily-bg); color: var(--multifamily-accent); }
.stage-due-dil    { background: var(--flex-bg); color: var(--flex-accent); }
.stage-closing    { background: var(--success-dim); color: var(--success); }
.stage-closed     { background: var(--success-dim); color: var(--success); }
.stage-dead       { background: var(--danger-dim); color: var(--danger); }

/* ── AI Result Panel ─────────────────────────────────────── */
.ai-result-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--blue-accent);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 600px;
  overflow-y: auto;
}

.ai-result-panel h1, .ai-result-panel h2, .ai-result-panel h3 {
  color: var(--blue-accent);
  margin: var(--space-4) 0 var(--space-2);
}

.ai-result-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-3) 0;
}

.ai-result-panel th {
  background: var(--navy-mid);
  color: #fff;
  padding: 6px 10px;
  text-align: left;
  font-size: var(--text-xs);
}

.ai-result-panel td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
}

.ai-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

.ai-result-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--blue-accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Loading spinner ─────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8);
  text-align: center;
}

.empty-state .empty-icon { font-size: 40px; opacity: 0.3; }
.empty-state .empty-title { font-size: var(--text-lg); font-weight: 600; color: var(--text-secondary); }
.empty-state .empty-desc { font-size: var(--text-sm); color: var(--text-muted); max-width: 320px; }

/* ── Dividers ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-4) 0;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: var(--space-4) 0;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ── Tooltips / Popovers ─────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-dark);
  color: #fff;
  font-size: var(--text-xs);
  padding: 4px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1000;
  border: 1px solid var(--border-color);
}

[data-tooltip]:hover::after { opacity: 1; }

/* ── Progress bar ────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--blue-accent);
  border-radius: var(--radius-sm);
  transition: width var(--transition-md);
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger); }

/* ── Tabs inside panels — iOS segmented control ──────────── */
.inner-tabs {
  display: inline-flex;
  gap: 2px;
  border-bottom: none;
  background: var(--bg-highlight);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: var(--space-4);
}

.inner-tab {
  padding: 6px var(--space-4);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: none;
  margin-bottom: 0;
  border-radius: calc(var(--radius) - 3px);
  transition: color var(--transition), background var(--transition-md), box-shadow var(--transition-md),
              transform 120ms var(--ease-ios);
}

.inner-tab:hover { color: var(--text-primary); }
.inner-tab:active { transform: scale(0.96); }
.inner-tab.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  border-bottom: none;
}

/* ── Notification / toast ────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 9999;
}

.toast {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  animation: toastIn 420ms var(--ease-spring);
  max-width: 380px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--blue-accent); }

/* Toast status icon — family SVG, tinted per type */
.toast-icon { display: flex; align-items: center; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--blue-accent); }

@keyframes toastIn {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* legacy alias — some callers animate with slideIn */
@keyframes slideIn {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Stat row — terminal density ─────────────────────────── */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-family: var(--font-ui);
}

.stat-row:last-child { border-bottom: none; }
.stat-key {
  color: var(--text-secondary);
  text-transform: none;
  font-size: var(--text-sm);
}
.stat-val {
  font-weight: 600;
  color: var(--text-primary);
  font-feature-settings: 'tnum';
}

/* ── Section heading — iOS grouped-list header ───────────── */
.section-heading {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: var(--space-4) 0 var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-heading::before { content: none; }

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ════════════════════════════════════════════════════════════
   PHASE 2 — Document Center
   ════════════════════════════════════════════════════════════ */

/* ── Template library grid ────────────────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  cursor: pointer;
  min-height: 200px;
}

.template-card:hover {
  border-color: var(--blue-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46,109,164,0.18);
}

.template-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.template-card-icon {
  font-size: 28px;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(46,109,164,0.18), rgba(46,109,164,0.06));
  border: 1px solid rgba(46,109,164,0.25);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.template-card-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--silver-mid);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}

.template-card-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.template-card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.template-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
}

.template-card-types {
  font-size: 11px;
  color: var(--silver-dark);
}

/* ── Recent Documents table ───────────────────────────────── */
.recent-docs-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
}

.doc-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Centered intake modal ────────────────────────────────── */
/* Was a right-side slide-in drawer; converted to a centered box
   (2026-07 feedback: "no more side tabs"). Same element ids and
   header/body/footer structure — every openIntakePanel call site
   works unchanged. */
.intake-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.intake-panel.open {
  visibility: visible;
  pointer-events: auto;
}

.intake-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 44, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 280ms var(--ease-ios);
  pointer-events: auto;
}

.intake-panel.open .intake-overlay {
  opacity: 1;
}

.intake-content {
  position: relative;
  width: 640px;
  max-width: min(640px, 92vw);
  max-height: 86vh;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  overflow: hidden; /* clip square header/footer corners to the radius */
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  /* close = quick ease-out; open springs (see .open below) */
  transition: transform 240ms var(--ease-out), opacity 200ms var(--ease-out);
  pointer-events: auto;
  box-shadow: var(--shadow-xl);
}

.intake-panel.open .intake-content {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: transform 420ms var(--ease-spring), opacity 220ms var(--ease-out);
}

.intake-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-base);
  flex-shrink: 0;
}

.intake-title-block {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.intake-title-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--blue-dim);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--accent-2);
  flex-shrink: 0;
}

.intake-title-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.intake-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intake-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.intake-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
  cursor: pointer;
}

.intake-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.intake-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.intake-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-5);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  background: var(--bg-card);
  flex-shrink: 0;
}

/* Intake form layout */
.intake-field {
  margin-bottom: var(--space-4);
}

.intake-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.intake-field .required-marker {
  color: var(--danger);
  margin-left: 2px;
}

.intake-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.intake-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.intake-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: var(--text-xs);
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}

.intake-checkbox input { margin: 0; }

.intake-checkbox:has(input:checked),
.intake-checkbox.checked {
  background: var(--blue-dim);
  border-color: var(--blue-accent);
  color: var(--text-primary);
}

/* ── Intake loading state ─────────────────────────────────── */
.intake-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  gap: var(--space-4);
  text-align: center;
}

.intake-loading-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border-color);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: intake-spin 0.9s linear infinite;
}

@keyframes intake-spin {
  to { transform: rotate(360deg); }
}

.intake-loading-status {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 600;
  min-height: 22px;
  transition: opacity 0.3s ease;
}

.intake-loading-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

.intake-loading-progress {
  width: 240px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.intake-loading-progress::after {
  content: '';
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--blue-accent), transparent);
  animation: intake-progress 1.4s ease-in-out infinite;
}

@keyframes intake-progress {
  to { left: 100%; }
}

/* ── Intake result state ──────────────────────────────────── */
.intake-result-doc {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-5);
  min-height: 200px;
}

.intake-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.intake-result-body {
  font-size: 13px;
  line-height: 1.6;
}

/* HTML output preview (when output is raw HTML) */
.intake-result-html {
  background: #fff;
  color: #111;
  font-family: Arial, sans-serif;
  border-radius: var(--radius);
  padding: var(--space-5);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.intake-result-html table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.intake-result-html th { background: #0D1B2A; color: #fff; padding: 8px 12px; text-align: left; }
.intake-result-html td { padding: 8px 12px; border-bottom: 1px solid #e5e7eb; }
.intake-result-html tr:nth-child(even) td { background: #F3F4F6; }
.intake-result-html h1, .intake-result-html h2, .intake-result-html h3 { color: #0D1B2A; margin: 16px 0 8px; }

.intake-error {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  text-align: center;
}

.intake-error-icon {
  color: var(--danger);
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: center;
}
.intake-error-icon .tessera-icon {
  width: 28px;
  height: 28px;
}

/* ════════════════════════════════════════════════════════════
   PHASE 3 — CRM intelligence
   ════════════════════════════════════════════════════════════ */

/* ── Contact row actions ──────────────────────────────────── */
.contact-row-action {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.contact-row-action:hover {
  background: rgba(46,109,164,0.12);
  border-color: var(--blue-accent);
  color: var(--blue-accent);
}
.contact-row-toggle {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  user-select: none;
  transition: transform var(--transition);
  display: inline-block;
}
.contact-row.expanded .contact-row-toggle { transform: rotate(90deg); }

/* Last-activity color dot */
.activity-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.activity-dot.fresh  { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.activity-dot.stale  { background: var(--warning); }
.activity-dot.cold   { background: var(--danger); }

/* Expanded contact row content */
.contact-detail-row td {
  background: var(--bg-card) !important;
  border-top: 1px solid var(--border-color) !important;
}
.contact-detail-panel {
  padding: var(--space-4);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}

/* Activity timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 280px;
  overflow-y: auto;
  padding-right: var(--space-2);
}
.activity-entry {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border-left: 3px solid var(--blue-accent);
  font-size: 12px;
  line-height: 1.5;
}
.activity-entry.qualify  { border-left-color: var(--success); }
.activity-entry.sequence { border-left-color: var(--blue-accent); }
.activity-entry.note     { border-left-color: var(--silver-mid); }
.activity-entry.objection{ border-left-color: var(--danger); }
.activity-entry-icon { font-size: 14px; flex-shrink: 0; }
.activity-entry-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.activity-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: var(--space-4);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
}

/* Quick-add note form */
.note-add-form {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.note-add-form textarea {
  min-height: 60px;
  font-size: 12px;
}

/* ── Pipeline Kanban ──────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}
.kanban-column {
  background: var(--bg-highlight);
  border: none;
  border-radius: var(--radius-lg);
  min-width: 180px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  transition: background var(--transition-md), box-shadow var(--transition-md);
}
.kanban-column.drag-over {
  background: var(--blue-dim);
  box-shadow: inset 0 0 0 2px var(--accent-2);
}
.kanban-column-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.kanban-column-title {
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.006em;
  color: var(--text-secondary);
}
.kanban-column-count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
}
.kanban-column-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

/* Deal card — iOS card on track */
.deal-card {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-md), box-shadow var(--transition-md);
  position: relative;
}
.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.deal-card:active { cursor: grabbing; transform: scale(0.98); }
.deal-card.dragging { opacity: 0.6; transform: rotate(2deg) scale(1.02); box-shadow: var(--shadow-lg); }
.deal-card-title { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.deal-card-contact { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.deal-card-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 8px;
}
.deal-card-value { font-weight: 700; color: var(--text-primary); }
.deal-card-comm { color: var(--success); }
.deal-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.deal-card-actions {
  display: flex;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.deal-card-actions .btn-sm {
  flex: 1;
  font-size: 10px;
  padding: 4px 6px;
  height: auto;
  line-height: 1.2;
}

/* Stage hint toast variant */
.stage-hint-toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface);
  border: 1px solid var(--blue-accent);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-5);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  z-index: 800;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}
.stage-hint-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.stage-hint-icon { font-size: 22px; flex-shrink: 0; }
.stage-hint-body { font-size: 13px; line-height: 1.5; }
.stage-hint-title { font-weight: 700; margin-bottom: 4px; color: var(--blue-accent); }

/* ── Email Reply Agent modal ──────────────────────────────── */
.email-agent-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  visibility: hidden;
  pointer-events: none;
}
.email-agent-modal.open {
  visibility: visible;
  pointer-events: auto;
}
.email-agent-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 44, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 280ms var(--ease-ios);
  pointer-events: auto;
}
.email-agent-modal.open .email-agent-overlay { opacity: 1; }
.email-agent-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 880px;
  max-width: 92vw;
  max-height: 88vh;
  transform: translate(-50%, -50%) scale(0.96) translateY(12px);
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  opacity: 0;
  /* close = quick ease-out; open springs (see .open below) */
  transition: transform 280ms var(--ease-out), opacity 220ms var(--ease-ios);
  pointer-events: auto;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.email-agent-modal.open .email-agent-content {
  transform: translate(-50%, -50%) scale(1) translateY(0);
  opacity: 1;
  transition: transform 380ms var(--ease-spring), opacity 220ms var(--ease-ios);
}
.email-agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  flex-shrink: 0;
}
.email-agent-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}
.email-agent-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Email queue table */
.email-queue-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.email-queue-table th {
  text-align: left;
  background: var(--bg-card);
  color: var(--silver-mid);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}
.email-queue-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.email-queue-table tr:hover td { background: var(--bg-elevated); }
.email-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.email-status.pending { background: var(--warning-dim); color: var(--warning); }
.email-status.draft   { background: var(--blue-dim); color: var(--blue-accent); }
.email-status.flagged { background: var(--danger-dim); color: var(--danger); }
.email-status.done    { background: var(--success-dim); color: var(--success); }

/* Connect Gmail prompt */
.connect-gmail-card {
  padding: var(--space-6);
  text-align: center;
  background: linear-gradient(135deg, rgba(46,109,164,0.06), rgba(46,109,164,0.02));
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
}
.connect-gmail-icon { font-size: 48px; margin-bottom: var(--space-3); }
.connect-gmail-title { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-2); }
.connect-gmail-body { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; max-width: 460px; margin: 0 auto var(--space-4); }

/* Draft preview blob inside queue row */
.email-draft-preview {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-top: var(--space-2);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}
.email-draft-preview.show { display: block; }
.email-classify-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: var(--radius);
  background: var(--blue-dim);
  color: var(--blue-accent);
  text-transform: uppercase;
}
.email-classify-badge.flag { background: var(--danger-dim); color: var(--danger); }

/* Run-all progress strip */
.email-agent-progress {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: var(--space-2);
}
.email-agent-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-accent), #60a5fa);
  width: 0%;
  transition: width 0.4s ease;
}

/* ════════════════════════════════════════════════════════════
   PHASE 4 — Market Intelligence, Research Canvas, Monday Banner
   ════════════════════════════════════════════════════════════ */

/* ── Research Canvas ─────────────────────────────────────── */
.research-canvas {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  min-height: 520px;
  overflow: hidden;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.research-canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: var(--space-5);
  pointer-events: none;
}

.research-canvas-toolbar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
  align-items: center;
}

.research-canvas-color-picker {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 4px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition);
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--blue-accent); }
.color-swatch.amber { background: #f59e0b; }
.color-swatch.blue  { background: #2e6da4; }
.color-swatch.green { background: #22c55e; }
.color-swatch.red   { background: #ef4444; }

/* Sticky note */
.sticky-note {
  position: absolute;
  width: 200px;
  min-height: 140px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-family: 'Caveat', 'Comic Sans MS', Georgia, sans-serif;
  color: #1f2937;
  user-select: none;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform 60ms ease;
  will-change: transform;
}
.sticky-note.amber { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.sticky-note.blue  { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.sticky-note.green { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); }
.sticky-note.red   { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); }

.sticky-note.dragging {
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transform: rotate(-1deg) scale(1.02);
}

.sticky-note-handle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  cursor: grab;
  font-size: 10px;
  color: rgba(0,0,0,0.55);
  border-bottom: 1px dashed rgba(0,0,0,0.15);
}
.sticky-note-handle:active { cursor: grabbing; }

.sticky-note-actions {
  display: flex;
  gap: 4px;
}

.sticky-note-action {
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  color: rgba(0,0,0,0.7);
}
.sticky-note-action:hover { background: rgba(0,0,0,0.15); }

.sticky-note-text {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: inherit;
  resize: none;
  outline: none;
  overflow-y: auto;
}
.sticky-note-text:focus { background: rgba(255,255,255,0.25); }

.sticky-note-meta {
  font-size: 9px;
  color: rgba(0,0,0,0.45);
  padding: 2px 10px 6px;
  font-family: var(--font-sans);
}

/* ── News summary block (inline result) ──────────────────── */
.news-summary-block {
  background: var(--bg-elevated);
  border-left: 3px solid var(--blue-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
  display: none;
}
.news-summary-block.show { display: block; }
.news-summary-block.loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-style: italic;
}
.news-summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--blue-accent);
  margin-bottom: 4px;
}

/* ── Monday banner ───────────────────────────────────────── */
.monday-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(46,109,164,0.18), rgba(46,109,164,0.04));
  border: 1px solid rgba(46,109,164,0.4);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  gap: var(--space-4);
  position: relative;
}
.monday-banner-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.monday-banner-body { flex: 1; }
.monday-banner-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.monday-banner-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.monday-banner-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ── Weekly updater progress ─────────────────────────────── */
.weekly-progress {
  background: var(--bg-elevated);
  border: 1px solid var(--blue-accent);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.weekly-progress-list { margin-top: var(--space-2); }
.weekly-progress-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.weekly-progress-item .status {
  width: 16px;
  text-align: center;
}
.weekly-progress-item.done { color: var(--text-primary); }
.weekly-progress-item.done .status { color: var(--success); }
.weekly-progress-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Saved Report card (Analytics) ───────────────────────── */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  transition: border-color var(--transition);
}
.report-card:hover { border-color: var(--blue-accent); }
.report-card-title { font-weight: 600; font-size: 13px; }
.report-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.report-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Report viewer modal — reuses email-agent-modal styles */
.report-viewer-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 920px;
  max-width: 94vw;
  max-height: 90vh;
  transform: translate(-50%, -50%) scale(0.96);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
  pointer-events: auto;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.email-agent-modal.open .report-viewer-content {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ── Watchlist chips (Settings) ──────────────────────────── */
.watchlist-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.watchlist-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-primary);
}
.watchlist-chip button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition), color var(--transition);
}
.watchlist-chip button:hover { color: var(--danger); background: rgba(239,68,68,0.12); }
.watchlist-empty {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   PHASE 5 — Agent Network feed, notifications, groups
   ════════════════════════════════════════════════════════════ */

/* ── Post composer ────────────────────────────────────────── */
.post-composer {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.post-composer-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.post-composer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-accent), #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
}
.post-composer-info {
  flex: 1;
}
.post-composer-name {
  font-size: 13px;
  font-weight: 700;
}
.post-composer-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.post-composer textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
.post-composer textarea:focus {
  outline: none;
  border-color: var(--blue-accent);
}
.post-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
  gap: var(--space-3);
  flex-wrap: wrap;
}
.post-composer-platform-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ── Drafts panel ────────────────────────────────────────── */
.drafts-panel {
  background: linear-gradient(135deg, rgba(46,109,164,0.08), rgba(46,109,164,0.02));
  border: 1px solid rgba(46,109,164,0.3);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.drafts-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.drafts-panel-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 13px;
}
.drafts-panel-title .count {
  background: var(--blue-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius);
}

.draft-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  display: flex;
  gap: var(--space-3);
}
.draft-card-platform {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 16px;
}
.draft-card-body {
  flex: 1;
  min-width: 0;
}
.draft-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 6px;
}
.draft-card-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  cursor: pointer;
}
.draft-card.expanded .draft-card-text {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}
.draft-card-editor {
  width: 100%;
  min-height: 120px;
  background: var(--bg-base);
  border: 1px solid var(--blue-accent);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}
.draft-card-actions {
  display: flex;
  gap: 6px;
  margin-top: var(--space-2);
}

/* ── Feed post ────────────────────────────────────────────── */
.feed-post {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.feed-post-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.feed-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy-mid);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--blue-accent);
  flex-shrink: 0;
  font-size: 13px;
}
.feed-avatar.me {
  background: linear-gradient(135deg, var(--blue-accent), #60a5fa);
  color: #fff;
  border: none;
}
.feed-author-info { flex: 1; min-width: 0; }
.feed-author-name {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.feed-author-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.feed-post-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-bottom: var(--space-3);
}
.feed-post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
}
.feed-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.feed-action:hover { background: var(--bg-elevated); color: var(--text-primary); }
.feed-action.liked { color: var(--danger); }
.feed-action.liked .heart::before { content: '❤'; }
.feed-action .heart::before { content: '♡'; }

.feed-comments {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: none;
}
.feed-comments.open { display: block; }
.feed-comment {
  font-size: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 6px;
}
.feed-comment-author { font-weight: 700; margin-bottom: 2px; }
.feed-comment-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-primary);
  margin-top: 6px;
}

/* ── Network sidebar widgets ──────────────────────────────── */
.network-search {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
}
.network-search:focus {
  outline: none;
  border-color: var(--blue-accent);
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.filter-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.filter-pill:hover { color: var(--text-primary); }
.filter-pill.active {
  background: rgba(46,109,164,0.2);
  color: var(--blue-accent);
  border-color: var(--blue-accent);
}

.network-card-mini {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.network-card-mini:last-child { border-bottom: none; }
.network-card-mini .mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-accent);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}
.network-card-mini .mini-info {
  flex: 1;
  min-width: 0;
}
.network-card-mini .mini-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.network-card-mini .mini-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.connect-btn {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--blue-accent);
  color: #fff;
  border: none;
  cursor: pointer;
}
.connect-btn.connected {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* ── Groups ──────────────────────────────────────────────── */
.group-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  transition: border-color var(--transition);
}
.group-card:hover { border-color: var(--blue-accent); }
.group-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: rgba(46,109,164,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.group-card-body { flex: 1; min-width: 0; }
.group-card-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.group-card-desc { font-size: 11px; color: var(--text-muted); line-height: 1.45; }
.group-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  gap: var(--space-3);
}

/* Group feed banner */
.group-banner {
  background: linear-gradient(135deg, rgba(46,109,164,0.2), rgba(46,109,164,0.04));
  border: 1px solid rgba(46,109,164,0.4);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.group-banner-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.group-banner-meta { font-size: 12px; color: var(--text-muted); }

/* ── Notification "bell" — text-only "ALERTS (n)" ───────── */
.notif-bell {
  position: relative;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: all var(--transition);
}
.notif-bell:hover { color: var(--brass-bright); border-color: var(--brass-deep); }

.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: var(--radius);
  background: var(--danger);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
}
.notif-badge.hidden { display: none; }

.notif-dropdown {
  position: absolute;
  top: 54px;
  right: 12px;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  visibility: hidden;
  /* close = quick ease-out; open springs */
  transition: opacity 0.16s var(--ease-ios), transform 0.16s var(--ease-out), visibility 0.16s;
}
.notif-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  transition: opacity 0.2s var(--ease-ios), transform 0.32s var(--ease-spring);
}
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) 0 0;
}
.notif-dropdown-body {
  max-height: 480px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-elevated); }
.notif-item.unread { background: var(--blue-glow); }   /* theme-aware (was hardcoded old-palette rgba) */
.notif-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.notif-item-body {
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
}
.notif-item-title { font-weight: 600; color: var(--text-primary); }
.notif-item-meta { color: var(--text-muted); font-size: 10px; margin-top: 2px; }
.notif-item.unread .notif-item-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-accent);
  margin-right: 6px;
  vertical-align: middle;
}
.notif-empty {
  padding: var(--space-5);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════
   PHASE 7 — Roles, permissions, and admin UI
   ════════════════════════════════════════════════════════════ */

/* ── Access denied ──────────────────────────────────────── */
.access-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  min-height: 60vh;
  gap: 0;
}
.access-denied-label {
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--danger);
  font-weight: 600;
  margin-bottom: 14px;
}
.access-denied-tab {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.012em;
}
.access-denied-msg {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  max-width: 400px;
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ── Role badge (sidebar footer + settings + admin table) ── */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  background: transparent;
  white-space: nowrap;
}

.role-badge-large {
  font-size: 11px;
  padding: 6px 14px;
  letter-spacing: 0.2em;
}

.role-badge-admin   { color: var(--brass-bright); border-color: var(--brass); }
.role-badge-broker  { color: var(--blue-accent); border-color: var(--blue-accent); }
.role-badge-analyst { color: var(--text-secondary); border-color: var(--border-strong); }

/* Sidebar footer slot for the role badge */
.sidebar-role-slot {
  padding: 0 var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
#sidebar.collapsed .sidebar-role-slot { display: none; }

/* ── Capability list (Settings → Role & Access) ─────────── */
.capability-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
  font-family: var(--font-ui);
}
.capability-row .cap-mark {
  width: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-mono);
}
.capability-row.can .cap-mark   { color: var(--success); }
.capability-row.cant .cap-mark  { color: var(--text-muted); }
.capability-row.can .cap-label  { color: var(--text-primary); }
.capability-row.cant .cap-label { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.1); }

/* ── Read-only banner (Network for Analyst) ─────────────── */
.readonly-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-left: 2px solid var(--brass);
  margin-bottom: var(--space-4);
}
.readonly-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--brass-bright);
  text-transform: uppercase;
  flex-shrink: 0;
}
.readonly-msg {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* ── Admin-only card (Off-Market Deal Room) ─────────────── */
.admin-only-card {
  border-color: var(--danger) !important;
  position: relative;
}
.admin-only-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--danger), transparent);
}

/* Admin shortcut tiles */
.admin-shortcut .card-body {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ════════════════════════════════════════════════════════════
   HUB PHOTOS — property photo strip (synced with mobile)
   ════════════════════════════════════════════════════════════ */
.hub-photo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.hub-photo-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
}
.hub-photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: var(--space-4);
}
.hub-photo-thumb-wrap { position: relative; flex-shrink: 0; }
.hub-photo-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.hub-photo-thumb:hover { box-shadow: var(--shadow-md); }
.hub-photo-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 28, 44, 0.65);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}
.hub-photo-thumb-wrap:hover .hub-photo-del { opacity: 1; }
.hub-photo-empty {
  font-size: var(--text-base);
  color: var(--text-muted);
  padding: 8px 0;
}
.hub-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(10, 14, 22, 0.9);
  -webkit-backdrop-filter: blur(8px);   /* overlays unified at 8px (mobile parity) */
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.2s var(--ease-ios);
  cursor: zoom-out;
}
.hub-photo-viewer.open { opacity: 1; }
.hub-photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  transform: scale(0.97);
  transition: transform 280ms var(--ease-out);
}
.hub-photo-viewer.open img { transform: scale(1); }

/* ════════════════════════════════════════════════════════════
   HUB AUTH — login · signup · Windows Hello lock
   ════════════════════════════════════════════════════════════ */
.hub-auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
/* Entrance — CSS-only so hub-auth.js stays untouched */
@keyframes hubAuthIn {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hub-auth-card {
  animation: hubAuthIn 360ms var(--ease-out) both;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px 36px;
}
.hub-auth-mark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 5px;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
}
.hub-auth-mark span {
  border-radius: 7px;
  background: var(--accent);
}
.hub-auth-mark span:nth-child(2),
.hub-auth-mark span:nth-child(3) { opacity: 0.22; }

.hub-auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.hub-auth-sub {
  font-size: var(--text-md);
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.hub-auth-card .form-input { width: 100%; text-align: left; }
.hub-auth-error {
  min-height: 18px;
  font-size: var(--text-base);
  color: var(--danger);
  margin-bottom: 12px;
  line-height: 1.45;
}
.hub-auth-toggle {
  margin-top: 14px;
  font-size: var(--text-base);
  color: var(--accent-2) !important;
}
.hub-auth-bio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  font-size: var(--text-base);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
.hub-auth-bio-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* ════════════════════════════════════════════════════════════
   ICON SYSTEM — Backend SVG icons
   ════════════════════════════════════════════════════════════ */
.tessera-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}
.tessera-icon.sm  { width: 12px; height: 12px; }
.tessera-icon.md  { width: 16px; height: 16px; }
.tessera-icon.lg  { width: 20px; height: 20px; }
.tessera-icon.xl  { width: 24px; height: 24px; }
/* Icons inside empty states render large like the old emoji glyphs */
.empty-state .empty-icon .tessera-icon { width: 44px; height: 44px; }

.icon-fallback {
  font-size: 10px;
  font-family: var(--font-ui);
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* Icon inside button — spacing */
.btn .tessera-icon { margin-right: 5px; vertical-align: -1px; }
.btn-icon-only .tessera-icon { margin-right: 0; }

/* ════════════════════════════════════════════════════════════
   API KEY STATUS — Phase 10
   ════════════════════════════════════════════════════════════ */
.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}
.api-status-dot.connected    { background: var(--success); }
.api-status-dot.disconnected { background: var(--warning); }
.api-status-dot:hover { opacity: 0.7; }

/* API key popup (anchored under the topbar dot) */
.api-key-popup {
  position: fixed;
  top: 48px;
  right: 12px;
  z-index: 1000;
  width: 300px;
  /* menuPop restarts each time the popup is un-hidden */
  animation: menuPop 220ms var(--ease-out);
  transform-origin: top right;
}
.api-key-popup.hidden { display: none; }

.api-key-popup-inner {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 0;
}

.api-key-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 10px;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.api-key-popup-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.api-key-popup-header button:hover { color: var(--text-primary); }

#api-key-popup-body { padding: 14px; }

.api-popup-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-ui);
  margin-bottom: 10px;
}
.api-popup-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.api-popup-status.connected    .api-popup-dot { background: var(--success); }
.api-popup-status.connected    { color: var(--success); }
.api-popup-status.disconnected .api-popup-dot { background: var(--warning); }
.api-popup-status.disconnected { color: var(--warning); }

.api-popup-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.api-popup-actions   { display: flex; gap: 6px; }
.api-popup-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.api-popup-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

/* ════════════════════════════════════════════════════════════
   SETTINGS — Appearance, Connectors, Uploads (Phase 9)
   ════════════════════════════════════════════════════════════ */

/* Pair-toggle button group (theme / density / sidebar / grid) */
.pair-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
}
.pair-toggle button {
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: none;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  transition: color 0.1s ease, border-color 0.1s ease;
}
.pair-toggle button:last-child { border-right: none; }
.pair-toggle button:hover { color: var(--text-primary); }
.pair-toggle button.active {
  border-color: var(--blue-accent);
  color: var(--blue-accent);
}

/* Settings row inside Appearance card */
.settings-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.settings-row:last-child { border-bottom: none; padding-bottom: 0; }
.settings-row-info { flex: 1; min-width: 0; }
.settings-row-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.settings-row-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Connector row (third-party connectors + social media) */
.connector-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.connector-row:last-child { border-bottom: none; padding-bottom: 0; }
.connector-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: var(--space-3);
}
.connector-name {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.connector-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.connector-input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.connector-input-row input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Upload drop zone (Doc Templates + Media Templates) */
.upload-drop-zone {
  border: 1px dashed var(--border-color);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  margin-bottom: var(--space-3);
}
.upload-drop-zone:hover { border-color: var(--blue-accent); }
.upload-drop-zone.drag-over {
  border-color: var(--blue-accent);
  background: var(--bg-elevated);
}
.upload-drop-inner {
  pointer-events: none;
}
.upload-drop-inner .btn { pointer-events: auto; }

/* Template list rows (doc + media) */
.template-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-3);
}
.template-list-row:last-child { border-bottom: none; }
.template-list-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}
.template-list-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.template-list-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.template-list-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   DEAL DETAIL MODAL — Phase 11
   ════════════════════════════════════════════════════════════ */
.deal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 44, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease-ios);
}
.deal-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.deal-modal {
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 92vw;
  max-width: 1200px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  /* close = quick ease-out; open springs (see .open below) */
  transition: transform 280ms var(--ease-out);
}
.deal-modal-overlay.open .deal-modal {
  transform: scale(1) translateY(0);
  transition: transform 380ms var(--ease-spring);
}

.deal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: var(--bg-base);
}

.deal-modal-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.deal-modal-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.deal-modal-stage {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: var(--font-ui, monospace);
}

.deal-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.deal-modal-col {
  padding: var(--space-4);
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
}
.deal-modal-col:last-child { border-right: none; }

.deal-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-color);
  background: var(--bg-base);
  flex-shrink: 0;
}

.deal-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-family: var(--font-ui, monospace);
  font-weight: 500;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-2);
}

.deal-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.deal-field-item { padding: 4px 0; }

.deal-field-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.deal-field-value {
  font-size: 12px;
  color: var(--text-primary);
  border: 1px solid transparent;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  min-height: 20px;
  transition: border-color 0.1s, background 0.1s;
}
.deal-field-value:hover { border-color: var(--border-subtle); }
.deal-field-value:focus {
  border-color: var(--blue-accent);
  outline: none;
  background: var(--bg-input);
}

.activity-type-btn.active {
  background: var(--blue-dim);
  color: var(--blue-accent);
  border-color: var(--blue-accent);
}

/* ════════════════════════════════════════════════════════════
   AGENT CARDS — Phase 12
   ════════════════════════════════════════════════════════════ */
.agent-card { transition: border-color 0.15s; }
.agent-card:hover { border-color: var(--blue-accent); }
.agent-disabled { opacity: 0.55; }
.agent-disabled .card-body { filter: grayscale(0.3); }

/* ── Deal Modal — iOS sheet ─────────────────────────────── */
.deal-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 28, 44, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 280ms var(--ease-ios);
}
.deal-modal-overlay.open { opacity: 1; pointer-events: all; }
.deal-modal {
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 92vw; max-width: 1180px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.96) translateY(12px);
  /* close = quick ease-out; open springs (see .open below) */
  transition: transform 280ms var(--ease-out);
}
.deal-modal-overlay.open .deal-modal {
  transform: scale(1) translateY(0);
  transition: transform 380ms var(--ease-spring);
}
.deal-modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0; background: transparent;
}
.deal-modal-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.022em;
  color: var(--text-primary); margin-bottom: var(--space-1);
}
.deal-modal-meta { display: flex; align-items: center; gap: var(--space-2); }
.deal-modal-stage {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); font-family: var(--font-ui, monospace);
}
.deal-modal-body {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  flex: 1; overflow: hidden;
}
.deal-modal-col {
  padding: var(--space-4); overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
}
.deal-modal-col:last-child { border-right: none; }
.deal-modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-color);
  background: var(--bg-base); flex-shrink: 0;
}
.deal-section-title {
  font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-family: var(--font-ui);
  font-weight: 600; padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-2);
}
.deal-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.deal-field-item { padding: 3px 0; }
.deal-field-label {
  font-size: var(--text-xs); color: var(--text-muted);
  text-transform: none; margin-bottom: 2px;
}
.deal-field-value {
  font-size: var(--text-base); color: var(--text-primary);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 2px 6px; min-height: 22px;
  transition: border-color var(--transition), background var(--transition);
}
.deal-field-value:focus { border-color: var(--border-accent); outline: none; background: var(--bg-input); }
.act-type-btn.active { background: var(--blue-dim); color: var(--blue-accent); border-color: var(--blue-accent); }

/* ── Social Studio ──────────────────────────────────────── */
.social-template-btn {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.1s, background 0.1s;
}
.social-template-btn:hover {
  border-color: var(--border-color);
  background: var(--bg-elevated);
}
.social-template-btn.active {
  border-color: var(--blue-accent);
  background: var(--blue-dim);
}
.social-template-icon {
  font-size: 14px;
  color: var(--blue-accent);
  flex-shrink: 0;
  padding-top: 2px;
  width: 16px;
  text-align: center;
}



/* ════════════════════════════════════════════════════════════
   MOTION — iOS press feel + display-toggle entrances
   (2026-06-12 polish pass; transform/opacity only)
   ════════════════════════════════════════════════════════════ */

/* Zone Map modal is shown via display:none → flex; CSS animations
   restart on that toggle, so the card gets an entrance for free. */
@keyframes modalRise {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
#zone-map-modal > div {
  animation: modalRise 320ms var(--ease-out);
}

/* ── Skeleton shimmer (sync/loading placeholders, mobile parity) ── */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--bg-highlight);
  border-radius: var(--radius);
}
.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: skelShimmer 1.4s var(--ease-ios) infinite;
}
[data-theme="dark"] .skel::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
}
@keyframes skelShimmer { to { transform: translateX(100%); } }
.skel-thumb { width: 96px; height: 96px; flex-shrink: 0; }
.skel-line  { height: 12px; margin: 8px 0; }

/* Row press states — quick-in/slow-out, like UITableViewCell */
.notif-item:active { background: var(--bg-highlight); }
.data-table tbody tr:active { background: var(--border-subtle); }
.listing-card:active {
  transform: scale(0.99);
  transition-duration: 80ms;
}

/* ── Leaflet zone map overrides ──────────────────────────── */
.leaflet-zone-tip {
  background: var(--bg-elevated, #1e2a38);
  border: 1px solid var(--border-subtle, #2a3a4a);
  color: var(--text-primary, #e8edf2);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}
.leaflet-zone-tip::before { display: none; }

/* Keep Leaflet controls from inheriting app button styles */
.leaflet-draw-toolbar a,
.leaflet-bar a {
  all: revert;
}

/* ════════════════════════════════════════════════════════════
   DOCUMENT CENTER v2 — categorized library + branded previews
   ════════════════════════════════════════════════════════════ */

.doc-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--space-5);
}

.doc-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}

.doc-cat-chip:hover {
  border-color: var(--cobalt);
  color: var(--text-primary);
}

.doc-cat-chip.active {
  background: var(--midnight, #1C2B4A);
  border-color: var(--midnight, #1C2B4A);
  color: #fff;
}

.doc-cat-chip .doc-cat-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.doc-cat-chip.active .doc-cat-count {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.doc-cat-section { margin-bottom: var(--space-6); }

.doc-cat-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-cat-desc {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

/* Branded document preview — sandboxed iframe, true to print output */
.doc-preview-frame {
  width: 100%;
  height: min(68vh, 860px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(16,24,40,0.08));
}

.doc-style-preview { height: 380px; }
