/* ============================================================
   DA 1 — Intelligence Opérationnelle
   Prospekt · Dark Command UI
   ============================================================ */

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

:root {
  --bg-base:           #0a0f1e;
  --bg-surface:        #111827;
  --bg-surface-2:      #1c2538;
  --bg-surface-3:      #243044;
  --accent-cyan:       #00d4ff;
  --accent-cyan-dim:   rgba(0, 212, 255, 0.12);
  --accent-cyan-glow:  rgba(0, 212, 255, 0.22);
  --accent-violet:     #7c3aed;
  --accent-violet-dim: rgba(124, 58, 237, 0.18);
  --text-primary:      #e2e8f0;
  --text-secondary:    #94a3b8;
  --text-muted:        #4a5f7a;
  --danger:            #f43f5e;
  --danger-dim:        rgba(244, 63, 94, 0.15);
  --success:           #10b981;
  --success-dim:       rgba(16, 185, 129, 0.15);
  --warning:           #f59e0b;
  --warning-dim:       rgba(245, 158, 11, 0.15);
  --border:            rgba(0, 212, 255, 0.1);
  --border-strong:     rgba(0, 212, 255, 0.28);
  --sidebar-width:     250px;
  --font-body:         'Inter', system-ui, sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', monospace;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

/* ---- Body — dark base with subtle grid overlay ---- */
body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(10, 15, 30, 0.95) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.4));
}

.logo-subtitle {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 3px;
  font-family: var(--font-mono);
  padding-left: 1.85rem;
}

.sidebar-nav {
  padding: 0.5rem 0;
  flex: 1;
}

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.6rem 1.25rem 0.35rem;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 1.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
  position: relative;
}

.sidebar-nav a:hover {
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  border-left-color: var(--accent-cyan);
}

.sidebar-nav a:hover .nav-icon svg {
  filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.5));
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.18s, filter 0.18s;
}

.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.is-active .nav-icon {
  opacity: 1;
}

.nav-icon svg {
  transition: filter 0.18s;
}

.sidebar-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 2px rgba(16, 185, 129, 0.3); }
}

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

main {
  padding: 1.75rem 2rem;
  flex: 1;
}

/* ============================================================
   PAGE HEADER / TITLE
   ============================================================ */
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

h2.page-title,
.page-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h2.page-title::before,
.page-title::before {
  content: '> ';
  color: var(--accent-cyan);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 22px var(--accent-cyan-glow);
}

.card h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.card p strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 22px var(--accent-cyan-glow);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.highlight-hot {
  color: var(--danger) !important;
  text-shadow: 0 0 18px rgba(244, 63, 94, 0.45);
}

.highlight-warn {
  color: var(--warning) !important;
  text-shadow: 0 0 18px rgba(245, 158, 11, 0.4);
}

/* ============================================================
   PIPELINE CARD
   ============================================================ */
.pipeline-card {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 8px;
  background: var(--bg-surface);
  padding: 1.25rem;
}

.pipeline-card h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.4rem;
  padding-bottom: 0;
  border-bottom: none;
}

.pipeline-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ============================================================
   FILTER GRID (dashboard)
   ============================================================ */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.filter-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.filter-field .hint {
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
}

.filter-field input {
  width: 100%;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

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

thead th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-2);
  text-align: left;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
  background: var(--accent-cyan-dim);
}

tbody td {
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  vertical-align: middle;
  font-size: 0.85rem;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  letter-spacing: 0.04em;
}

/* Score badges */
.score-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.score-hot {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.12);
}

.score-warm {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.score-cold {
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Email badges */
.email-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: default;
}

.email-verified { background: var(--success-dim);       color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.email-probable { background: var(--warning-dim);       color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.email-risky    { background: rgba(251, 191, 36, 0.1);  color: #fbbf24;        border: 1px solid rgba(251, 191, 36, 0.3); }
.email-invalid  { background: var(--danger-dim);        color: var(--danger);  border: 1px solid rgba(244, 63, 94, 0.3); }
.email-unknown  { background: var(--bg-surface-3);      color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   INPUTS
   ============================================================ */
input, textarea, select {
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 14px;
  height: 14px;
  padding: 0;
  cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */
button {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.4);
}

button:hover {
  background: var(--accent-cyan-dim);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.btn-danger:hover {
  background: var(--danger-dim);
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.2);
}

.btn-warning {
  background: transparent;
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
  background: var(--warning-dim);
  border-color: var(--warning);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.btn-odoo {
  background: transparent;
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.4);
}

.btn-odoo:hover {
  background: var(--accent-violet-dim);
  border-color: var(--accent-violet);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.2);
}

.btn-pipeline {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(124, 58, 237, 0.12));
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  letter-spacing: 0.06em;
}

.btn-pipeline:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.22), rgba(124, 58, 237, 0.22));
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.28);
}

/* ============================================================
   BULK ACTIONS BAR
   ============================================================ */
.bulk-actions {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================================
   PROSPECTS QUEUE — company header rows
   ============================================================ */
.company-header td {
  background: var(--bg-surface-2) !important;
  padding: 0.6rem 0.75rem !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.company-meta {
  color: var(--text-muted);
  font-size: 0.75em;
  margin-left: 8px;
  font-family: var(--font-body);
}

.persona-count {
  float: right;
  font-style: italic;
  color: var(--text-muted);
}

.prospect-row td {
  padding-left: 20px;
}

.badge-primary {
  color: var(--warning);
  font-size: 0.8em;
  margin-left: 4px;
}

/* ============================================================
   EXPORT ACTIONS
   ============================================================ */
.export-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

/* ============================================================
   CODE & PRE
   ============================================================ */
pre {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

/* ============================================================
   LINKS
   ============================================================ */
a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: opacity 0.15s;
}

a:hover {
  opacity: 0.75;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-cyan); }

/* ============================================================
   KANBAN OUTREACH BOARD
   ============================================================ */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid transparent;
  border-radius: 8px 8px 0 0;
}

.kanban-col-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.kanban-col-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border-radius: 10px;
  padding: 1px 7px;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s;
}

.kanban-card:hover {
  border-color: var(--border-strong);
}

.kanban-card-company {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-title {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-linkedin-link {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  opacity: 0.7;
  text-decoration: none;
}

.kanban-linkedin-link:hover { opacity: 1; }

.kanban-msg-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 5px;
  margin-top: 2px;
}

.kanban-msg-preview summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.7rem;
  list-style: none;
}

.kanban-msg-preview p {
  margin-top: 4px;
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.kanban-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--border);
  padding-top: 5px;
  margin-top: 2px;
}

.kanban-event-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.kanban-event-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  flex-shrink: 0;
  opacity: 0.5;
}

.kanban-event-label { flex: 1; color: var(--text-secondary); }
.kanban-event-date  { font-family: var(--font-mono); font-size: 0.65rem; }

.kanban-action-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 2px;
}

.kanban-action-form select,
.kanban-action-form input {
  font-size: 0.75rem;
  padding: 4px 6px;
}

.kanban-action-form button {
  font-size: 0.72rem;
  padding: 4px 8px;
  align-self: flex-end;
}

.kanban-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 1rem 0;
}

/* ============================================================
   JOB STATUS BADGES
   ============================================================ */
.job-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.job-success { background: var(--success-dim);  color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.job-running { background: var(--accent-cyan-dim); color: var(--accent-cyan); border: 1px solid rgba(0,212,255,0.3); animation: blink 1.2s ease-in-out infinite; }
.job-failed  { background: var(--danger-dim);   color: var(--danger);  border: 1px solid rgba(244,63,94,0.3); }
.job-queued  { background: var(--bg-surface-3); color: var(--text-muted); border: 1px solid var(--border); }

@keyframes blink { 0%,100%{opacity:.6} 50%{opacity:1} }

/* ============================================================
   QUEUE FILTER BAR
   ============================================================ */
.queue-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.queue-filters .filter-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.filter-result-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  align-self: center;
}

.badge-resolved {
  font-size: 0.75em;
  margin-left: 3px;
  color: var(--accent-cyan);
  opacity: 0.8;
}

/* ============================================================
   MULTI-SELECT WIDGET
   ============================================================ */
.ms-wrapper {
  position: relative;
}

.ms-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 4px 8px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ms-control:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.ms-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ms-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 8px;
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.ms-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  width: 14px;
  height: 14px;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.1s;
  box-shadow: none;
  line-height: 1;
}

.ms-tag-remove:hover {
  opacity: 1;
  background: none;
  box-shadow: none;
}

.ms-search {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  padding: 2px 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  box-shadow: none;
}

.ms-search:focus {
  border: none;
  box-shadow: none;
}

.ms-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ms-option {
  padding: 7px 12px;
  font-size: 0.83rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.1s, color 0.1s;
}

.ms-option:last-child { border-bottom: none; }

.ms-option:hover {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.ms-option mark {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent-cyan);
  border-radius: 2px;
}

.ms-empty {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Config page — wider grid to accommodate the multi-selects */
.config-grid {
  grid-template-columns: 1fr 1fr auto auto;
}

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

/* ============================================================
   LISTS (company detail)
   ============================================================ */
ul {
  list-style: none;
  padding: 0;
}

ul li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

ul li:last-child {
  border-bottom: none;
}

/* ============================================================
   SPRINT 1 ENHANCEMENTS
   ============================================================ */
.sidebar-nav a.is-active {
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  border-left-color: var(--accent-cyan);
}

.sidebar-nav a.is-active .nav-icon svg {
  filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.6));
}

.nav-label {
  flex: 1;
}

.nav-subitem {
  padding-left: 2.6rem !important;
  font-size: 0.78rem !important;
  opacity: 0.7;
}

.nav-subitem:hover {
  opacity: 1 !important;
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--bg-base);
  background: var(--accent-cyan);
  border: none;
  border-radius: 10px;
  padding: 1px 7px;
  line-height: 1.4;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.toast {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 999;
  max-width: 320px;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--success);
}

.toast-error {
  border-color: rgba(244, 63, 94, 0.5);
  color: var(--danger);
}

.toast-out {
  opacity: 0;
  transform: translateY(-8px);
}

button[disabled] {
  opacity: 0.5;
}

.bulk-actions {
  position: sticky;
  top: 0.5rem;
  z-index: 4;
}

.queue-table th.queue-col-select,
.queue-table td.queue-col-select {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg-surface);
}

.queue-table th.queue-col-score,
.queue-table td.queue-col-score {
  position: sticky;
  left: 38px;
  z-index: 2;
  background: var(--bg-surface);
}

.queue-table th.queue-col-actions,
.queue-table td.queue-col-actions {
  min-width: 330px;
}

.queue-message details summary {
  cursor: pointer;
  color: var(--text-secondary);
}

.queue-message-preview {
  color: var(--text-muted);
  font-size: 0.78rem;
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-inline-actions input[type="text"] {
  width: 190px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mono-muted {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.muted-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.jobs-cell-job {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.jobs-cell-mono {
  font-family: var(--font-mono);
}

.jobs-cell-danger {
  color: var(--danger);
}

.jobs-cell-muted {
  color: var(--text-muted);
}

.jobs-cell-time {
  font-size: 0.78rem;
}

.jobs-cell-error {
  font-size: 0.75rem;
  color: var(--danger);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  min-height: calc(100vh - 170px);
}

.map-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.map-panel-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.map-panel-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

.map-companies-list {
  overflow-y: auto;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.map-company-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.6rem;
}

.map-company-item:hover {
  border-color: var(--border-strong);
}

.map-company-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.map-company-meta {
  grid-column: 1 / 2;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.companies-map {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 540px;
  background: var(--bg-surface);
}

.map-empty {
  padding: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

  .companies-map {
    min-height: 420px;
  }
}

.service-indicator {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.service-on {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--success-dim);
}

.service-off {
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.45);
  background: var(--danger-dim);
}

.service-controls {
  margin-bottom: 1.3rem;
}

.service-actions {
  display: flex;
  gap: 0.65rem;
}

.docs-card {
  padding: 1.2rem 1.4rem;
}

.docs-content {
  max-width: 860px;
  margin: 0 auto;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4 {
  color: var(--text-primary);
  margin-top: 1.35rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
}

.docs-content h1 {
  font-size: 1.2rem;
}

.docs-content h2 {
  font-size: 1.02rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.docs-content h3 {
  font-size: 0.9rem;
}

.docs-content p {
  margin: 0.55rem 0;
}

.docs-content ul,
.docs-content ol {
  margin: 0.55rem 0 0.9rem 1.2rem;
  padding: 0;
}

.docs-content li {
  margin-bottom: 0.3rem;
}

.docs-content a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-content pre {
  margin: 0.8rem 0;
}

.docs-content code {
  font-size: 0.76rem;
}

.docs-content blockquote {
  border-left: 3px solid var(--border-strong);
  margin: 0.8rem 0;
  padding: 0.4rem 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.9rem 0;
}

.docs-content th,
.docs-content td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
  font-size: 0.84rem;
}

.docs-content th {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}
