/* AllPro Command Console — Design System
   Light-mode only, AllPro blue palette, CAZ+Rainmaker2OS hybrid */

:root {
  --bg:          #f5f7fa;
  --bg-card:     #ffffff;
  --bg-sidebar:  #ffffff;
  --bg-hover:    #f0f2f5;
  --bg-input:    #f5f7fa;
  --blue:        #1565c0;
  --blue-dark:   #0d47a1;
  --blue-light:  #1976d2;
  --blue-accent:  #42a5f5;
  --blue-bg:     rgba(21, 101, 192, 0.06);
  --blue-border: rgba(21, 101, 192, 0.15);
  --green:       #059669;
  --green-bg:    rgba(5, 150, 105, 0.08);
  --red:         #dc2626;
  --red-bg:      rgba(220, 38, 38, 0.08);
  --orange:      #d97706;
  --orange-bg:   rgba(217, 119, 6, 0.08);
  --purple:      #7c3aed;
  --purple-bg:   rgba(124, 58, 237, 0.08);
  --cyan:        #0891b2;
  --text-primary:   #1a1d2e;
  --text-secondary: #4a5068;
  --text-muted:     #8890a4;
  --border:       #e2e5ec;
  --border-light: #d0d5e0;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.08);
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 250px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  overflow: hidden;
}

/* ── App Layout ── */
.app-shell { display: flex; height: 100dvh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 200;
}
.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-logo img {
  width: 160px;
  height: auto;
  object-fit: contain;
}
.sidebar-logo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-dark);
  letter-spacing: -0.01em;
}
.sidebar-subtitle {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
  font-weight: 600;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.nav-link.active {
  color: var(--blue);
  background: var(--blue-bg);
  border-color: var(--blue-border);
  font-weight: 600;
}
.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.5;
}
.nav-link.active svg { opacity: 1; }
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ── Mobile ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
}
.hamburger {
  background: none; border: none; color: var(--text-primary);
  cursor: pointer; padding: 4px;
}
.mobile-logo {
  font-size: 14px; font-weight: 800;
  color: var(--blue-dark);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 199;
}

/* ── Main Content ── */
.main-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.main-area::-webkit-scrollbar { width: 8px; }
.main-area::-webkit-scrollbar-track { background: transparent; }
.main-area::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.page-view {
  display: none;
  padding: 28px 32px;
  max-width: 1600px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}
.page-view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Headers ── */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.kpi-card:hover {
  border-color: var(--blue-border);
  box-shadow: var(--shadow-md);
}
.kpi-highlight {
  border-color: var(--blue-border);
  background: linear-gradient(135deg, rgba(21,101,192,0.03), rgba(66,165,245,0.04));
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.kpi-highlight .kpi-value { color: var(--blue); }
.kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Filter Bar ── */
.filter-section { margin-bottom: 20px; }
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.search-input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 13px; width: 100%;
  font-family: var(--font);
}
.search-input::placeholder { color: var(--text-muted); }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239ca3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}
.filter-select:hover { border-color: var(--border-light); }
.filter-select:focus { border-color: var(--blue-light); }
.filter-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }

/* ── Pipeline Search + Filter Toolbar ── */
.pipeline-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.pipeline-search-wrap {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px;
  position: relative;
}
.pipeline-search {
  width: 100%; padding: 7px 12px 7px 30px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; background: var(--bg-input); color: var(--text-primary);
  transition: border-color 0.15s;
}
.pipeline-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.pipeline-search-wrap svg { position: absolute; left: 10px; pointer-events: none; }
.pipeline-search-count {
  position: absolute; right: 10px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); pointer-events: none;
}
.pipeline-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pipeline-filters .filter-group { display: flex; align-items: center; gap: 4px; }
.pipeline-filters .filter-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
}
.pipeline-filters .filter-select {
  padding: 5px 8px; font-size: 12px; border: 1px solid var(--border);
  border-radius: 5px; background: #fff; color: var(--text-primary); cursor: pointer;
}
.pipeline-filters .filter-select:focus { border-color: var(--blue); outline: none; }
.filter-clear-btn {
  padding: 4px 10px; font-size: 11px; font-weight: 600; color: #dc2626;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 5px;
  cursor: pointer; transition: all 0.15s;
}
.filter-clear-btn:hover { background: #fee2e2; }
.pipeline-filtered-label {
  font-size: 12px; font-weight: 600; color: var(--blue);
  background: #eff6ff; padding: 2px 8px; border-radius: 10px; margin-left: 8px;
}

/* ── Detail Tabs ── */
.detail-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 14px;
}
.detail-tab {
  padding: 8px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.15s; background: none; border-top: none;
  border-left: none; border-right: none; white-space: nowrap;
}
.detail-tab:hover { color: var(--text-primary); }
.detail-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.detail-tab-content { display: none; }
.detail-tab-content.active { display: block; }

/* ── Split Panel Layout (CAZ-style) ── */
.split-panel {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  height: calc(100vh - 280px);
  min-height: 500px;
  margin-bottom: 24px;
}

/* Table Panel */
.table-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.sort-controls { display: flex; gap: 4px; }
.sort-btn {
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 500;
  color: var(--text-secondary); background: none; border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition); font-family: var(--font);
}
.sort-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.sort-btn.active { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-border); }

.table-scroll { flex: 1; overflow-y: auto; }
.table-scroll::-webkit-scrollbar { width: 6px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { position: sticky; top: 0; background: var(--bg-card); z-index: 2; }
.data-table th {
  padding: 8px 10px; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 8px 10px; font-size: 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.data-table tbody tr { cursor: pointer; transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr.selected { background: var(--blue-bg); border-left: 3px solid var(--blue); }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.page-btn {
  padding: 4px 10px; border-radius: var(--radius); font-size: 12px;
  color: var(--text-secondary); background: none; border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition); font-family: var(--font);
}
.page-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }

/* Detail Panel */
.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.mobile-detail-close { display: none; }
.detail-panel::-webkit-scrollbar { width: 6px; }
.detail-panel::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.detail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 12px; color: var(--text-muted); font-size: 13px;
}
.detail-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.detail-meta { font-size: 12px; color: var(--text-secondary); }
.detail-score-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.detail-score-big { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; color: var(--blue); }
.detail-score-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.detail-body { padding: 16px 20px; }
.detail-section { margin-bottom: 20px; }
.detail-section-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-item-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-item-value { font-size: 13px; color: var(--text-primary); font-weight: 500; }

/* ── Badges ── */
.badge {
  display: inline-flex; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(5,150,105,0.2); }
.badge-orange { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(217,119,6,0.2); }
.badge-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(220,38,38,0.2); }
.badge-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(124,58,237,0.15); }
.badge-grey   { background: rgba(136,144,164,0.1); color: var(--text-secondary); border: 1px solid rgba(136,144,164,0.2); }

/* ── Source Badges (Caz + AllPro) ── */
.badge-allpro {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}
.badge-caz-priority {
  background: linear-gradient(135deg, rgba(217,119,6,0.10), rgba(180,83,9,0.08));
  color: #b45309;
  border: 1px solid rgba(180,83,9,0.25);
}
.badge-caz-watchlist {
  background: rgba(13,148,136,0.08);
  color: #0d9488;
  border: 1px solid rgba(13,148,136,0.2);
}
.badge-caz-exploratory {
  background: rgba(136,144,164,0.08);
  color: #6b7280;
  border: 1px solid rgba(136,144,164,0.18);
}

/* ── Score Bars ── */
.score-bar-wrap { margin-bottom: 6px; }
.score-bar-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-secondary); margin-bottom: 3px; }
.score-bar-track { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; background: var(--blue-light); }

/* ── Tag List ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 500;
  background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border);
}
.tag-highlight { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }

/* ── Charts Section ── */
.charts-section { margin-bottom: 24px; }
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all var(--transition);
  border: 1px solid transparent; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
  color: white; border-color: var(--blue);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-light), var(--blue-accent));
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(21,101,192,0.25);
}
.btn-secondary {
  background: var(--bg-input); color: var(--text-primary); border-color: var(--border-light);
}
.btn-secondary:hover { background: var(--border); border-color: var(--blue-light); }
.btn-ghost {
  background: transparent; color: var(--text-secondary); border-color: var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); background: var(--bg-hover); }
.btn-ai {
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(8,145,178,0.06));
  color: var(--purple); border-color: rgba(124,58,237,0.2);
}
.btn-ai:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(8,145,178,0.12));
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124,58,237,0.15);
}
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ── Forms ── */
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--blue-light); }

/* ── Map Page ── */
.map-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 120px);
  gap: 0;
}
#mapElement {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border: 1px solid var(--border);
  z-index: 1;
}
.map-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  overflow-y: auto;
  padding: 20px;
}
.map-sidebar::-webkit-scrollbar { width: 6px; }
.map-sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* Map sidebar clickable rows */
.map-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.15s;
}
.map-summary-row:hover { background: var(--bg-hover); }

/* ── Map Slide Drawer ── */
#mapDrawer {
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
#mapDrawer.open {
  display: block !important;
  transform: translateX(0) !important;
}
#mapDrawerOverlay.open {
  display: block !important;
}
.map-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.map-drawer-close {
  width: 32px; height: 32px;
  border: none; background: var(--bg-input);
  border-radius: 8px; cursor: pointer;
  font-size: 18px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.map-drawer-close:hover { background: var(--border); }
.map-drawer-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.map-drawer-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.map-drawer-section {
  margin-bottom: 16px;
}
.map-drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.map-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.map-drawer-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.map-drawer-field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
/* Workflow action buttons in drawer */
.map-workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.map-workflow-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-input);
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.15s;
  line-height: 1.3;
}
.map-workflow-btn:hover {
  border-color: var(--blue-border);
  background: rgba(21,101,192,0.06);
  color: var(--blue);
  transform: translateY(-1px);
}
.map-workflow-btn .btn-icon { font-size: 20px; }
.map-workflow-btn.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  grid-column: 1 / -1;
}
.map-workflow-btn.primary:hover {
  background: #0d47a1;
  color: white;
  transform: translateY(-1px);
}


/* ── Playbook Cards ── */
.playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.playbook-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.playbook-card:hover {
  border-color: var(--blue-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.playbook-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 20px;
  margin-bottom: 12px;
}
.playbook-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.playbook-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ── Pipeline Progress Card ── */
.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.pipeline-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.pipeline-bar-container { margin-bottom: 20px; }
.pipeline-bar-track {
  height: 24px;
  background: var(--bg-input);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
}
.pipeline-bar-segment {
  height: 100%;
  transition: width 0.6s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: white; letter-spacing: 0.04em;
}
.pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}
.pipeline-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.pipeline-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .split-panel { grid-template-columns: 1fr; height: auto; }
  .detail-panel { border-left: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 12px; max-height: 500px; }
  .table-panel { border-radius: var(--radius-lg); }
  .map-container { grid-template-columns: 1fr; height: auto; }
  .map-sidebar { border-left: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 12px; max-height: 400px; }
  #mapElement { border-radius: var(--radius-lg); height: 400px; }
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); z-index: 250;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-area { padding-top: 52px; }
  .page-view { padding: 20px 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }

  /* ── Mobile Detail Panel Overlay ── */
  .detail-panel {
    display: none;
    position: fixed;
    top: 52px; left: 0; right: 0; bottom: 0;
    z-index: 210;
    border-radius: 0;
    border: none;
    margin-top: 0;
    max-height: none;
    background: var(--bg-card);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  .detail-panel.mobile-open {
    display: block;
    transform: translateY(0);
  }
  .mobile-detail-close {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
    z-index: 2;
  }
  .mobile-detail-close svg {
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .filter-bar { flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-select { flex: 1; }
}

/* ── City Investor Breakdown ── */
.city-investor-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.city-investor-list::-webkit-scrollbar { width: 5px; }
.city-investor-list::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.city-inv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.city-inv-row:last-child { border-bottom: none; }
.city-inv-row:hover { background: var(--blue-bg); }
.city-inv-selected {
  background: var(--blue-bg) !important;
  border-left: 3px solid var(--blue);
}

.city-inv-rank {
  width: 22px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

.city-inv-info {
  flex: 1;
  min-width: 0;
}

.city-inv-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
}

.city-inv-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.city-inv-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-light), var(--blue-accent));
  transition: width 0.4s ease;
}

.city-inv-capital {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

/* City cell hover in table */
.city-cell:hover {
  text-decoration: underline;
  color: var(--blue-dark) !important;
}

/* ═══ PROJECTIONS ═══ */
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.proj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.proj-table th {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.04em;
}
.proj-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.proj-table tbody tr:hover { background: var(--blue-bg); }

.proj-exit-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(21,101,192,0.06);
  flex: 1;
}
.proj-exit-pill span { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.proj-exit-pill strong { font-size: 14px; color: var(--blue); }
.proj-exit-mid { background: rgba(5,150,105,0.06); }
.proj-exit-mid strong { color: var(--green); }
.proj-exit-high { background: rgba(217,119,6,0.06); }
.proj-exit-high strong { color: #d97706; }

/* ═══ ACTION PLAN ═══ */
.action-plan-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.action-progress-pct {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}
.action-progress-bar {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}
.action-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #059669);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.action-phase {
  margin-bottom: 8px;
}
.action-phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.action-phase-header:hover { background: #e8eaf0; }
.action-phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.action-phase-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.action-phase-range {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.action-phase-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.action-phase-bar {
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.action-phase-bar > div {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s;
}
.action-chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
}
.action-chevron.rotated { transform: rotate(180deg); }
.action-phase-items {
  padding: 4px 0 4px 20px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.action-phase-items.collapsed {
  max-height: 0 !important;
  padding: 0;
  overflow: hidden;
}
.action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  transition: opacity 0.15s;
}
.action-item:last-child { border-bottom: none; }
.action-item input[type="checkbox"] { display: none; }
.action-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.action-done .action-check {
  background: var(--blue);
  border-color: var(--blue);
}
.action-done .action-check::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: 700;
}
.action-done .action-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ═══ DEAL CALCULATOR ═══ */
.deal-calc-grid {
  display: grid;
  gap: 0;
}
.deal-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.deal-calc-row:last-child { border-bottom: none; }
.deal-calc-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.deal-calc-value {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ═══ MAP LAYER TOGGLE ═══ */
.map-toggle-group {
  display: flex;
  gap: 4px;
}
.map-toggle-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.map-toggle-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.map-toggle-btn:hover:not(.active) {
  border-color: var(--blue);
  color: var(--blue);
}

/* ═══ AGENT HUB ═══ */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
.agent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.agent-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(21,101,192,0.12);
  transform: translateY(-1px);
}
.agent-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.agent-card-body { flex: 1; min-width: 0; }
.agent-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.agent-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-card-arrow {
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.agent-card:hover .agent-card-arrow {
  transform: translateX(3px);
  color: var(--blue);
}

/* Agent buttons in detail panel */
.agent-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.agent-run-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.agent-run-btn:hover {
  border-color: var(--agent-c, var(--blue));
  background: color-mix(in srgb, var(--agent-c, var(--blue)) 8%, white);
  color: var(--agent-c, var(--blue));
}

/* ═══ AGENT MODAL ═══ */
.agent-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.agent-modal-overlay.open {
  display: flex;
}
.agent-modal {
  width: 680px;
  max-width: 92vw;
  max-height: 85vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.agent-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.agent-modal-icon {
  font-size: 28px;
}
.agent-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.agent-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}
.agent-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-alt);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.agent-modal-close:hover {
  background: #e8eaf0;
}
.agent-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
}
.agent-modal-body h2 { font-size: 16px; font-weight: 800; margin: 16px 0 8px; }
.agent-modal-body h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; color: var(--blue); }
.agent-modal-body h4 { font-size: 13px; font-weight: 700; margin: 12px 0 4px; }
.agent-modal-body ul { padding-left: 16px; margin: 4px 0; }
.agent-modal-body li { margin-bottom: 4px; }
.agent-modal-body strong { color: var(--text-primary); }

/* Agent Action Buttons */
.agent-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: #f8f9fb; color: var(--text-primary);
  cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
}
.agent-action-btn:hover { background: #eef0f4; border-color: #b0b8c8; }
.agent-action-pdf { background: var(--blue); color: #fff; border-color: var(--blue); }
.agent-action-pdf:hover { background: #1a5ab8; }

/* Cache Badge */
.agent-cache-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
  background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0;
}

/* Print Styles — only show the brief content */
@media print {
  body > *:not(.agent-modal-overlay) { display: none !important; }
  .agent-modal-overlay { position: static !important; background: none !important; display: block !important; }
  .agent-modal { position: static !important; width: 100% !important; max-width: 100% !important;
    max-height: none !important; height: auto !important; box-shadow: none !important;
    border-radius: 0 !important; transform: none !important; }
  .agent-modal-header { border-bottom: 2px solid #333; padding: 12px 0; }
  .agent-action-btn, .agent-modal-close, .agent-cache-badge, #agentRerunBtn { display: none !important; }
  .agent-modal-body { overflow: visible !important; max-height: none !important;
    padding: 16px 0; font-size: 12px; line-height: 1.6; }
  .agent-modal-body h2 { font-size: 15px; }
  .agent-modal-body h3 { font-size: 13px; color: #333; }
  .agent-sources { break-inside: avoid; }
}

.agent-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}
.agent-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: agentSpin 0.8s linear infinite;
}
@keyframes agentSpin {
  to { transform: rotate(360deg); }
}

.agent-sources {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.agent-sources-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.agent-source-link {
  display: block;
  font-size: 11px;
  color: var(--blue);
  margin-bottom: 4px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-source-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .proj-grid {
    grid-template-columns: 1fr;
  }
  .proj-grid .chart-card:first-child {
    grid-column: span 1;
  }
  .agent-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   PARTNERSHIP ASSESSMENT — Full Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Start Screen ── */
.eval-start-card {
  max-width: 680px;
}
.eval-start-hero {
  text-align: center;
  margin-bottom: 28px;
}
.eval-start-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.eval-start-hero h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.eval-start-hero p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.eval-start-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.eval-zone-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}
.eval-zone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.eval-zone-weight {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 10px;
}
.eval-zone-section-label {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 2px 0;
}
.eval-start-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.eval-meta-item {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.eval-meta-item strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue);
}
.eval-firm-section {
  margin-bottom: 20px;
}
.eval-firm-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.eval-firm-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}
.eval-firm-input:focus {
  border-color: var(--blue);
}

/* ── Buttons ── */
.eval-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}
.eval-btn-primary {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
  color: white;
  border-color: var(--blue);
}
.eval-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(21,101,192,0.3);
}
.eval-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.eval-btn-secondary {
  background: var(--bg-input);
  color: var(--blue);
  border-color: var(--blue-border);
}
.eval-btn-secondary:hover {
  background: var(--blue-bg);
}
.eval-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.eval-btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ── Phase Header ── */
.eval-phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.eval-phase-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}
.eval-phase-badge-core {
  background: var(--purple-bg);
  color: var(--purple);
  border-color: rgba(124,58,237,0.2);
}
.eval-phase-title {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Progress Bar ── */
.eval-progress-wrap {
  margin-bottom: 24px;
}
.eval-progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.eval-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-accent));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.eval-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Question Card (Screener – one at a time) ── */
.eval-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
  display: none;
}
.eval-question-card.active {
  display: block;
}
.eval-question-zone-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.eval-question-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 20px;
  min-height: 52px;
}
.eval-likert-scale {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.eval-likert-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 0;
  width: 80px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.eval-likert-btn:hover {
  border-color: var(--blue-light);
  background: var(--blue-bg);
  transform: translateY(-2px);
}
.eval-likert-btn.selected {
  border-color: var(--blue);
  background: var(--blue-bg);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}
.eval-likert-number {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}
.eval-likert-btn.selected .eval-likert-number {
  color: var(--blue);
}
.eval-likert-label {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}
.eval-likert-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 4px;
}
.eval-likert-scale-labels span {
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Core Assessment – Zone Groups ── */
.eval-zone-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.eval-zone-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.eval-zone-tab:hover {
  background: var(--bg-hover);
}
.eval-zone-tab.active {
  color: white;
  border-color: transparent;
}
.eval-zone-tab .eval-tab-check {
  font-size: 12px;
  opacity: 0.5;
}
.eval-zone-tab.completed .eval-tab-check {
  opacity: 1;
}

/* Zone Question Group */
.eval-zone-group {
  display: none;
  animation: fadeIn 0.3s ease;
}
.eval-zone-group.active {
  display: block;
}
.eval-zone-group-questions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.eval-zone-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.eval-zone-group-icon {
  font-size: 24px;
}
.eval-zone-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.eval-zone-group-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Core question rows */
.eval-core-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}
.eval-core-question:hover {
  border-color: var(--border-light);
}
.eval-core-question.answered {
  border-color: rgba(21,101,192,0.2);
  background: rgba(21,101,192,0.02);
}
.eval-core-q-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.5;
}
.eval-core-q-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.eval-core-likert {
  display: flex;
  gap: 6px;
}
.eval-core-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  background: var(--bg-input);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  color: var(--text-secondary);
}
.eval-core-pill:hover {
  border-color: var(--blue-light);
  background: var(--blue-bg);
  color: var(--blue);
}
.eval-core-pill.selected {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

/* ── Nav Buttons ── */
.eval-nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Screener Result Card ── */
.eval-screener-result-card {
  max-width: 500px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-md);
}
.eval-screener-result-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.eval-screener-result-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}
.eval-screener-result-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.eval-screener-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Results Dashboard ── */
.eval-results-hero {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.eval-result-firm {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.eval-result-archetype-line {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.eval-result-score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 6px solid var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: border-color 0.3s ease;
}
.eval-result-score-value {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--blue);
  line-height: 1;
}
.eval-result-score-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}
.eval-result-tier {
  margin-bottom: 8px;
}
.eval-result-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Zone Results ── */
.eval-zone-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.eval-zone-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.eval-zone-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.eval-zone-result-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.eval-zone-result-pct {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.eval-zone-result-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.eval-zone-result-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.eval-zone-result-intensity {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Zone Detail Click-to-Expand ── */
.eval-zone-hoverable {
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}
.eval-zone-hoverable:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.eval-zone-tooltip {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.eval-zone-tooltip.expanded {
  display: block;
  animation: evalDetailSlide 0.25s ease;
}
@keyframes evalDetailSlide {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 300px; }
}
.eval-zone-tooltip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.eval-zone-tooltip-body {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.eval-zone-tooltip-highlights {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.eval-zt-section {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.eval-zt-section strong {
  color: var(--text-primary);
}

/* ── Print-only Zone Detail (hidden on screen) ── */
.eval-zone-print-detail {
  display: none;
}

/* ── Expand hint ── */
.eval-zone-hoverable::after {
  content: '▾ Details';
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
}
.eval-zone-hoverable:hover::after {
  opacity: 0.6;
}
.eval-zone-hoverable.is-expanded::after {
  content: '▴ Collapse';
  opacity: 0.6;
}

/* ── Strengths / Friction / Support Cards ── */
.eval-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.eval-results-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.eval-results-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.eval-results-list {
  list-style: none;
  padding: 0;
}
.eval-results-list li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.eval-results-list li:last-child {
  border-bottom: none;
}

/* ── Narrative ── */
.eval-narrative {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Recommendation Block ── */
.eval-result-recommendation {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.eval-rec-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.eval-rec-action {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}
.eval-rec-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: var(--font);
}

/* ── Result Actions ── */
.eval-result-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ── History ── */
.eval-history-list {
  margin-top: 12px;
}
.eval-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.eval-history-item:hover {
  border-color: var(--blue-border);
  background: var(--blue-bg);
}
.eval-history-name {
  font-weight: 600;
  color: var(--text-primary);
}
.eval-history-meta {
  color: var(--text-muted);
  font-size: 11px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .eval-start-zones {
    grid-template-columns: 1fr;
  }
  .eval-start-meta {
    flex-direction: column;
    gap: 8px;
  }
  .eval-likert-scale {
    gap: 4px;
  }
  .eval-likert-btn {
    width: 56px;
    padding: 10px 0;
  }
  .eval-likert-number {
    font-size: 16px;
  }
  .eval-zone-results {
    grid-template-columns: 1fr;
  }
  .eval-results-grid {
    grid-template-columns: 1fr;
  }
  .eval-zone-group-questions {
    grid-template-columns: 1fr;
  }
}

/* ── Save Button ── */
.eval-btn-save {
  background: rgba(5, 150, 105, 0.08);
  color: var(--green);
  border-color: rgba(5, 150, 105, 0.25);
}
.eval-btn-save:hover {
  background: rgba(5, 150, 105, 0.15);
  transform: translateY(-1px);
}

/* ── Save Confirmation Toast ── */
.eval-save-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: var(--green);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  box-shadow: 0 8px 32px rgba(5, 150, 105, 0.35);
  animation: evalToastIn 0.3s ease, evalToastOut 0.3s ease 2.5s forwards;
}
@keyframes evalToastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes evalToastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

/* ═══════════════════════════════════════════════════════════
   PDF PRINT STYLESHEET
   ═══════════════════════════════════════════════════════════ */
@media print {
  /* Hide everything except the results */
  body { overflow: visible !important; background: white !important; }
  .sidebar, .mobile-header, .sidebar-overlay,
  .eval-nav-buttons, .eval-result-actions,
  .eval-rec-cta, .eval-btn { display: none !important; }

  .app-shell { display: block !important; }
  .main-area { overflow: visible !important; padding: 0 !important; }
  .page-view { display: none !important; padding: 0 !important; max-width: none !important; }
  #page-evaluation { display: block !important; padding: 0 !important; }
  #evalStart, #evalScreener, #evalScreenerResult, #evalCore { display: none !important; }
  #evalResults { display: block !important; }

  /* PDF Header - injected */
  .eval-pdf-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 3px solid #1565c0;
  }
  .eval-pdf-header-logo {
    font-size: 18px;
    font-weight: 800;
    color: #1565c0;
  }
  .eval-pdf-header-meta {
    font-size: 11px;
    color: #666;
    text-align: right;
  }

  /* Print layout adjustments */
  .eval-results-hero {
    border: none !important;
    box-shadow: none !important;
    padding: 20px 0 !important;
    page-break-after: avoid;
  }
  .eval-result-score-circle {
    width: 100px !important;
    height: 100px !important;
    border-width: 4px !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .eval-result-score-value { font-size: 32px !important; }

  .eval-zone-results {
    grid-template-columns: repeat(2, 1fr) !important;
    page-break-inside: avoid;
  }
  .eval-zone-result-card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .eval-zone-result-bar-fill {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  /* Show zone detail in print, hide hover tooltip */
  .eval-zone-tooltip { display: none !important; }
  .eval-zone-hoverable::after { display: none !important; }
  .eval-zone-print-detail {
    display: block !important;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
  }
  .eval-zone-print-detail-text {
    font-size: 10px;
    line-height: 1.5;
    color: #444;
    margin-bottom: 4px;
  }
  .eval-zone-print-detail-row {
    font-size: 9px;
    color: #666;
    margin-top: 2px;
  }
  .eval-zone-print-detail-row strong {
    color: #333;
  }

  .eval-results-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    page-break-inside: avoid;
  }
  .eval-results-card {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
  }
  .eval-result-recommendation {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .badge {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Footer */
  .eval-pdf-footer {
    display: block !important;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
    font-size: 10px;
    color: #999;
    text-align: center;
  }
}

/* Hide print-only elements on screen */
.eval-pdf-header, .eval-pdf-footer { display: none; }

/* ═══════════════════════════════════════════════════════════
   STAGE EDITING & CSV EXPORT
   ═══════════════════════════════════════════════════════════ */

/* ── Stage Select Dropdown ── */
.stage-edit-wrap {
  position: relative;
}
.stage-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 28px 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
  border: 2px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238890a4' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.stage-select:hover {
  border-color: var(--blue-light);
}
.stage-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}
.stage-select.badge-grey { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.stage-select.badge-blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.stage-select.badge-orange { background: rgba(217,119,6,0.08); color: #d97706; border-color: rgba(217,119,6,0.2); }
.stage-select.badge-purple { background: var(--purple-bg); color: var(--purple); border-color: rgba(124,58,237,0.2); }
.stage-select.badge-green { background: rgba(5,150,105,0.08); color: var(--green); border-color: rgba(5,150,105,0.2); }
.stage-select.badge-red { background: rgba(220,38,38,0.08); color: #dc2626; border-color: rgba(220,38,38,0.2); }

/* ── Stage Toast Notification ── */
.stage-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-family: var(--font);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: 400px;
  text-align: center;
}
.stage-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.stage-toast strong {
  color: var(--blue-accent);
}
.stage-toast em {
  font-style: normal;
  font-weight: 600;
}

/* ── CSV Export Button ── */
.filter-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  background: rgba(5,150,105,0.08);
  color: var(--green);
  border: 1px solid rgba(5,150,105,0.2);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-export-btn:hover {
  background: rgba(5,150,105,0.15);
  border-color: rgba(5,150,105,0.3);
  transform: translateY(-1px);
}

/* ── Sortable Table Headers ── */
.th-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}
.th-sortable:hover {
  color: var(--blue);
  background: rgba(21,101,192,0.04);
}
.th-sortable.active {
  color: var(--blue);
}
.th-sort-arrow {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 2px;
}
.th-sortable.active .th-sort-arrow {
  opacity: 1;
  color: var(--blue);
}

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(145deg, #e8eef6 0%, #dce4f0 30%, #cdd8ea 60%, #bec9de 100%);
  padding: 20px;
  font-family: var(--font);
}
.login-card {
  background: white;
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  text-align: center;
}
.login-logo {
  margin-bottom: 12px;
}
.login-logo-img {
  width: 280px;
  height: auto;
  display: block;
  margin: 0 auto -8px;
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px;
  letter-spacing: -0.02em;
}
.login-subtitle {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #1565c0;
  margin: 4px 0 16px;
}
.login-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 28px;
}
.login-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: white;
  background: linear-gradient(135deg, #8b6914 0%, #b8942e 50%, #a07d22 100%);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(139,105,20,0.25);
}
.login-google-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139,105,20,0.35);
}
.login-google-btn:active {
  transform: translateY(0);
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.login-divider span {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.06em;
}
.login-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  color: #0f172a;
  background: #f8fafc;
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.login-input:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
  background: white;
}
.login-input::placeholder {
  color: #94a3b8;
}
.login-email-btn {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: #334155;
  background: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}
.login-email-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
.login-primary-btn {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #1e88e5 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(21,101,192,0.3);
}
.login-primary-btn:hover {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1976d2 100%);
  border: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(21,101,192,0.4);
}
.login-error {
  display: none;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #dc2626;
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.15);
  text-align: left;
}

/* ── Sidebar User Section ── */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1565c0, #1976d2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-meta {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sign-out-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sign-out-btn:hover {
  background: rgba(220,38,38,0.08);
  color: #dc2626;
}

/* ── Login Responsive ── */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }
  .login-title {
    font-size: 19px;
  }
}

/* ════════════════════════════════════════════════════════ */
/* ── Deal Flow Engine ──────────────────────────────────── */
/* ════════════════════════════════════════════════════════ */

/* Track Selector */
.df-track-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.df-track-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.df-track-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--blue-accent));
  opacity: 0;
  transition: opacity 0.25s;
}
.df-track-card:hover {
  border-color: var(--blue-border);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.df-track-card:hover::before { opacity: 1; }
.df-track-card.active {
  border-color: var(--blue);
  background: linear-gradient(135deg, rgba(21,101,192,0.03), rgba(66,165,245,0.05));
}
.df-track-card.active::before { opacity: 1; }
.df-track-icon { font-size: 36px; }
.df-track-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.df-track-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.df-track-stats {
  display: flex; gap: 16px; margin-top: 4px;
}
.df-track-stat {
  font-size: 12px; color: var(--text-muted);
}
.df-track-stat strong {
  font-size: 20px; font-weight: 800; color: var(--blue); display: block;
  letter-spacing: -0.02em;
}

/* Picker Bar */
.df-picker-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.df-picker-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap;
}
.df-picker-select {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px;
  font-family: var(--font); color: var(--text-primary);
  background: var(--bg-input); cursor: pointer; outline: none;
}
.df-picker-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,192,0.1); }

/* Stage Tabs */
.df-stages {
  display: flex; align-items: stretch; gap: 0;
  margin-bottom: 20px; overflow-x: auto;
}
.df-stage-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 14px 12px; cursor: pointer; border: 2px solid var(--border);
  background: var(--bg-card); position: relative;
  transition: all 0.2s ease; min-width: 140px;
}
.df-stage-tab:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.df-stage-tab:last-child { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.df-stage-tab + .df-stage-tab { border-left: none; }
.df-stage-tab:hover { background: var(--bg-hover); }
.df-stage-tab.active {
  background: var(--blue-bg); border-color: var(--blue-border);
  z-index: 1;
}
.df-stage-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-input); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--text-muted);
  margin-bottom: 6px; transition: all 0.2s;
}
.df-stage-tab.active .df-stage-num {
  background: var(--blue); border-color: var(--blue);
  color: white;
}
.df-stage-name {
  font-size: 12px; font-weight: 700; color: var(--text-primary);
  text-align: center;
}
.df-stage-sub {
  font-size: 10px; color: var(--text-muted); text-align: center;
  margin-top: 2px;
}
.df-stage-arrow {
  display: flex; align-items: center; font-size: 16px;
  color: var(--text-muted); padding: 0 4px; user-select: none;
}

/* Stage Content */
.df-stage-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  min-height: 400px; box-shadow: var(--shadow-sm);
}
.df-stage-empty {
  display: flex; align-items: center; justify-content: center;
  height: 300px; color: var(--text-muted); font-size: 14px;
}
.df-stage-header {
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.df-stage-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.df-stage-subtitle { font-size: 13px; color: var(--text-secondary); }

/* Touch Cards (Prospecting) */
.df-touch-list { display: flex; flex-direction: column; gap: 8px; }
.df-touch-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all 0.2s;
}
.df-touch-card:hover { border-color: var(--blue-border); }
.df-touch-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; transition: background 0.15s;
}
.df-touch-header:hover { background: var(--bg-hover); }
.df-touch-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: white; flex-shrink: 0;
}
.df-touch-email .df-touch-num { background: var(--blue); }
.df-touch-linkedin .df-touch-num { background: #0a66c2; }
.df-touch-content .df-touch-num { background: var(--purple); }
.df-touch-phone .df-touch-num { background: var(--green); }
.df-touch-event .df-touch-num { background: var(--orange); }
.df-touch-info { flex: 1; }
.df-touch-type {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
}
.df-touch-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.df-touch-expand {
  transition: transform 0.2s; color: var(--text-muted); flex-shrink: 0;
}
.df-touch-card.open .df-touch-expand { transform: rotate(180deg); }
.df-touch-body {
  display: none; padding: 0 16px 16px 60px;
  border-top: 1px solid var(--border);
}
.df-touch-card.open .df-touch-body { display: block; padding-top: 14px; }
.df-touch-subject {
  font-size: 12px; font-weight: 600; color: var(--blue);
  margin-bottom: 10px; padding: 6px 10px; background: var(--blue-bg);
  border-radius: var(--radius);
}
.df-touch-text {
  font-size: 13px; color: var(--text-secondary); line-height: 1.7;
  white-space: pre-wrap; font-family: var(--font);
}

/* Copy Button */
.df-copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 6px 14px; border-radius: var(--radius);
  font-size: 11px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all 0.15s;
  background: var(--bg-input); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.df-copy-btn:hover { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.df-copy-btn.copied { background: var(--green-bg); color: var(--green); border-color: rgba(5,150,105,0.2); }

/* Match Cards (Investor Track) */
.df-match-list { display: flex; flex-direction: column; gap: 10px; }
.df-match-card {
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; align-items: flex-start; gap: 14px;
  transition: all 0.2s; background: var(--bg-card);
}
.df-match-card:hover { border-color: var(--blue-border); box-shadow: var(--shadow-sm); }
.df-match-rank {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.df-match-info { flex: 1; }
.df-match-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.df-match-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.df-match-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Agenda Sections */
.df-agenda-section {
  margin-bottom: 16px; padding: 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg-card);
}
.df-agenda-title {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 10px; display: flex; justify-content: space-between;
}
.df-agenda-item {
  display: flex; gap: 10px; padding: 6px 0; font-size: 13px;
  color: var(--text-secondary); line-height: 1.5;
}
.df-agenda-bullet {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}

/* Timeline */
.df-timeline { position: relative; padding-left: 24px; }
.df-timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.df-timeline-item {
  position: relative; padding: 10px 0 10px 16px;
  font-size: 13px; color: var(--text-secondary);
}
.df-timeline-dot {
  position: absolute; left: -20px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--blue); background: var(--bg-card); z-index: 1;
}

/* Action Items */
.df-action-list { display: flex; flex-direction: column; gap: 6px; }
.df-action-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); transition: all 0.15s;
}
.df-action-item:hover { border-color: var(--blue-border); }
.df-action-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0; background: var(--bg-card);
}
.df-action-check.done {
  background: var(--green); border-color: var(--green);
  color: white; font-size: 11px;
}
.df-action-text { flex: 1; font-size: 13px; color: var(--text-primary); }
.df-action-item.done .df-action-text {
  text-decoration: line-through; color: var(--text-muted);
}
.df-action-due {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap;
}
.df-action-due.overdue { color: var(--red); }
.df-action-add {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px dashed var(--border);
  border-radius: var(--radius); cursor: pointer;
  font-size: 12px; color: var(--text-muted); transition: all 0.15s;
  background: none;
}
.df-action-add:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }

/* ── Funnel Visualization ── */
.funnel-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.funnel-card { padding: 20px; }
.funnel-stage {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; cursor: pointer; transition: all 0.15s;
}
.funnel-stage:hover { transform: translateX(4px); }
.funnel-bar-wrap { flex: 1; }
.funnel-bar-label {
  display: flex; justify-content: space-between;
  font-size: 11px; margin-bottom: 3px;
}
.funnel-bar-label-name { font-weight: 600; color: var(--text-primary); }
.funnel-bar-label-count { color: var(--text-muted); font-weight: 500; }
.funnel-bar-track {
  height: 24px; background: var(--bg-input); border-radius: 6px;
  overflow: hidden; position: relative;
}
.funnel-bar-fill {
  height: 100%; border-radius: 6px; transition: width 0.6s ease;
  display: flex; align-items: center; padding-left: 8px;
  font-size: 10px; font-weight: 700; color: white; letter-spacing: 0.02em;
}
.funnel-total {
  display: flex; justify-content: space-between;
  padding: 10px 0 0; margin-top: 8px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary);
}
.funnel-total strong { color: var(--text-primary); }

/* Responsive Deal Flow */
@media (max-width: 768px) {
  .df-track-selector { grid-template-columns: 1fr; }
  .df-stages { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .df-stage-tab { min-width: 120px; }
  .df-touch-body { padding-left: 16px; }
  .funnel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .df-track-card { padding: 20px 16px; }
  .df-track-title { font-size: 16px; }
  .df-stage-content { padding: 16px; }
}
