/* ===== Bob V2 — black / charcoal AI command-center theme ===== */

:root {
  --bg-navy: #0a0a0a;
  --bg-navy-alt: #0d0d0d;
  --card-bg: #141414;
  --card-bg-alt: #1a1a1a;
  --border: #262626;
  --border-soft: #1c1c1c;

  --accent-blue: #00d4ff;
  --accent-blue-hover: #33ddff;
  --accent-cyan: #00d4ff;
  --accent-purple: #a78bfa;
  --accent-purple-soft: rgba(167, 139, 250, 0.14);

  --text-primary: #f0f0f0;
  --text-muted: #888888;
  --text-faint: #5c5c5c;

  --danger: #ff4d5e;
  --warning: #ffb020;
  --success: #00e6a0;
  --gray: #888888;
  --yellow: #ffcc00;
  --orange: #ffb020;
  --green: #00e6a0;
  --dark-green: #00b386;
  --red: #ff4d5e;
  --blue: #00d4ff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 18px rgba(0, 212, 255, 0.12);
  --glow: 0 0 12px rgba(0, 212, 255, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg-navy);
  color: var(--text-primary);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

h1, h2, h3 {
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

h1 { font-size: 22px; }
h2 { font-size: 15px; }

.page-subtitle {
  color: var(--text-faint);
  font-size: 13.5px;
  margin: 0 0 22px;
}

/* ===== Animations ===== */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 77, 94, 0); }
  50% { box-shadow: 0 0 9px 1px rgba(255, 77, 94, 0.65); }
}

@keyframes pulseGlowWarning {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 176, 32, 0); }
  50% { box-shadow: 0 0 9px 1px rgba(255, 176, 32, 0.6); }
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px 1px rgba(0, 230, 118, 0.8); }
  50% { opacity: 0.45; box-shadow: 0 0 2px 0 rgba(0, 230, 118, 0.4); }
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.main-content {
  animation: fadeIn 0.25s ease;
}

.card, .stat-card, .entity-card {
  animation: fadeSlideUp 0.4s ease both;
}

.item-list .item-row {
  animation: fadeSlideUp 0.35s ease both;
}

/* staggered entrance delays (pure CSS, no per-item markup needed) */
.grid > *:nth-child(1), .entity-grid > *:nth-child(1), .item-list > *:nth-child(1) { animation-delay: 0.02s; }
.grid > *:nth-child(2), .entity-grid > *:nth-child(2), .item-list > *:nth-child(2) { animation-delay: 0.07s; }
.grid > *:nth-child(3), .entity-grid > *:nth-child(3), .item-list > *:nth-child(3) { animation-delay: 0.12s; }
.grid > *:nth-child(4), .entity-grid > *:nth-child(4), .item-list > *:nth-child(4) { animation-delay: 0.17s; }
.grid > *:nth-child(5), .entity-grid > *:nth-child(5), .item-list > *:nth-child(5) { animation-delay: 0.22s; }
.grid > *:nth-child(6), .entity-grid > *:nth-child(6), .item-list > *:nth-child(6) { animation-delay: 0.27s; }
.item-list > *:nth-child(7) { animation-delay: 0.32s; }
.item-list > *:nth-child(8) { animation-delay: 0.37s; }
.item-list > *:nth-child(9) { animation-delay: 0.42s; }
.item-list > *:nth-child(10) { animation-delay: 0.47s; }

.badge-pulse {
  animation: pulseGlow 1.6s ease-in-out infinite;
}

.badge-pulse-warning {
  animation: pulseGlowWarning 1.6s ease-in-out infinite;
}

/* ===== App shell / layout ===== */

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

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-navy-alt), var(--bg-navy));
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 10px 3px rgba(0, 212, 255, 0.6);
  flex-shrink: 0;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  color: var(--text-primary);
  text-shadow: 0 0 14px rgba(0, 212, 255, 0.25);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  background: var(--card-bg-alt);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-blue);
  border-left: 3px solid var(--accent-blue);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.9;
}

.sidebar-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-faint);
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 10, 10, 0.6);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(6px);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 16px;
}

.ai-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  animation: statusPulse 2s ease-in-out infinite;
}

.sidebar-backdrop {
  display: none;
}

.main-content {
  padding: 26px 28px 60px;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ===== Cards / grids ===== */

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover, .card:hover.hoverable {
  transform: translateY(-3px);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: var(--shadow-hover);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-blue);
}

.stat-danger { color: var(--danger); }
.stat-warning { color: var(--warning); }
.stat-success { color: var(--success); }

/* ===== Lists ===== */

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  flex-wrap: wrap;
  transition: border-color 0.15s ease;
}

.item-row:hover {
  border-color: var(--border);
}

.item-row.overdue {
  border-color: rgba(255, 77, 94, 0.4);
  background: rgba(255, 77, 94, 0.06);
}

.item-title {
  flex: 1;
  min-width: 120px;
  color: var(--text-primary);
  font-weight: 500;
}

.item-title.strike {
  text-decoration: line-through;
  color: var(--text-faint);
}

.item-meta {
  color: var(--text-faint);
  font-size: 12.5px;
}

.empty-state {
  color: var(--text-faint);
  font-size: 13.5px;
  padding: 8px 0;
}

/* ===== Badges ===== */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: var(--border-soft);
  color: var(--text-muted);
}

.badge-info { background: rgba(0, 212, 255, 0.14); color: var(--accent-blue); }
.badge-danger, .badge-red { background: rgba(255, 77, 94, 0.16); color: var(--danger); }
.badge-success, .badge-green { background: rgba(0, 230, 160, 0.14); color: var(--success); }
.badge-warning, .badge-orange { background: rgba(255, 176, 32, 0.16); color: var(--warning); }
.badge-muted, .badge-gray { background: var(--border-soft); color: var(--text-faint); }
.badge-status { background: rgba(0, 212, 255, 0.14); color: var(--accent-blue); }
.badge-blue { background: rgba(0, 212, 255, 0.14); color: var(--accent-blue); }
.badge-yellow { background: rgba(255, 204, 0, 0.16); color: #ffcc00; }
.badge-darkgreen { background: rgba(0, 179, 134, 0.2); color: #1fe0ac; }

.badge-priority-high, .badge-urgency-high { background: rgba(255, 77, 94, 0.16); color: var(--danger); }
.badge-priority-medium, .badge-urgency-medium { background: rgba(255, 176, 32, 0.16); color: var(--warning); }
.badge-priority-low, .badge-urgency-low { background: rgba(0, 230, 160, 0.14); color: var(--success); }

/* ===== Toasts (flash messages) ===== */

.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  background: var(--card-bg);
  animation: toastSlideIn 0.3s ease;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-hide {
  opacity: 0;
  transform: translateX(20px);
}

.toast-success {
  background: rgba(0, 230, 160, 0.1);
  border-color: rgba(0, 230, 160, 0.4);
  color: var(--success);
}

.toast-error {
  background: rgba(255, 77, 94, 0.1);
  border-color: rgba(255, 77, 94, 0.4);
  color: var(--danger);
}

.alert-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid transparent;
}

.alert-warning {
  background: rgba(255, 176, 32, 0.1);
  border-color: rgba(255, 176, 32, 0.35);
  color: var(--warning);
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent-blue);
  color: #04141a;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--text-faint);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.btn-ghost:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: scale(1.03);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
}

.btn-block { width: 100%; }

.link {
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 600;
}

.link:hover { text-decoration: underline; }

.link-danger {
  color: var(--danger);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
}

.link-danger:hover { text-decoration: underline; }

.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent-blue); }

/* ===== Forms ===== */

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.filter-bar select, .filter-bar input {
  width: auto;
  min-width: 150px;
}

.filter-bar label {
  font-size: 11px;
  color: var(--text-faint);
  margin: 0 0 4px !important;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

form label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

form label:first-child { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--bg-navy-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

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

textarea { resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ===== Tables ===== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  text-align: left;
  color: var(--text-faint);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
}

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

.data-table tr.needs-review-row td {
  background: rgba(255, 176, 32, 0.07);
}

.actions-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  white-space: nowrap;
}

.amount-cell { font-weight: 700; }
.amount-cell.green { color: var(--success); }
.amount-cell.red { color: var(--danger); }
.amount-cell.orange { color: var(--warning); }

/* ===== Entity cards (prospects / clients) ===== */

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.entity-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.entity-card:hover {
  border-color: rgba(0, 212, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.entity-summary {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entity-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.entity-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.entity-sub {
  color: var(--text-muted);
  font-size: 13px;
}

.entity-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.expand-icon {
  color: var(--text-faint);
  font-size: 12px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.entity-details {
  display: none;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.entity-details.open { display: block; }

/* ===== Summary bar ===== */

.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* ===== Progress / streak ===== */

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), #7af5ff);
  border-radius: 999px;
}

.streak-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-blue);
}

/* ===== Scorecard (website review) ===== */

.scorecard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-bg-alt);
  border: 1px solid var(--border-soft);
  font-size: 13px;
}

.score-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.score-icon.pass { background: rgba(0, 230, 160, 0.2); color: var(--success); }
.score-icon.fail { background: rgba(255, 77, 94, 0.2); color: var(--danger); }

.score-ring {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-blue);
}

/* ===== Modals ===== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-hover);
  animation: modalPop 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover { color: var(--text-primary); }

/* ===== Checkbox / toggle buttons ===== */

.checkbox-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.checkbox-btn.checked {
  background: rgba(0, 230, 160, 0.16);
  border-color: var(--success);
}

/* ===== Section grouping ===== */

.group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 22px 0 10px;
}

.group-heading:first-child { margin-top: 0; }

.group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.notes-text, .pre-wrap {
  white-space: pre-wrap;
  color: var(--text-primary);
  font-size: 13.5px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 6px 0;
}

/* ===== Design system: page header / section-card / action-card / etc. ===== */

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.detail-header .badge { margin-right: 6px; }

.review-block {
  padding: 12px 0;
}

.review-block:first-child { padding-top: 0; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.page-header-text h1 {
  margin-bottom: 4px;
}

.page-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-card-header h2 { font-size: 16px; }

.form-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 560px;
  margin-bottom: 20px;
}

.table-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 6px 20px;
  overflow-x: auto;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.table-card .data-table { min-width: 560px; }

.action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.action-card:hover {
  border-color: rgba(0, 212, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.action-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.action-card-desc {
  font-size: 12.5px;
  color: var(--text-faint);
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: var(--border-soft);
  color: var(--text-muted);
}

.status-badge.green { background: rgba(0, 230, 160, 0.14); color: var(--success); }
.status-badge.red { background: rgba(255, 77, 94, 0.16); color: var(--danger); }
.status-badge.orange { background: rgba(255, 176, 32, 0.16); color: var(--warning); }
.status-badge.blue { background: rgba(0, 212, 255, 0.14); color: var(--accent-blue); }
.status-badge.gray { background: var(--border-soft); color: var(--text-faint); }

/* ===== Chat =====
   Moved to static/css/chat.css (loaded only on the Chat page) so chat
   styles are modular and don't bloat the global stylesheet. See that
   file for .chat-*, .typing-*, and .script-block* rules. */

/* ===== SalesOps command-center additions ===== */

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.sidebar-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 16px 12px 6px;
}

.sidebar-section:first-child .sidebar-section-label { padding-top: 4px; }

.sidebar-link { /* alias of .nav-link, kept in sync via shared markup */ }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.command-card {
  background: linear-gradient(180deg, var(--card-bg-alt), var(--card-bg));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.command-card:hover {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: var(--shadow-hover);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.priority-high, .priority-medium, .priority-low {
  border-left: 3px solid transparent;
  padding-left: 11px !important;
}

.priority-high { border-left-color: var(--danger); }
.priority-medium { border-left-color: var(--warning); }
.priority-low { border-left-color: var(--success); }

/* ===== Workflow board (Outreach) ===== */

.workflow-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.workflow-column {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.workflow-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.workflow-column-header h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0;
}

.workflow-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  background: var(--border-soft);
  border-radius: 999px;
  padding: 2px 9px;
}

.workflow-card {
  background: var(--card-bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.workflow-card:last-child { margin-bottom: 0; }

.workflow-card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-1px);
}

.workflow-card-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.workflow-card-sub {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.workflow-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ===== AI Operations Center (/agent) ===== */

.ai-ops-header {
  position: relative;
  background: radial-gradient(circle at 15% 0%, rgba(167, 139, 250, 0.10), transparent 55%),
              radial-gradient(circle at 90% 100%, rgba(0, 212, 255, 0.08), transparent 55%),
              var(--card-bg);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.ai-ops-header h1 {
  font-size: 20px;
  background: linear-gradient(90deg, var(--text-primary), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.ai-ops-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-purple);
  margin-bottom: 6px;
}

.manual-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-purple-soft);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: var(--accent-purple);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.18);
}

.manual-mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-purple);
  box-shadow: 0 0 8px 2px rgba(167, 139, 250, 0.7);
  animation: statusPulse 2.2s ease-in-out infinite;
}

.agent-status-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.agent-status-card:hover { transform: translateY(-2px); }

.agent-status-card.glow {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.15), var(--shadow);
}

.agent-network-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.agent-network-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.agent-network-root {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.15);
}

.agent-network-connector {
  width: 1px;
  height: 22px;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.5), var(--border-soft));
}

.agent-network-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}

.agent-network-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--card-bg-alt);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.agent-network-node:hover {
  border-color: rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

.agent-node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-node-dot.active {
  background: var(--success);
  box-shadow: 0 0 6px 1px rgba(0, 230, 160, 0.7);
  animation: statusPulse 2s ease-in-out infinite;
}

.agent-node-dot.idle {
  background: var(--text-faint);
}

.needs-review-glow {
  border-color: rgba(255, 176, 32, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.2), 0 0 16px rgba(255, 176, 32, 0.12);
  animation: needsReviewPulse 2.4s ease-in-out infinite;
}

@keyframes needsReviewPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.2), 0 0 10px rgba(255, 176, 32, 0.10); }
  50% { box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.35), 0 0 20px rgba(255, 176, 32, 0.22); }
}

/* ===== Responsive ===== */

@media (max-width: 1000px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .summary-bar { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  /* Chat-specific responsive rules live in static/css/chat.css */
}

@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 40;
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 35;
  }

  .main-content { padding: 18px 16px 50px; }
  .topbar { padding: 14px 16px; }
  .ai-status span.ai-status-label { display: none; }

  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .summary-bar { grid-template-columns: 1fr; }
  .entity-grid { grid-template-columns: 1fr; }
  .quick-action-grid, .action-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-board { grid-template-columns: 1fr; }
  .agent-network-row { flex-direction: column; align-items: stretch; }
  .agent-network-node { justify-content: center; }

  .page-header { flex-direction: column; align-items: stretch; }
  .page-header-actions { justify-content: flex-start; }

  .toast-stack {
    left: 12px;
    right: 12px;
    max-width: none;
  }
  /* Chat-specific responsive rules live in static/css/chat.css */
}

@media (max-width: 480px) {
  .quick-action-grid, .action-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
