/* Sentrival LLC — Operations Dashboard Styles */
/* Mobile-first — designed for morning review on phone */

:root {
  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --purple-light: #ede9fe;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --red: #dc2626;
  --red-light: #fee2e2;
  --orange: #d97706;
  --orange-light: #fef3c7;
  --green: #16a34a;
  --green-light: #dcfce7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--gray-50); color: var(--gray-900); font-size: 15px; line-height: 1.5; }

.hidden { display: none !important; }

/* ── LOGIN ── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--purple-dark), var(--blue)); padding: 1rem; }
.login-card { background: var(--white); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.login-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.logo-mark { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--purple), var(--blue)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; }
.login-logo span { font-weight: 700; font-size: 1.25rem; color: var(--gray-900); }
.login-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--gray-500); margin-bottom: 1.5rem; font-size: 0.9rem; }
.login-form { display: flex; flex-direction: column; gap: 0.75rem; }
.login-form input { border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 1rem; outline: none; transition: border-color 0.15s; }
.login-form input:focus { border-color: var(--purple); }
.error-text { color: var(--red); font-size: 0.85rem; text-align: center; }

/* ── TOP BAR ── */
.topbar { position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--gray-200); padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); }
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.logo-small { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.logo-mark-sm { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--purple), var(--blue)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.topbar-date { color: var(--gray-500); font-size: 0.8rem; }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.system-status { font-size: 0.75rem; font-weight: 600; color: var(--green); background: var(--green-light); padding: 0.2rem 0.6rem; border-radius: 20px; }
.system-status.paused { color: var(--red); background: var(--red-light); }
.btn-icon { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--gray-500); padding: 0.25rem; }
.btn-signout { background: none; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.3rem 0.75rem; font-size: 0.8rem; cursor: pointer; color: var(--gray-600); }

/* ── KILL SWITCH BAR ── */
.kill-switch-bar { background: var(--gray-900); display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem; }
.kill-switch-label { color: var(--gray-300); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.btn-kill-switch { background: var(--red); color: white; border: none; border-radius: var(--radius-sm); padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 700; cursor: pointer; letter-spacing: 0.02em; }
.btn-kill-switch:active { background: #b91c1c; }

/* ── QUARANTINE BANNER ── */
.quarantine-banner { background: #7f1d1d; border-bottom: 2px solid var(--red); padding: 0.75rem 1rem; }
.quarantine-content { display: flex; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
.quarantine-text { flex: 1; color: white; }
.quarantine-text strong { display: block; font-size: 0.95rem; }
.quarantine-text span { font-size: 0.85rem; opacity: 0.9; }
.btn-release-quarantine { background: var(--orange); color: white; border: none; border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.btn-kill-switch-escalate { background: var(--red); color: white; border: none; border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

/* ── MAIN LAYOUT ── */
.dashboard-main { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; max-width: 900px; margin: 0 auto; }

/* ── CARDS ── */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 1rem; box-shadow: var(--shadow); }
.card-urgent { border-left: 4px solid var(--orange); }
.card-founders { border-left: 4px solid var(--purple); }
.section-title { font-size: 0.95rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.section-icon { font-size: 1rem; }
.badge { background: var(--purple); color: white; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 20px; margin-left: auto; }
.badge-urgent { background: var(--red); }
.badge-blue { background: var(--blue); }
.empty-state { color: var(--gray-500); font-size: 0.85rem; text-align: center; padding: 1rem 0; }

/* ── BUTTONS ── */
.btn-primary { background: linear-gradient(135deg, var(--purple), var(--blue)); color: white; border: none; border-radius: var(--radius-sm); padding: 0.6rem 1.25rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.6rem 1.25rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.btn-danger { background: var(--red); color: white; border: none; border-radius: var(--radius-sm); padding: 0.6rem 1.25rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; margin-bottom: 0.5rem; }
.btn-approve { background: var(--green); color: white; border: none; border-radius: 6px; padding: 0.35rem 0.75rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.btn-edit { background: var(--orange); color: white; border: none; border-radius: 6px; padding: 0.35rem 0.75rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

/* ── APPROVALS ── */
.approvals-list { display: flex; flex-direction: column; gap: 0.5rem; }
.approval-item { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.75rem; }
.approval-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.25rem; }
.approval-type { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--purple); }
.approval-time { font-size: 0.75rem; color: var(--gray-500); }
.approval-desc { font-size: 0.85rem; color: var(--gray-700); }
.approval-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ── AGENT HEALTH ── */
.agent-health-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (min-width: 600px) { .agent-health-grid { grid-template-columns: repeat(3, 1fr); } }
.agent-health-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: var(--gray-50); border-radius: var(--radius-sm); font-size: 0.8rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--orange); }
.status-dot.red { background: var(--red); }

/* ── BATCH CONTROLS ── */
.batch-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

/* ── REVIEW RESPONSES ── */
.review-responses { display: flex; flex-direction: column; gap: 0.75rem; }
.review-item { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.75rem; }
.review-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.review-rating { font-size: 0.9rem; }
.review-platform { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; }
.review-sentiment-badge { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 4px; }
.review-sentiment-badge.negative { background: var(--red-light); color: var(--red); }
.review-sentiment-badge.neutral { background: var(--orange-light); color: var(--orange); }
.review-text { font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0.5rem; font-style: italic; }
.response-draft { background: var(--white); border: 1px solid var(--gray-200); border-radius: 6px; padding: 0.5rem; font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0.5rem; }
.response-draft textarea { width: 100%; border: none; outline: none; font-size: 0.85rem; color: var(--gray-700); resize: none; background: none; font-family: inherit; }
.review-actions { display: flex; gap: 0.5rem; }

/* ── PIPELINE ── */
.pipeline-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 600px) { .pipeline-grid { grid-template-columns: repeat(3, 1fr); } }
.pipeline-stat { background: var(--gray-50); border-radius: var(--radius-sm); padding: 0.75rem; text-align: center; border: 1px solid var(--gray-200); }
.pipeline-stat-founders { border-color: var(--purple-light); background: var(--purple-light); }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); }
.stat-label { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.2rem; }

/* ── FOUNDERS WIDGET ── */
.founders-widget { text-align: center; padding: 0.5rem 0; }
.founders-count { font-size: 4rem; font-weight: 900; background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.founders-label { font-size: 1rem; color: var(--gray-700); margin: 0.25rem 0 0.75rem; }
.founders-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem; }
.founders-bar-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--blue)); border-radius: 4px; transition: width 0.5s ease; }
.founders-urgency { font-size: 0.85rem; color: var(--gray-600); }
.founders-urgency.urgent { color: var(--red); font-weight: 600; }

/* ── VOLUME CONTROL ── */
.volume-control { display: flex; flex-direction: column; gap: 0.75rem; }
.volume-stats { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--gray-600); }
.slider-row { display: flex; align-items: center; gap: 0.5rem; }
.slider-min, .slider-max { font-size: 0.8rem; color: var(--gray-500); min-width: 1.5rem; }
.slider-max { text-align: right; }
input[type="range"] { flex: 1; accent-color: var(--purple); height: 6px; }
.slider-value-row { display: flex; align-items: center; gap: 0.5rem; }
.slider-current-label { font-size: 0.85rem; color: var(--gray-600); }
.slider-current-value { font-size: 1.2rem; font-weight: 800; color: var(--purple); min-width: 3rem; }
.slider-unit { font-size: 0.85rem; color: var(--gray-600); flex: 1; }
.slider-note { font-size: 0.75rem; color: var(--gray-500); font-style: italic; }

/* ── DOMAIN HEALTH ── */
.domain-health-list { display: flex; flex-direction: column; gap: 0.5rem; }
.domain-item { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem; background: var(--gray-50); border-radius: var(--radius-sm); border: 1px solid var(--gray-200); }
.domain-name { font-size: 0.85rem; font-weight: 600; color: var(--gray-800); }
.domain-meta { font-size: 0.75rem; color: var(--gray-500); }
.domain-status-badge { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 20px; }
.domain-status-badge.green { background: var(--green-light); color: var(--green); }
.domain-status-badge.yellow { background: var(--orange-light); color: var(--orange); }
.domain-status-badge.red { background: var(--red-light); color: var(--red); }

/* ── BRIGHTLOCAL STATUS ── */
.brightlocal-status { display: flex; flex-direction: column; gap: 0.5rem; }
.bl-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem; background: var(--gray-50); border-radius: 6px; font-size: 0.85rem; }
.bl-alert { background: var(--orange-light); border: 1px solid var(--orange); border-radius: var(--radius-sm); padding: 0.75rem; font-size: 0.85rem; color: var(--orange); font-weight: 600; margin-top: 0.5rem; }

/* ── COMPLIANCE ── */
.compliance-alerts { display: flex; flex-direction: column; gap: 0.5rem; }
.compliance-item { padding: 0.75rem; border-radius: var(--radius-sm); font-size: 0.85rem; }
.compliance-item.notice { background: var(--blue-light); color: var(--blue); }
.compliance-item.urgent { background: var(--orange-light); color: var(--orange); font-weight: 600; }
.compliance-item.critical { background: var(--red-light); color: var(--red); font-weight: 700; }

/* ── AGENT CONSOLE ── */
.agent-select-row { margin-bottom: 0.75rem; }
.agent-select { width: 100%; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; font-size: 0.9rem; outline: none; background: var(--white); }
.chat-window { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.75rem; min-height: 150px; max-height: 300px; overflow-y: auto; margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.chat-message { padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.85rem; max-width: 85%; }
.chat-message.system { background: var(--gray-200); color: var(--gray-600); align-self: center; font-size: 0.8rem; border-radius: 4px; max-width: 100%; }
.chat-message.user { background: linear-gradient(135deg, var(--purple), var(--blue)); color: white; align-self: flex-end; }
.chat-message.agent { background: var(--white); border: 1px solid var(--gray-200); color: var(--gray-800); align-self: flex-start; }
.chat-input-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.chat-input { flex: 1; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; font-size: 0.9rem; font-family: inherit; outline: none; resize: none; }

/* ── OBSERVER REPORT ── */
.observer-report { font-size: 0.85rem; color: var(--gray-700); }
.observer-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--gray-100); }
.observer-row:last-child { border-bottom: none; }

/* ── DEV LOG ── */
.devlog-form { display: flex; flex-direction: column; gap: 0.5rem; }
.devlog-input { width: 100%; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; font-size: 0.9rem; font-family: inherit; outline: none; resize: none; }
.devlog-row { display: flex; gap: 0.5rem; align-items: center; }
.devlog-select { flex: 1; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.5rem; font-size: 0.85rem; outline: none; background: var(--white); }
.devlog-note { font-size: 0.75rem; color: var(--gray-500); font-style: italic; }
.log-note { font-size: 0.7rem; color: var(--gray-500); font-weight: 400; margin-left: auto; }

/* ── MODALS ── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-content { background: var(--white); border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; }
.modal-danger { border-top: 4px solid var(--red); }
.modal-content h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.modal-content p { font-size: 0.9rem; color: var(--gray-700); margin-bottom: 0.75rem; }
.kill-list { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.kill-list li { font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0.25rem; }
.modal-warning { color: var(--red); font-weight: 600; }
.modal-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

/* ── PROSPECTS/EMAIL ITEMS ── */
.prospect-item, .email-item { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 0.75rem; margin-bottom: 0.5rem; }
.item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.25rem; }
.item-name { font-size: 0.9rem; font-weight: 600; }
.item-meta { font-size: 0.75rem; color: var(--gray-500); }
.item-detail { font-size: 0.8rem; color: var(--gray-600); margin-bottom: 0.5rem; }
.item-actions { display: flex; gap: 0.5rem; }

/* Responsive tweaks */
@media (max-width: 400px) {
  .dashboard-main { padding: 0.75rem; }
  .founders-count { font-size: 3rem; }
}
