/*
 * TPH — Liquidation Intelligence Platform
 * Design System: Apple HIG-inspired, Octalysis-driven engagement
 */

/* ============================================
   FOUNDATIONS
   ============================================ */

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

/* ============================================
   TURBO SPA — Progress bar & transitions
   ============================================ */

.turbo-progress-bar {
  background: var(--color-blue);
  height: 3px;
  z-index: 9999;
}

/* Loading spinner — appears after 500ms delay on slow requests */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 247, 0.5);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.loading-spinner.visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--color-border-strong);
  border-top-color: var(--color-blue);
  animation: spinner-rotate 0.7s linear infinite;
}

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

/* Smooth content transitions on Turbo navigation */
.main-content {
  view-transition-name: main-content;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

::view-transition-old(main-content) {
  animation: none;
}

::view-transition-new(main-content) {
  animation: fade-in 0.15s ease-out;
}

:root {
  /* Color System — Apple-inspired semantic palette */
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-secondary: #f9fafb;
  --color-surface-elevated: #ffffff;
  --color-border: rgba(0, 0, 0, 0.06);
  --color-border-strong: rgba(0, 0, 0, 0.12);
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-text-tertiary: #aeaeb2;
  --color-text-link: #0066cc;

  /* Accent colors */
  --color-blue: #007aff;
  --color-green: #34c759;
  --color-orange: #ff9500;
  --color-red: #ff3b30;
  --color-yellow: #ffcc00;
  --color-purple: #af52de;
  --color-teal: #5ac8fa;

  /* Semantic colors */
  --color-success: #34c759;
  --color-warning: #ff9500;
  --color-danger: #ff3b30;
  --color-info: #007aff;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows — Apple-style layered shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 0px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Pico overrides */
:where(article) { background: transparent; padding: 0; margin: 0; border-radius: 0; box-shadow: none; }
:where(nav) { padding: 0; }
:where(nav ul) { list-style: none; padding: 0; margin: 0; }

/* ============================================
   BASE STYLES
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover { opacity: 0.75; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-surface-secondary);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  color: var(--color-text-secondary);
}

/* ============================================
   LAYOUT — Sidebar + Content
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-primary);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.sidebar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
}

.sidebar-section {
  padding: var(--space-sm) var(--space-md);
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  padding: var(--space-sm) var(--space-sm);
  margin: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.sidebar-nav a:hover {
  background: var(--color-surface-secondary);
  color: var(--color-text-primary);
  opacity: 1;
}

.sidebar-nav a.active {
  background: var(--color-blue);
  color: white;
}

.sidebar-nav a.active:hover { opacity: 0.9; }

.sidebar-nav .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
}

.sidebar-nav .nav-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 22px;
  text-align: center;
}

.sidebar-nav a.active .nav-badge {
  background: rgba(255,255,255,0.3);
}

.sidebar-footer {
  margin-top: auto;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.sidebar-footer small {
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

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

.sidebar-user-info {
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-signout {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-decoration: none;
}

.sidebar-signout:hover {
  color: var(--color-red);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-xl);
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
  margin-bottom: var(--space-xl);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-xs);
  line-height: 1.2;
}

.page-header .subtitle {
  color: var(--color-text-secondary);
  font-size: 1rem;
  margin: 0;
  font-weight: 400;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
}

.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb .separator { color: var(--color-text-tertiary); }
.breadcrumb .current { color: var(--color-text-primary); font-weight: 600; }

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow var(--transition-normal);
  margin-bottom: var(--space-lg);
}

/* Cards inside grid layouts get spacing from gap, not margin */
.charts-grid > .card,
.detail-grid > .card,
.stats-grid > .card {
  margin-bottom: 0;
}

/* Last card on a page doesn't need bottom margin */
.card:last-child {
  margin-bottom: 0;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin: 0;
}

.card-header .card-action {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-blue);
}

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

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
}

/* Pagy pagination nav */
.card-footer nav.series-nav,
.card-footer .pagy {
  display: flex;
  gap: 2px;
  align-items: center;
}

.card-footer nav.series-nav a,
.card-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text-secondary);
  transition: all 0.15s;
}

.card-footer nav.series-nav a:hover {
  background: var(--color-fill-secondary);
  color: var(--color-text-primary);
}

.card-footer nav.series-nav a[aria-current="page"] {
  background: var(--color-blue);
  color: white;
}

.card-footer nav.series-nav a[aria-disabled="true"] {
  color: var(--color-text-tertiary);
  cursor: default;
  pointer-events: none;
}

.card-footer nav.series-nav a[aria-disabled="true"]:not([aria-current]) {
  background: none;
}

.card-footer nav.series-nav a[role="separator"] {
  min-width: auto;
  padding: 0 4px;
}

/* ============================================
   STAT CARDS (Metrics)
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--color-border-strong);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-xs);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.stat-card .stat-detail {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.stat-card .stat-detail a {
  font-weight: 600;
}

/* Stat colors */
.stat-value.text-green { color: var(--color-green); }
.stat-value.text-red { color: var(--color-red); }
.stat-value.text-orange { color: var(--color-orange); }
.stat-value.text-blue { color: var(--color-blue); }
.stat-value.text-purple { color: var(--color-purple); }
.stat-value.text-gray { color: var(--color-text-secondary); }

/* Urgency pulse — Octalysis Scarcity */
.stat-card.urgent {
  border-color: rgba(255, 59, 48, 0.2);
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.stat-card.urgent .stat-label { color: var(--color-red); }

/* ============================================
   DASHBOARD SECTIONS
   ============================================ */

.dashboard-section-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--pico-muted-border-color);
}

.dashboard-section-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.dashboard-opportunities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  text-align: center;
}

.dashboard-opp-item {
  padding: var(--space-md);
  border-radius: 8px;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
}

@media (max-width: 600px) {
  .dashboard-opportunities-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard quick links */
.dashboard-quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.dashboard-quick-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-quick-link:hover {
  border-color: var(--color-blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dashboard-quick-link-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.dashboard-quick-link-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--pico-color);
}

.dashboard-quick-link-desc {
  font-size: 0.78rem;
  color: var(--pico-muted-color);
  margin-top: 2px;
}

.dashboard-quick-link-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--pico-muted-color);
  flex-shrink: 0;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-green { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.badge-red { background: rgba(255, 59, 48, 0.12); color: #d70015; }
.badge-orange { background: rgba(255, 149, 0, 0.12); color: #c93400; }
.badge-yellow { background: rgba(255, 204, 0, 0.12); color: #a05a00; }
.badge-blue { background: rgba(0, 122, 255, 0.12); color: #0040dd; }
.badge-gray { background: rgba(142, 142, 147, 0.12); color: #6e6e73; }
.badge-purple { background: rgba(175, 82, 222, 0.12); color: #8944ab; }

/* ============================================
   TABLES
   ============================================ */

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border-strong);
  background: var(--color-surface-secondary);
}

table td {
  padding: var(--space-sm) var(--space-md);
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

table td:first-child {
  white-space: normal;
  min-width: 200px;
  font-weight: 500;
}

table tbody tr {
  transition: background var(--transition-fast);
}

table tbody tr:hover {
  background: var(--color-surface-secondary);
}

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

table th a {
  color: var(--color-text-tertiary);
  font-weight: 700;
}

table th a:hover {
  color: var(--color-blue);
  opacity: 1;
}

/* ============================================
   FORMS & SEARCH
   ============================================ */

.search-bar {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.search-bar .search-grid {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--space-md);
  align-items: end;
}

.search-bar input[type="search"],
.search-bar select {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast);
  height: 40px;
  margin: 0;
}

.search-bar input[type="search"]:focus,
.search-bar select:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.search-bar input[type="search"]::placeholder {
  color: var(--color-text-tertiary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  height: 40px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-blue);
  color: white;
}

.btn-primary:hover {
  background: #0066cc;
  opacity: 1;
}

.btn-outline {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-strong);
}

.btn-outline:hover {
  background: var(--color-surface-secondary);
  color: var(--color-text-primary);
  opacity: 1;
}

/* ============================================
   CHARTS
   ============================================ */

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}

/* ============================================
   RISK SCORE BAR
   ============================================ */

.risk-meter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.risk-meter .bar-track {
  flex: 1;
  height: 6px;
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.risk-meter .bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.risk-meter .bar-fill.low { background: var(--color-green); }
.risk-meter .bar-fill.medium { background: var(--color-yellow); }
.risk-meter .bar-fill.high { background: var(--color-orange); }
.risk-meter .bar-fill.critical { background: var(--color-red); }

.risk-meter .score-label {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}

/* ============================================
   DETAIL PAGE
   ============================================ */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-table {
  width: 100%;
}

.detail-table td {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.detail-table td:first-child {
  min-width: auto;
  width: 140px;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

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

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--color-text-tertiary);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state p {
  font-size: 1rem;
  margin: 0 0 var(--space-sm);
}

.empty-state small {
  font-size: 0.85rem;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
  font-weight: 500;
}

.flash-notice {
  background: rgba(52, 199, 89, 0.1);
  color: #248a3d;
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.flash-alert {
  background: rgba(255, 59, 48, 0.1);
  color: #d70015;
  border: 1px solid rgba(255, 59, 48, 0.2);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagy nav,
.pagy-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
}

.pagy nav a,
.pagy nav span {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.pagy nav a:hover {
  background: var(--color-surface-secondary);
  opacity: 1;
}

.pagy nav .current {
  background: var(--color-blue);
  color: white;
}

/* ============================================
   DATA IMPORTS PAGE
   ============================================ */

.import-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm);
}

.import-actions form button,
.import-actions form input[type="submit"] {
  width: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-bar .search-grid {
    grid-template-columns: 1fr;
  }

  .page-container {
    padding: var(--space-md);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-md { gap: var(--space-md); }
.text-red { color: var(--color-red); }
.text-green { color: var(--color-green); }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }
.text-lg { font-size: 1.5rem; }
.opacity-70 { opacity: 0.7; }
.flex-1 { flex: 1; }
.grid-full { grid-column: 1 / -1; }
.cursor-pointer { cursor: pointer; }
.details-toggle { cursor: pointer; color: var(--color-text-secondary); }
.max-w-md { max-width: 700px; }
.max-w-lg { max-width: 900px; }
.flex-center { display: flex; align-items: center; gap: var(--space-sm); }
.flex-spread { display: flex; gap: var(--space-xl); margin-bottom: var(--space-md); }
.stat-pair { flex: 1; text-align: center; }
.section-pad { padding: var(--space-md) var(--space-lg); }

/* ============================================
   SBR TRACKER
   ============================================ */

.sbr-banner {
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
  border: 1px solid;
}

.sbr-banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.sbr-banner-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sbr-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.sbr-banner-detail {
  font-size: 0.9rem;
  opacity: 0.8;
}

.sbr-banner-critical {
  background: linear-gradient(135deg, #fff0f0 0%, #fff5f5 100%);
  border-color: rgba(255, 59, 48, 0.25);
  color: #c9302c;
}

.sbr-banner-critical .sbr-banner-icon {
  background: var(--color-red);
  color: white;
}

.sbr-banner-high {
  background: linear-gradient(135deg, #fff5f0 0%, #fff8f5 100%);
  border-color: rgba(255, 149, 0, 0.25);
  color: #b35c00;
}

.sbr-banner-high .sbr-banner-icon {
  background: var(--color-orange);
  color: white;
}

.sbr-banner-warning {
  background: linear-gradient(135deg, #fffbf0 0%, #fffdf5 100%);
  border-color: rgba(255, 204, 0, 0.3);
  color: #8a6d00;
}

.sbr-banner-warning .sbr-banner-icon {
  background: var(--color-yellow);
  color: #5a4700;
}

.sbr-banner-active {
  background: linear-gradient(135deg, #f0f7ff 0%, #f5f9ff 100%);
  border-color: rgba(0, 122, 255, 0.2);
  color: #004eaa;
}

.sbr-banner-active .sbr-banner-icon {
  background: var(--color-blue);
  color: white;
}

.sbr-banner-resolved {
  background: linear-gradient(135deg, #f0faf4 0%, #f5fbf7 100%);
  border-color: rgba(52, 199, 89, 0.2);
  color: #1b7a38;
}

.sbr-banner-resolved .sbr-banner-icon {
  background: var(--color-green);
  color: white;
}

/* SBR table row highlights */
.sbr-row-overdue td { background: rgba(255, 59, 48, 0.03); }
.sbr-row-critical td { background: rgba(175, 82, 222, 0.03); }

/* SBR Timeline */
.sbr-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: var(--space-sm) 0;
  overflow-x: auto;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  position: relative;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-border-strong);
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-border-strong);
  z-index: 1;
  flex-shrink: 0;
}

.timeline-step.completed .timeline-dot {
  background: var(--color-green);
  box-shadow: 0 0 0 2px var(--color-green);
}

.timeline-step.overdue .timeline-dot {
  background: var(--color-red);
  box-shadow: 0 0 0 2px var(--color-red);
}

.timeline-step.failed .timeline-dot {
  background: var(--color-red);
  box-shadow: 0 0 0 2px var(--color-red);
}

.timeline-step.pending .timeline-dot {
  background: var(--color-border-strong);
  box-shadow: 0 0 0 2px var(--color-border-strong);
}

.timeline-connector {
  flex: 1;
  height: 3px;
  background: var(--color-border-strong);
  margin-top: 7px;
  min-width: 40px;
}

.timeline-connector.completed { background: var(--color-green); }
.timeline-connector.failed { background: var(--color-red); }
.timeline-connector.pending { background: var(--color-border-strong); }

.timeline-content {
  text-align: center;
  margin-top: var(--space-sm);
  max-width: 160px;
}

.timeline-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.timeline-alert {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-red);
  margin-top: 4px;
}

.timeline-info {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-blue);
  margin-top: 4px;
}

/* SBR Action Box */
.sbr-action-box {
  background: linear-gradient(135deg, #fff5f0 0%, #fff8f5 100%);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.sbr-action-box .font-semibold {
  color: var(--color-orange);
}

/* SBR Dashboard Card */
.sbr-dashboard-card {
  border-color: rgba(255, 59, 48, 0.15);
}

.text-purple { color: var(--color-purple); }

/* ============================================
   LEADS
   ============================================ */

/* Lead grade badges */
.lead-grade {
  font-weight: 800;
  font-size: 0.8rem;
  min-width: 28px;
  text-align: center;
}

.lead-grade-a { background: rgba(255, 59, 48, 0.15); color: #d70015; }
.lead-grade-b { background: rgba(255, 149, 0, 0.15); color: #c93400; }
.lead-grade-c { background: rgba(255, 204, 0, 0.15); color: #a05a00; }
.lead-grade-d { background: rgba(142, 142, 147, 0.12); color: #6e6e73; }

/* Lead score pill */
.lead-score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.lead-score-pill strong {
  font-size: 1rem;
  font-weight: 800;
}

/* Lead dimension bars (inline in table) */
.lead-bar {
  width: 60px;
  height: 6px;
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.lead-bar-lg {
  width: 100%;
  height: 10px;
}

.lead-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.lead-bar-urgency { background: var(--color-red); }
.lead-bar-likelihood { background: var(--color-orange); }
.lead-bar-actionability { background: var(--color-green); }

/* Lead row highlights — value-based tinting */
.lead-row-priority td { background: rgba(255, 59, 48, 0.03); }
.lead-row-stale td { opacity: 0.5; }
.lead-row-snoozed td { opacity: 0.6; }

/* Grade-based left accent on lead rows */
.lead-row-a td:first-child { box-shadow: inset 3px 0 0 var(--color-red); }
.lead-row-b td:first-child { box-shadow: inset 3px 0 0 var(--color-orange); }

/* Value-based row tinting — large opportunities get warmth */
.lead-row-large td { background: rgba(52, 199, 89, 0.03); }
.lead-row-large.lead-row-a td { background: rgba(255, 59, 48, 0.04); }
.lead-row-large.lead-row-b td { background: rgba(255, 149, 0, 0.03); }

/* Lead banner (detail page) */
.lead-banner {
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
  border: 1px solid;
}

.lead-banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.lead-banner-grade {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.lead-banner-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.lead-banner-detail {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 2px;
}

.lead-banner-score {
  margin-left: auto;
  text-align: center;
  flex-shrink: 0;
}

.lead-score-big {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* Grade A banner */
.lead-banner-a {
  background: linear-gradient(135deg, #fff0f0 0%, #fff5f5 100%);
  border-color: rgba(255, 59, 48, 0.25);
  color: #c9302c;
}

.lead-banner-a .lead-banner-grade {
  background: var(--color-red);
  color: white;
}

/* Grade B banner */
.lead-banner-b {
  background: linear-gradient(135deg, #fff5f0 0%, #fff8f5 100%);
  border-color: rgba(255, 149, 0, 0.25);
  color: #b35c00;
}

.lead-banner-b .lead-banner-grade {
  background: var(--color-orange);
  color: white;
}

/* Grade C banner */
.lead-banner-c {
  background: linear-gradient(135deg, #fffbf0 0%, #fffdf5 100%);
  border-color: rgba(255, 204, 0, 0.3);
  color: #8a6d00;
}

.lead-banner-c .lead-banner-grade {
  background: var(--color-yellow);
  color: #5a4700;
}

/* Grade D banner */
.lead-banner-d {
  background: linear-gradient(135deg, #f5f5f7 0%, #fafafa 100%);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

.lead-banner-d .lead-banner-grade {
  background: var(--color-border-strong);
  color: var(--color-text-secondary);
}

/* Lead dimensions (detail page) */
.lead-dimensions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (max-width: 900px) {
  .lead-dimensions { grid-template-columns: 1fr; }
}

.lead-dimension {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.lead-dimension-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.lead-dimension-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}

.lead-dimension-value {
  font-size: 1.1rem;
  font-weight: 800;
}

/* Lead signals */
.lead-signal {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.lead-signal:last-child { border-bottom: none; }

.lead-signal-key {
  min-width: 160px;
  font-weight: 600;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.lead-signal-value {
  color: var(--color-text-primary);
}

/* ── Preview Panel ── */
.lead-preview-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.lead-preview-panel.open {
  transform: translateX(0);
}

body.preview-open {
  overflow: hidden;
}

/* Lead row activity icons */
.lead-activity-icons {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
}
.activity-icon-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: help;
  background: #f3f4f6;
  transition: background 0.15s;
}
.activity-icon-dot:hover {
  background: #e0e7ff;
}
.activity-icon-called { background: #dbeafe; }
.activity-icon-emailed { background: #fef3c7; }
.activity-icon-letter_sent { background: #fef3c7; }
.activity-icon-meeting { background: #d1fae5; }
.activity-icon-note { background: #f3f4f6; }
.activity-icon-status_change { background: #ede9fe; }

/* ── Recommendation Card ── */
.recommendation-card {
  border-left: 3px solid var(--color-border);
  padding: 10px 12px;
  border-radius: 6px;
  background: #fafafa;
}
.recommendation-today      { border-left-color: #dc2626; background: #fef2f2; }
.recommendation-this_week  { border-left-color: #ea580c; background: #fff7ed; }
.recommendation-soon       { border-left-color: #d97706; background: #fffbeb; }
.recommendation-low_priority { border-left-color: #6e6e73; background: #f9fafb; }

.recommendation-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.recommendation-action-icon { font-size: 1.1rem; line-height: 1; margin-top: 2px; }
.recommendation-action { font-weight: 700; font-size: 0.88rem; }
.recommendation-contacts {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.recommendation-contact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 0;
  font-size: 0.82rem;
}
.recommendation-contact-name { font-weight: 500; }
.recommendation-talking-points {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.recommendation-talking-points ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.5;
}
.recommendation-talking-points li { margin-bottom: 2px; }

/* Table row follow-up badge */
.followup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: help;
}
.followup-today      { background: rgba(220, 38, 38, 0.15); }
.followup-this_week  { background: rgba(234, 88, 12, 0.15); }
.followup-soon       { background: rgba(217, 119, 6, 0.12); }
.followup-low_priority { background: rgba(110, 110, 115, 0.10); }

/* Preview flash confirmation */
.preview-flash {
  padding: 8px 16px;
  background: #059669;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  animation: flashIn 0.3s ease;
}
.preview-flash-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.preview-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.preview-close:hover {
  background: var(--color-fill-secondary);
  color: var(--color-text-primary);
}

.preview-section {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.preview-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.preview-dimension {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.preview-director {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  font-size: 0.9rem;
}

.preview-director + .preview-director {
  border-top: 1px solid var(--color-border);
}

/* ── Status Dots ── */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
}
td.status-dot-cell {
  width: 20px;
  min-width: 20px !important;
  padding-left: var(--space-sm);
  padding-right: 0;
  text-align: center;
}
.status-dot-blue { background: var(--color-blue); }
.status-dot-purple { background: var(--color-purple); }
.status-dot-orange { background: var(--color-orange); }
.status-dot-yellow { background: var(--color-yellow); }
.status-dot-green { background: var(--color-green); }
.status-dot-gray { background: var(--color-text-tertiary); }

/* ── Status Buttons (preview panel) ── */
.btn-status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.15s;
}
.btn-status:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
}
.btn-status-active {
  background: var(--color-blue);
  color: white;
  border-color: var(--color-blue);
}

/* ── Lead Actions Dropdown ── */
.lead-actions {
  position: relative;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 1.1rem;
  color: var(--color-text-tertiary);
  border-radius: var(--radius-sm);
  line-height: 1;
}
.btn-icon:hover {
  background: var(--color-fill-secondary);
  color: var(--color-text-primary);
}

.lead-actions-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: var(--space-xs) 0;
  margin-top: 4px;
}

.lead-actions-menu.open {
  display: block;
}

.lead-actions-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  font-size: 0.8rem;
  border: none;
  background: none;
  color: var(--color-text-primary);
  cursor: pointer;
  text-decoration: none;
}
.lead-actions-item:hover {
  background: var(--color-fill-secondary);
}
.lead-actions-item.active {
  color: var(--color-blue);
  font-weight: 600;
}

.lead-actions-group {
  padding: 0 0 var(--space-xs);
}

.lead-actions-label {
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
}

.lead-actions-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-xs) 0;
}

/* ── Compact Lead Row ── */
.lead-score-cell {
  white-space: nowrap;
  min-width: auto !important;
}
.lead-score-num {
  font-size: 0.95rem;
  font-weight: 800;
}
.score-a { color: #d70015; }
.score-b { color: #c93400; }
.score-c { color: #a05a00; }
.score-d { color: var(--color-text-tertiary); }
.lead-grade-sm {
  width: 22px;
  height: 22px;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lead-company-link {
  font-weight: 600;
  font-size: 0.9rem;
}
.lead-row-meta {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  margin-top: 1px;
}
.lead-row-meta code {
  font-size: 0.7rem;
  padding: 0 3px;
}

/* ── Inline Status Select ── */
.status-select {
  font-size: 0.8rem;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  width: 100%;
  appearance: auto;
}
.status-select-new { border-color: var(--color-blue); color: var(--color-blue); }
.status-select-reviewing { border-color: var(--color-purple); color: #8944ab; }
.status-select-contacted { border-color: var(--color-orange); color: #c93400; }
.status-select-in_progress { border-color: var(--color-yellow); color: #a05a00; }
.status-select-won { border-color: var(--color-green); color: #248a3d; background: rgba(52, 199, 89, 0.08); }
.status-select-lost { border-color: var(--color-text-tertiary); color: var(--color-text-tertiary); }
.status-select-dismissed { border-color: var(--color-text-tertiary); color: var(--color-text-tertiary); }

/* ── Activity Form ── */
.activity-form {
  margin: 0;
}
.activity-type-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.activity-pill {
  cursor: pointer;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.activity-pill input[type="radio"] {
  display: none;
}
.activity-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: #fff;
  transition: all 0.15s;
  white-space: nowrap;
}
.activity-pill input[type="radio"]:checked + span {
  background: var(--color-blue);
  color: white;
  border-color: var(--color-blue);
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.3);
}
.activity-pill:hover span {
  border-color: var(--color-blue);
  background: #f0f5ff;
}
.activity-pill input[type="radio"]:checked + span:hover {
  background: var(--color-blue);
}
.activity-input-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.activity-note-input {
  flex: 1;
  border: none !important;
  outline: none;
  padding: 7px 10px;
  font-size: 0.82rem;
  background: transparent;
  margin: 0;
}
.activity-note-input:focus {
  box-shadow: none;
}
.activity-log-btn {
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--color-blue);
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.activity-log-btn:hover {
  background: #1e40af;
}

/* ── Activity Timeline ── */
.activity-timeline {
  max-height: 300px;
  overflow-y: auto;
}
.activity-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}
.activity-item + .activity-item {
  border-top: 1px solid var(--color-border);
}
.activity-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.activity-content {
  flex: 1;
  min-width: 0;
}
.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
}

/* ── Keyboard Nav ── */
.lead-row-focused {
  outline: 2px solid var(--color-blue);
  outline-offset: -2px;
  background: rgba(0, 122, 255, 0.04) !important;
}

/* ── Small Button ── */
.btn-sm {
  font-size: 0.8rem;
  padding: 4px 12px;
  height: 32px;
}

.btn-primary {
  background: var(--color-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .lead-preview-panel {
    width: 100%;
  }
}

/* Heatmap table */
.heatmap-table td {
  padding: 0.4rem 0.5rem;
  border: 2px solid #fff;
  transition: opacity 0.15s;
  min-width: 50px;
}
.heatmap-table td:hover {
  opacity: 0.8;
}
.heatmap-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Risk tooltip */
.risk-tooltip-wrap {
  position: relative;
  display: inline-block;
  cursor: help;
}
.risk-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  width: 260px;
  white-space: normal;
  z-index: 100;
  pointer-events: none;
  text-align: left;
}
.risk-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.92);
}
.risk-tooltip-wrap:hover .risk-tooltip {
  display: block;
}
.risk-tooltip-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.risk-tooltip-body > div:first-child {
  color: #d1d5db;
  margin-bottom: 6px;
}
.risk-tooltip-stats {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 6px;
  margin-top: 2px;
}
.risk-tooltip-stat {
  color: #e5e7eb;
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ── Today Page ── */

.today-section {
  margin-bottom: var(--space-xl);
}

/* ============================================
   TOP 3 TODAY — ownership + progress + stakes
   ============================================ */

.top-today-card {
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.04) 0%, var(--color-surface) 60%);
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-left: 4px solid var(--color-blue);
  border-radius: 12px;
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.top-today-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.top-today-title {
  margin: 0 0 4px 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.top-today-sub {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  max-width: 60ch;
}

.top-today-progress {
  min-width: 220px;
  flex: 0 0 auto;
}

.top-today-progress-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  text-align: right;
}

.top-today-progress-meta strong {
  color: var(--color-text-primary);
  font-size: 1rem;
}

.top-today-progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.top-today-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-blue), #3b82f6);
  transition: width 300ms ease;
}

.top-today-complete {
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: rgba(52, 199, 89, 0.08);
  border: 1px solid rgba(52, 199, 89, 0.25);
  color: #1f7a3d;
  border-radius: 8px;
  font-size: 0.9rem;
}

.top-today-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.top-today-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 150ms ease, background 150ms ease;
}

.top-today-item:hover {
  border-color: rgba(29, 78, 216, 0.35);
}

.top-today-item-done {
  opacity: 0.6;
  background: rgba(52, 199, 89, 0.04);
}

.top-today-rank {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-blue);
  text-align: center;
  line-height: 1;
  padding-top: 2px;
}

.top-today-body {
  min-width: 0;
}

.top-today-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.top-today-company {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-primary);
  text-decoration: none;
}

.top-today-company:hover {
  color: var(--color-blue);
}

.top-today-value {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1f7a3d;
}

.top-today-why {
  font-size: 0.85rem;
  color: var(--color-text-primary);
  margin: 2px 0;
  line-height: 1.4;
}

.top-today-stakes {
  font-size: 0.82rem;
  color: #b45309;
  background: rgba(251, 191, 36, 0.08);
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 4px;
  line-height: 1.4;
}

.top-today-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  min-width: 140px;
}

.top-today-action-form {
  display: flex;
  gap: 4px;
}

.top-today-action-form .today-action-btn {
  flex: 1;
}

.top-today-done-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1f7a3d;
  text-align: center;
  padding: 2px 6px;
}

.top-today-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

@media (max-width: 768px) {
  .top-today-item {
    grid-template-columns: 1fr;
  }
  .top-today-rank {
    text-align: left;
  }
  .top-today-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
  .top-today-value {
    margin-left: 0;
  }
}

.today-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border);
}
.today-section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.today-section-now h2 { color: #dc2626; }
.today-section-now { border-bottom-color: #dc2626; }
.today-section-week h2 { color: #ea580c; }
.today-section-week { border-bottom-color: #ea580c; }
.today-section-followup h2 { color: #6366f1; }
.today-section-followup { border-bottom-color: #6366f1; }

.today-section-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.today-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--color-fill-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.today-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.today-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: var(--space-md) var(--space-lg);
  transition: box-shadow 0.15s;
}
.today-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.today-card-priority {
  border-left: 3px solid #dc2626;
}

.today-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.today-card-identity {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.today-card-company {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}
.today-card-company a {
  color: var(--color-text-primary);
  text-decoration: none;
}
.today-card-company a:hover {
  color: var(--color-blue);
}

.today-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-top: 2px;
}

.today-card-score {
  flex-shrink: 0;
}

.today-score-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-fill-secondary);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-text-primary);
}

.today-card-recommendation {
  margin: var(--space-sm) 0;
}
.today-card-recommendation .recommendation-header {
  gap: var(--space-sm);
}

.today-card-contacts {
  display: flex;
  gap: var(--space-lg);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.today-contact {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.today-card-points {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.today-point {
  font-size: 0.8rem;
  color: #4b5563;
  padding: 1px 0;
}
.today-point::before {
  content: "• ";
  color: #9ca3af;
}

.today-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.today-action-buttons {
  display: flex;
  gap: 6px;
}

.today-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
}
.today-action-btn:hover {
  background: var(--color-fill-secondary);
  color: var(--color-text-primary);
}
.today-action-call:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.today-action-email:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.today-action-note:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}
.today-action-dismiss {
  color: #9ca3af;
  border-color: transparent;
}
.today-action-dismiss:hover {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.today-card-last-activity {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   COMMAND CENTRE — Motion & Depth Enhancements
   ============================================ */

/* Staggered fade-in for stat cards */
@keyframes slide-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-grid .stat-card {
  animation: slide-fade-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: 0ms; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 50ms; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 100ms; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 150ms; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 200ms; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 250ms; }

/* Cards fade in */
.card {
  animation: slide-fade-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 100ms both;
}

/* Table rows stagger in (first 15) */
@keyframes row-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

table tbody tr { animation: row-fade-in 0.3s ease both; }
table tbody tr:nth-child(1) { animation-delay: 0ms; }
table tbody tr:nth-child(2) { animation-delay: 20ms; }
table tbody tr:nth-child(3) { animation-delay: 40ms; }
table tbody tr:nth-child(4) { animation-delay: 60ms; }
table tbody tr:nth-child(5) { animation-delay: 80ms; }
table tbody tr:nth-child(6) { animation-delay: 100ms; }
table tbody tr:nth-child(7) { animation-delay: 120ms; }
table tbody tr:nth-child(8) { animation-delay: 140ms; }
table tbody tr:nth-child(9) { animation-delay: 160ms; }
table tbody tr:nth-child(10) { animation-delay: 180ms; }
table tbody tr:nth-child(11) { animation-delay: 200ms; }
table tbody tr:nth-child(12) { animation-delay: 220ms; }
table tbody tr:nth-child(13) { animation-delay: 240ms; }
table tbody tr:nth-child(14) { animation-delay: 260ms; }
table tbody tr:nth-child(15) { animation-delay: 280ms; }

/* Stat card hover — urgent red shadow */
.stat-card.urgent:hover {
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Pulse animation for urgent elements */
@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.08); }
}

.stat-card.urgent {
  animation: slide-fade-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both,
             pulse-urgent 2.5s cubic-bezier(0.4, 0, 0.6, 1) 0.5s infinite;
}

.badge-pulse {
  animation: pulse-urgent 2s ease-in-out infinite;
}

.sidebar-nav .nav-badge {
  animation: pulse-urgent 2.5s ease-in-out 1s infinite;
}

/* Progress/strength bar enhancements */
@keyframes bar-fill-in {
  from { transform: scaleX(0); }
}

.lead-bar { height: 8px; }
.lead-bar-lg { height: 12px; }

.lead-bar-fill {
  transform-origin: left;
  animation: bar-fill-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.lead-bar-urgency { background: linear-gradient(90deg, #ff6b6b, #ff3b30); }

.risk-meter .bar-track { height: 8px; }
.risk-meter .bar-fill {
  transform-origin: left;
  animation: bar-fill-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Court listing row tinting */
.court-listing-ato {
  background: rgba(255, 59, 48, 0.03);
  border-left: 3px solid var(--color-red);
}

/* Early warning row tinting — high-strength warnings stand out */
.warning-row-critical {
  background: rgba(255, 59, 48, 0.04);
  border-left: 3px solid var(--color-red);
}
.warning-row-high {
  background: rgba(255, 149, 0, 0.03);
  border-left: 3px solid var(--color-orange);
}
.warning-row-medium {
  border-left: 3px solid var(--color-yellow);
}

/* Strength bars (early warnings) */
.strength-bar-fill {
  transform-origin: left;
  animation: bar-fill-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Page header treatment */
.page-header h1 {
  background: linear-gradient(180deg, #1d1d1f, #3a3a3c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.page-header h1::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-blue), var(--color-purple));
  border-radius: var(--radius-full);
}

/* Table row hover — left accent border */
table tbody tr:hover {
  box-shadow: inset 3px 0 0 var(--color-blue);
}

/* Better empty states */
.empty-state .empty-icon {
  font-size: 3rem;
  width: 80px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-secondary);
  border-radius: 50%;
  margin-bottom: var(--space-lg);
  opacity: 0.7;
}

.empty-state p {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* Filter pills */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.filter-pills:empty { display: none; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 12px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--color-blue);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  animation: slide-fade-in 0.2s ease both;
}

.filter-pill .pill-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 122, 255, 0.1);
  color: var(--color-blue);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0;
  transition: background var(--transition-fast);
}

.filter-pill .pill-dismiss:hover {
  background: rgba(0, 122, 255, 0.2);
}

/* Trend indicators */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.trend-up {
  background: rgba(52, 199, 89, 0.1);
  color: #248a3d;
}

.trend-up::before { content: "▲ "; font-size: 0.55rem; }

.trend-down {
  background: rgba(255, 59, 48, 0.1);
  color: #d70015;
}

.trend-down::before { content: "▼ "; font-size: 0.55rem; }

.trend-neutral {
  background: rgba(142, 142, 147, 0.1);
  color: var(--color-text-secondary);
}

/* Counter animation — numbers count up */
[data-controller="counter"] {
  display: inline-block;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .stats-grid .stat-card,
  .card,
  table tbody tr,
  .lead-bar-fill,
  .risk-meter .bar-fill,
  .strength-bar-fill,
  .filter-pill {
    animation: none !important;
  }

  .stat-card.urgent {
    animation: none !important;
  }

  .sidebar-nav .nav-badge,
  .badge-pulse {
    animation: none !important;
  }

  .stat-card:hover {
    transform: none;
  }
}

/* Company intelligence strip on court listings */
.intel-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--pico-card-sectioning-background-color);
  border-radius: 6px;
  border-left: 3px solid var(--color-blue);
}

/* AI opportunity assessment strip */
.ai-assessment {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--pico-card-sectioning-background-color);
  font-size: 0.85rem;
  line-height: 1.5;
}
.ai-assessment-priority { border-left: 3px solid var(--color-red); }
.ai-assessment-prospect { border-left: 3px solid var(--color-orange); }
.ai-assessment-monitor { border-left: 3px solid var(--color-yellow); }
.ai-assessment-low { border-left: 3px solid var(--color-gray); }
.ai-assessment .ai-action {
  margin-top: 4px;
  font-weight: 500;
  font-size: 0.8rem;
}
.ai-assessment .ai-factors {
  margin: 4px 0 0 0;
  padding-left: 16px;
  font-size: 0.8rem;
  color: var(--pico-secondary-color);
}
.ai-assessment .ai-factors li {
  margin-bottom: 2px;
}

/* Collapsible sections */
.collapsible-content { transition: max-height 0.3s ease, opacity 0.2s ease; overflow: hidden; }
.collapsible-content.collapsed { max-height: 0 !important; opacity: 0; padding-top: 0; padding-bottom: 0; }
.collapse-toggle { cursor: pointer; user-select: none; }
.collapse-icon { display: inline-block; transition: transform 0.2s ease; font-size: 0.75rem; }
.collapse-icon.rotated { transform: rotate(-90deg); }

/* Action plan briefing links */
.briefing-link { text-decoration: none; color: inherit; display: block; }
.briefing-link:hover { background: var(--pico-card-sectioning-background-color); }

/* ============================================
   PUBLIC PAGES — Landing, Auth
   ============================================ */

.public-body {
  background: #ffffff;
  margin: 0;
  padding: 0;
}

/* ── Header ── */

.public-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.public-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.public-nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
}

.public-nav-links a:hover {
  color: var(--color-text-primary);
}

.public-nav-links a.public-btn-primary,
.public-nav-links a.public-btn-primary:hover {
  color: #ffffff;
}

.public-nav-links a.public-btn-outline {
  color: #1d4ed8;
}

/* ── Logo ── */

.public-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: 18px;
}

.public-logo-text {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
}

/* ── Buttons ── */

.public-btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.public-btn-primary:hover {
  background: #1e40af;
  color: #ffffff;
}

.public-btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--color-border-strong);
  transition: border-color 0.15s ease;
}

.public-btn-secondary:hover {
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}

.public-btn-outline {
  display: inline-block;
  padding: 6px 16px;
  background: transparent;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid #1d4ed8;
  transition: all 0.15s ease;
}

.public-btn-outline:hover {
  background: #1d4ed8;
  color: #ffffff;
}

/* ── Hero ── */

.public-btn-lg {
  padding: 14px 32px;
  font-size: 0.95rem;
}

.public-hero {
  padding: 72px 0 0;
  text-align: center;
  background: linear-gradient(180deg, #f8faff 0%, #eef2ff 50%, #ffffff 100%);
  overflow: hidden;
}

.public-hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(29, 78, 216, 0.08);
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.3px;
}

.public-hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-text-primary);
  letter-spacing: -1.5px;
  margin: 0 0 var(--space-lg);
}

.public-hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto var(--space-xl);
}

.public-hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: 48px;
}

/* ── Dashboard Preview Window ── */

.public-hero-preview {
  max-width: 700px;
  margin: 0 auto;
  perspective: 1000px;
}

.public-preview-window {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transform: rotateX(2deg);
  transform-origin: center top;
}

.public-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.public-preview-dots {
  display: flex;
  gap: 6px;
}

.public-preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5e7eb;
}

.public-preview-dots span:first-child { background: #fca5a5; }
.public-preview-dots span:nth-child(2) { background: #fde68a; }
.public-preview-dots span:last-child { background: #86efac; }

.public-preview-url {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 4px 12px;
  border-radius: 4px;
}

.public-preview-body {
  padding: 20px 24px 24px;
}

.public-preview-header {
  margin-bottom: 16px;
}

.public-preview-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.public-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.public-preview-card-count {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.public-preview-card-red .public-preview-card-count { background: #dc2626; }
.public-preview-card-orange .public-preview-card-count { background: #f59e0b; }
.public-preview-card-blue .public-preview-card-count { background: #1d4ed8; }

/* ── Live Numbers Bar ── */

.public-numbers {
  padding: 48px 0;
  background: #111827;
  color: #ffffff;
}

.public-numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
}

.public-number-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #ffffff;
  line-height: 1.2;
}

.public-number-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.public-numbers-note {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Dark Section ── */

.public-section-dark {
  background: #0f172a;
  padding: 72px 0;
}

.public-steps-dark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 900px;
  margin: 0 auto;
}

.public-step-dark {
  text-align: center;
  padding: var(--space-lg);
}

.public-step-number-dark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(29, 78, 216, 0.2);
  border: 2px solid rgba(29, 78, 216, 0.4);
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.public-step-dark h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
}

.public-step-dark p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin: 0;
}

/* ── Feature enhancements ── */

.public-feature-card-highlight {
  border-color: rgba(29, 78, 216, 0.2);
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
}

.public-feature-stat {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: #1d4ed8;
}

/* ── Sections ── */

.public-section {
  padding: 64px 0;
}

.public-section-alt {
  background: #f8fafc;
}

.public-section-cta {
  padding: 80px 0;
  background: linear-gradient(180deg, #f8faff 0%, #eef2ff 100%);
}

.public-section-header {
  text-align: center;
  margin-bottom: 48px;
}

.public-section-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.public-section-header p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ── Features Grid ── */

.public-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.public-feature-card {
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.public-feature-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.public-feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: var(--space-md) 0 8px;
  color: var(--color-text-primary);
}

.public-feature-card p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.public-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-feature-icon-blue { background: rgba(29, 78, 216, 0.08); color: #1d4ed8; }
.public-feature-icon-red { background: rgba(220, 38, 38, 0.08); color: #dc2626; }
.public-feature-icon-orange { background: rgba(245, 158, 11, 0.08); color: #d97706; }
.public-feature-icon-green { background: rgba(22, 163, 74, 0.08); color: #16a34a; }
.public-feature-icon-purple { background: rgba(147, 51, 234, 0.08); color: #9333ea; }
.public-feature-icon-teal { background: rgba(6, 182, 212, 0.08); color: #0891b2; }

/* ── Steps ── */

.public-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.public-step {
  flex: 1;
  text-align: center;
  padding: 0 var(--space-lg);
}

.public-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.public-step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.public-step p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.public-step-connector {
  width: 60px;
  height: 2px;
  background: var(--color-border-strong);
  margin-top: 20px;
  flex-shrink: 0;
}

/* ── Data Sources ── */

.public-data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.public-data-item {
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
}

.public-data-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-text-primary);
}

.public-data-item span {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ── Footer ── */

.public-footer {
  background: #111827;
  padding: 48px 0 24px;
  color: #ffffff;
}

.public-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.public-footer .public-logo-text {
  color: #ffffff;
}

.public-footer-links {
  display: flex;
  gap: var(--space-lg);
}

.public-footer-links a {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.public-footer-links a:hover {
  color: #ffffff;
}

.public-footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.public-footer-bottom small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

/* ── Owner-facing homepage (SBR/distress audience) ── */

.public-nav-quiet {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
  margin-left: 12px;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  padding-left: 12px;
}

.public-nav-quiet:hover {
  color: #1d4ed8;
}

.owner-hero {
  background: #0f172a;
  text-align: center;
  padding: 96px 0 80px;
  position: relative;
  overflow: hidden;
}

.owner-hero-content {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.62) 0%, rgba(15, 23, 42, 0.78) 60%, rgba(15, 23, 42, 0.88) 100%);
}

.owner-hero .public-hero-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.owner-hero h1 {
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.owner-hero .public-hero-subtitle {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.owner-hero .owner-hero-secondary {
  color: rgba(255, 255, 255, 0.78);
}

.owner-hero .owner-hero-trust {
  color: rgba(255, 255, 255, 0.7);
}

.owner-hero .public-btn-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.owner-hero .public-btn-secondary:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.owner-hero-content h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 16px 0 20px;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.owner-hero-secondary {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.owner-hero-trust {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.owner-eligibility .public-section-header {
  margin-bottom: 32px;
}

.owner-eligibility-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.owner-eligibility-item {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px 24px;
  position: relative;
}

.owner-eligibility-num {
  position: absolute;
  top: -16px;
  left: 24px;
  width: 36px;
  height: 36px;
  background: #1d4ed8;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.owner-eligibility-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 0 10px;
  color: #0f172a;
}

.owner-eligibility-item p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

.owner-eligibility-cta {
  text-align: center;
  margin-top: 8px;
}

.owner-eligibility-cta p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.owner-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.owner-pillar {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px 24px;
  border-top: 3px solid #1d4ed8;
}

.owner-pillar h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: #0f172a;
}

.owner-pillar p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}

.owner-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.owner-option-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.owner-option-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: #0f172a;
}

.owner-option-card p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
}

.owner-option-when {
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.owner-option-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(29, 78, 216, 0.08);
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.owner-options-grid {
  grid-template-columns: repeat(3, 1fr);
}

.owner-why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.owner-why-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px 24px;
}

.owner-why-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: #0f172a;
}

.owner-why-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}

.owner-why-founder {
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  padding: 18px 24px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.owner-why-founder strong {
  color: #0f172a;
}

.owner-contact-offices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 720px;
  margin: 36px auto 0;
}

.owner-contact-office {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  text-align: left;
}

.owner-contact-office strong {
  display: block;
  color: #0f172a;
  font-size: 1rem;
  margin-bottom: 6px;
}

.owner-contact-office div {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.owner-contact-office a {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}

.owner-choose-grid,
.owner-traps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.owner-choose-card,
.owner-trap-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.owner-trap-card {
  border-left: 3px solid #dc2626;
}

.owner-choose-card h3,
.owner-trap-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #0f172a;
}

.owner-choose-card p,
.owner-trap-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

.owner-faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.owner-faq-item {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 20px;
}

.owner-faq-item summary {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.owner-faq-item summary::-webkit-details-marker { display: none; }

.owner-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: #6b7280;
  line-height: 1;
}

.owner-faq-item[open] summary::after {
  content: "−";
}

.owner-faq-item p {
  margin: 12px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.owner-contact-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.owner-contact-trust {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

@media (max-width: 1024px) {
  .owner-options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 880px) {
  .owner-eligibility-grid,
  .owner-pillars,
  .owner-choose-grid,
  .owner-traps-grid,
  .owner-why-grid {
    grid-template-columns: 1fr;
  }
  .owner-options-grid {
    grid-template-columns: 1fr;
  }
  .owner-contact-offices {
    grid-template-columns: 1fr;
  }
}

/* ── Auth Pages ── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: var(--space-lg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-text-primary);
}

.auth-submit {
  width: 100%;
  padding: 12px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-submit:hover {
  background: #1e40af;
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* ── Public Responsive ── */

@media (max-width: 768px) {
  .public-hero-content h1 { font-size: 1.8rem; }
  .public-features-grid { grid-template-columns: 1fr; }
  .public-data-grid { grid-template-columns: 1fr; }
  .public-steps-dark { grid-template-columns: 1fr; }
  .public-numbers-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
  .public-nav-links a:not(.public-btn-outline) { display: none; }
  .public-footer-content { flex-direction: column; gap: var(--space-lg); }
  .public-hero-preview { display: none; }
  .auth-card { padding: 28px 24px; }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .public-features-grid { grid-template-columns: repeat(2, 1fr); }
  .public-data-grid { grid-template-columns: repeat(2, 1fr); }
  .public-steps-dark { grid-template-columns: repeat(3, 1fr); }
}

/* Contact channels (shared/_company_contacts) */
.contact-group { display: flex; gap: var(--space-md); align-items: flex-start; padding: var(--space-xs) 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.contact-group:last-child { border-bottom: none; }
.contact-group-label { width: 80px; flex-shrink: 0; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; padding-top: 6px; }
.contact-group-items { display: flex; flex-wrap: wrap; gap: var(--space-xs); flex: 1; }
.contact-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 16px; font-size: 0.85rem; text-decoration: none; border: 1px solid var(--pico-muted-border-color); background: var(--pico-card-sectionning-background-color); color: var(--text-primary); transition: border-color 0.15s, background-color 0.15s; }
.contact-chip:hover { border-color: var(--color-blue); background: rgba(59, 130, 246, 0.08); text-decoration: none; }
.contact-chip-high { border-color: rgba(34, 197, 94, 0.35); }
.contact-chip-medium { border-color: rgba(251, 191, 36, 0.35); }
.contact-chip-low { border-color: rgba(107, 114, 128, 0.35); opacity: 0.85; }
.contact-chip-value { font-family: var(--font-mono, monospace); }
.contact-chip-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); background: rgba(0,0,0,0.04); padding: 1px 6px; border-radius: 8px; }

/* Top-3 Today contact mini-badges */
.top-today-contacts { display: inline-flex; gap: 6px; font-size: 0.7rem; margin-left: auto; }
.top-today-contact-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 10px; background: rgba(34, 197, 94, 0.12); color: #166534; border: 1px solid rgba(34, 197, 94, 0.25); font-weight: 600; }
.top-today-contact-badge-muted { background: rgba(107, 114, 128, 0.08); color: var(--text-tertiary); border-color: var(--pico-muted-border-color); }

@media (max-width: 640px) {
  .contact-group { flex-direction: column; gap: var(--space-xs); }
  .contact-group-label { width: auto; padding-top: 0; }
}


/* Director contact research pills (DirectorContactHelper) */
.contact-pill {
  display: inline-block;
  padding: 3px 10px;
  margin: 2px;
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 12px;
  color: var(--text-primary);
  background: var(--pico-card-sectionning-background-color);
  transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.contact-pill:hover {
  border-color: var(--color-blue);
  background: rgba(59, 130, 246, 0.08);
  text-decoration: none;
  transform: translateY(-1px);
}
.contact-channel-row .contact-pill { font-size: 0.75rem; padding: 2px 8px; }
.contact-channel-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* Research panel — directors-with-fallback aggregator */
.research-panel { margin-top: 8px; }
.research-panel-header { margin-bottom: 4px; }
.research-panel-row { margin-bottom: 6px; }
.research-panel-row:last-child { margin-bottom: 0; }
.research-panel-name { font-size: 0.85rem; font-weight: 600; margin-right: 6px; }
