/* ── Base ──────────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ══════════════════════════════════════════════════════════════════════════════
   AUTH PAGES (Login / Setup)
══════════════════════════════════════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f3f4f6;
  margin-bottom: 0.25rem;
}

.auth-logo p {
  font-size: 0.85rem;
  color: #6b7280;
}

.auth-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-form input {
  width: 100%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #f3f4f6;
  font-size: 0.95rem;
  transition: border-color 0.15s;
  outline: none;
  margin-bottom: 1.1rem;
}

.auth-form input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.auth-form input::placeholder {
  color: #4b5563;
}

.auth-submit {
  width: 100%;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 0.5rem;
}

.auth-submit:hover { background: #6d28d9; }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled { background: #4b5563; cursor: not-allowed; }

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  color: #fca5a5;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   APP SHELL — Sidebar + Main layout
══════════════════════════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: #0a0a0f;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #0f172a;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid #1e293b;
}

.sidebar-logo h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #f3f4f6;
  line-height: 1.2;
}

.sidebar-logo span {
  font-size: 0.7rem;
  color: #4b5563;
  display: block;
  margin-top: 0.15rem;
}

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

.sidebar-section {
  font-size: 0.65rem;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem 0.25rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  margin-bottom: 0.1rem;
}

.nav-item:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.nav-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
}

.nav-item.active .nav-icon {
  color: #a78bfa;
}

.nav-icon {
  font-size: 1rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid #1e293b;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #1e293b;
  margin-bottom: 0.4rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info {
  overflow: hidden;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.65rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: none;
  color: #6b7280;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.logout-btn:hover {
  background: #1e293b;
  color: #ef4444;
}

/* ── Main content area ─────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f3f4f6;
}

.page-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.2rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: #7c3aed;
  color: white;
}
.btn-primary:hover:not(:disabled) { background: #6d28d9; }

.btn-secondary {
  background: #1f2937;
  color: #d1d5db;
  border: 1px solid #374151;
}
.btn-secondary:hover:not(:disabled) { background: #374151; color: #f3f4f6; }

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.2); }

.btn-ghost {
  background: transparent;
  color: #9ca3af;
  border: 1px solid #374151;
}
.btn-ghost:hover:not(:disabled) { background: #1f2937; color: #f3f4f6; }

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════════════════════ */

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: #374151;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card-body {
  padding: 1.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* Analysis history card */
.analysis-card {
  cursor: pointer;
}

.analysis-card:hover {
  border-color: #6d28d9;
}

.analysis-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.analysis-card-blogger {
  font-size: 1rem;
  font-weight: 700;
  color: #f3f4f6;
}

.analysis-card-brand {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #6b7280;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BADGES / CHIPS
══════════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-purple {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge-green {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-red {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-gray {
  background: rgba(107, 114, 128, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ══════════════════════════════════════════════════════════════════════════════
   DATA TABLE
══════════════════════════════════════════════════════════════════════════════ */

.data-table-wrapper {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #0f172a;
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  color: #d1d5db;
  font-size: 0.875rem;
  border-bottom: 1px solid #1e293b;
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr {
  transition: background 0.1s;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FORMS (inside pages, not auth)
══════════════════════════════════════════════════════════════════════════════ */

.form-field {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #f3f4f6;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #4b5563;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.form-select option {
  background: #1f2937;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f3f4f6;
}

.modal-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}

.modal-close:hover {
  color: #f3f4f6;
  background: #1f2937;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   STATUS SELECTOR (Blogger pipeline)
══════════════════════════════════════════════════════════════════════════════ */

.status-new        { background: rgba(107,114,128,0.12); color: #9ca3af; border: 1px solid rgba(107,114,128,0.2); }
.status-contacted  { background: rgba(59,130,246,0.12);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }
.status-replied    { background: rgba(245,158,11,0.12);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.status-negotiating{ background: rgba(124,58,237,0.12);  color: #a78bfa; border: 1px solid rgba(124,58,237,0.2); }
.status-deal       { background: rgba(16,185,129,0.12);  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }
.status-rejected   { background: rgba(239,68,68,0.12);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* ══════════════════════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: #4b5563;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.empty-desc {
  font-size: 0.875rem;
  color: #4b5563;
  max-width: 320px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════════
   STATS / METRIC CARDS
══════════════════════════════════════════════════════════════════════════════ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s;
}

.stat-card:hover { border-color: #374151; }

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f3f4f6;
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SEARCH / FILTER BAR
══════════════════════════════════════════════════════════════════════════════ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #4b5563;
  font-size: 0.875rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 0.55rem 0.9rem 0.55rem 2.25rem;
  color: #f3f4f6;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-input::placeholder { color: #4b5563; }

/* ══════════════════════════════════════════════════════════════════════════════
   NEW ANALYSIS FORM (full page)
══════════════════════════════════════════════════════════════════════════════ */

.analysis-form-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 2rem;
  max-width: 720px;
}

.brand-select-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-select-row .form-select {
  flex: 1;
}

/* Progress / SSE log */
.sse-progress {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1.5rem;
}

.sse-phases {
  display: flex;
  border-bottom: 1px solid #1e293b;
}

.sse-phase {
  flex: 1;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4b5563;
  transition: color 0.3s;
  border-right: 1px solid #1e293b;
}

.sse-phase:last-child { border-right: none; }

.sse-phase.active {
  color: #a78bfa;
  background: rgba(124, 58, 237, 0.05);
}

.sse-phase.done {
  color: #6ee7b7;
}

.sse-log {
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sse-log-line {
  font-size: 0.8rem;
  color: #6b7280;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  line-height: 1.5;
  animation: fadeIn 0.2s ease-out;
}

.sse-log-line.highlight {
  color: #c4b5fd;
}

/* ══════════════════════════════════════════════════════════════════════════════
   VIEW ANALYSIS PAGE
══════════════════════════════════════════════════════════════════════════════ */

.view-analysis-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.view-analysis-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.brief-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 1.75rem;
}

/* DM copy button */
.dm-section {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.dm-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6d28d9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.dm-text {
  color: #e9d5ff;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BLOGGER DETAIL PAGE
══════════════════════════════════════════════════════════════════════════════ */

.blogger-profile-header {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.blogger-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.blogger-profile-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f3f4f6;
  margin-bottom: 0.25rem;
}

.blogger-profile-info .niche {
  font-size: 0.85rem;
  color: #9ca3af;
}

.blogger-profile-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.blogger-stat {
  display: flex;
  flex-direction: column;
}

.blogger-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #f3f4f6;
}

.blogger-stat-label {
  font-size: 0.7rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.25s ease-out;
  pointer-events: auto;
  max-width: 320px;
}

.toast.success { border-left: 3px solid #10b981; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid #3b82f6; }

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

/* ══════════════════════════════════════════════════════════════════════════════
   MARKDOWN BRIEF CONTENT
══════════════════════════════════════════════════════════════════════════════ */

.brief-content {
  line-height: 1.75;
  color: #e5e7eb;
  animation: fadeIn 0.4s ease-out;
}

.brief-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f3f4f6;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #374151;
}

.brief-content h1:first-child { margin-top: 0; }

.brief-content h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #d1d5db;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.brief-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #c4b5fd;
  margin-top: 1.4rem;
  margin-bottom: 0.4rem;
}

.brief-content p {
  margin-bottom: 0.9rem;
  color: #d1d5db;
}

.brief-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 0.9rem;
}

.brief-content ol {
  list-style: decimal;
  padding-left: 1.5rem;
  margin-bottom: 0.9rem;
}

.brief-content li {
  margin-bottom: 0.3rem;
  color: #d1d5db;
}

.brief-content strong {
  color: #f3f4f6;
  font-weight: 600;
}

.brief-content em {
  color: #a78bfa;
  font-style: italic;
}

.brief-content code {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-size: 0.875em;
  color: #c4b5fd;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}

.brief-content pre {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.brief-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.brief-content blockquote {
  border-left: 3px solid #7c3aed;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #9ca3af;
  font-style: italic;
}

.brief-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.brief-content th {
  background: #1f2937;
  color: #e5e7eb;
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.9rem;
  border: 1px solid #374151;
}

.brief-content td {
  padding: 0.5rem 0.9rem;
  border: 1px solid #374151;
  color: #d1d5db;
}

.brief-content tr:nth-child(even) td { background: #111827; }

.brief-content hr {
  border: none;
  border-top: 1px solid #374151;
  margin: 2rem 0;
}

/* ── Outreach box ──────────────────────────────────────────────────────────── */
.brief-content .outreach-box {
  background: linear-gradient(135deg, #1e1033 0%, #150d2b 100%);
  border: 1px solid #6d28d9;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  position: relative;
  box-shadow: 0 0 30px rgba(109, 40, 217, 0.15);
}

.brief-content .outreach-box::before {
  content: '💬 Текст сообщения';
  position: absolute;
  top: -11px;
  left: 1rem;
  background: #6d28d9;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.brief-content .outreach-box p {
  color: #e9d5ff;
  font-size: 0.95rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   PRINT / PDF
══════════════════════════════════════════════════════════════════════════════ */

@media print {
  body { background: white; color: #111; }
  .sidebar, .sidebar + .main-content > *:not(.page-wrapper),
  header, footer, button, .no-print { display: none !important; }
  .main-content { margin-left: 0; }

  .brief-content { color: #111; }
  .brief-content h1, .brief-content h2, .brief-content h3 { color: #111; }
  .brief-content p, .brief-content li, .brief-content td { color: #333; }
  .brief-content hr { border-color: #ccc; }
  .brief-content table, .brief-content th, .brief-content td { border-color: #ccc; }
  .brief-content th { background: #f3f4f6; color: #111; }
  .brief-content .outreach-box { background: #f3e8ff; border-color: #7c3aed; }
  .brief-content .outreach-box p { color: #111; }
  .brief-content .outreach-box::before { background: #7c3aed; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════════════════════════ */

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

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

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Bounce dots for loading */
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }

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

  .card-grid {
    grid-template-columns: 1fr;
  }

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

  .page-wrapper {
    padding: 1rem;
  }
}
