/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Navigation ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 2rem;
}

.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #1e40af;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav-links { display: flex; gap: 0.25rem; margin-left: 0.5rem; }

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav-link:hover { background: #f1f5f9; color: #0f172a; }
.nav-link.active { background: #eff6ff; color: #1e40af; font-weight: 600; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== Page Header ===== */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; color: #0f172a; letter-spacing: -0.025em; }
.page-header p { color: #64748b; margin-top: 0.2rem; font-size: 0.875rem; }

/* ===== Card ===== */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
}

.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin-bottom: 1rem;
}

/* ===== Add Topic Form ===== */
.add-topic-card { margin-bottom: 2rem; }

.form-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }

.input-group { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }

.input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label-hint {
  font-weight: 400;
  color: #9ca3af;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
}

/* ===== Button tooltip wrapper ===== */
.tooltip-wrap {
  display: inline-flex;
}

/* ===== Info icon + tooltip ===== */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: default;
  vertical-align: middle;
  margin-left: 0.3rem;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  flex-shrink: 0;
}

.info-icon:hover { background: #94a3b8; }


input[type="text"] {
  padding: 0.575rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.9rem;
  outline: none;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Tag Input ===== */
.tags-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  cursor: text;
  min-height: 38px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tags-input-wrapper:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  color: #93c5fd;
  font-weight: 700;
  line-height: 1;
  font-size: 1rem;
}
.tag-remove:hover { color: #1d4ed8; }

.tag-default {
  background: #f1f5f9;
  color: #475569;
  cursor: default;
}
.tag-lock {
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1;
}

.tags-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
  color: #0f172a;
  flex: 1;
  min-width: 80px;
  padding: 0.1rem 0.2rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.575rem 1.1rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.12s, opacity 0.12s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }

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

.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; border-radius: 6px; }

/* ===== Stats Row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.stat-value { font-size: 2rem; font-weight: 800; color: #0f172a; letter-spacing: -0.03em; }
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.keyword-tag {
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.location-tag {
  background: #f0fdf4;
  color: #15803d;
}

.event-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
}

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: #94a3b8; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: #64748b; margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.875rem; }


/* ===== Events Panel ===== */
.events-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.events-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.events-panel-header h2 { font-size: 1.05rem; font-weight: 700; color: #0f172a; }

.filter-bar {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fafafa;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  transition: all 0.12s;
}
.filter-tab:hover { background: #f1f5f9; }
.filter-tab.active { background: #0f172a; color: #fff; border-color: #0f172a; }

/* ===== Add URL Form ===== */
.add-url-bar {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.add-url-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.add-url-form input[type="text"] {
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
}

.add-url-toggle {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.add-url-toggle:hover { color: #1d4ed8; }

/* ===== Event Items ===== */
.events-list { overflow: hidden; }

.event-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
.event-item:last-child { border-bottom: none; }
.event-item:hover { background: #fafafa; }
.event-item.is-future { background: #fffbeb; }
.event-item.is-future:hover { background: #fef9c3; }

.event-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.event-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  flex: 1;
  line-height: 1.45;
}
.event-title:hover { color: #2563eb; }

.remove-event-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.1rem;
  flex-shrink: 0;
  transition: color 0.12s;
}
.remove-event-btn:hover { color: #ef4444; }

.find-events-btn {
  background: none;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.find-events-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.find-events-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.relevance-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
}

/* ===== Date filter row ===== */
.date-filter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.date-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.date-filter-select,
.date-filter-input {
  padding: 0.3rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #0f172a;
  background: #fff;
}
.date-filter-input { width: 110px; }
.date-filter-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-left: auto;
}

/* ===== View Tabs ===== */
.view-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.view-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.view-tab:hover { color: #0f172a; }
.view-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.view-tab-count {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 10px;
  min-width: 1.2rem;
  text-align: center;
}
.view-tab.active .view-tab-count { background: #dbeafe; color: #1d4ed8; }

/* ===== Calendar ===== */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem 0.5rem;
}
.cal-title { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.cal-nav-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.cal-nav-btn:hover { background: #f1f5f9; color: #0f172a; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 1.25rem 1rem;
}
.cal-day-hdr {
  background: #f8fafc;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 0.4rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-cell {
  background: #fff;
  min-height: 80px;
  padding: 0.3rem 0.35rem;
  overflow: hidden;
}
.cal-cell.cal-blank { background: #fafafa; }
.cal-cell.cal-today { background: #eff6ff; }
.cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  display: block;
  margin-bottom: 0.2rem;
}
.cal-today .cal-day-num {
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-event-tag {
  font-size: 0.68rem;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: background 0.1s;
}
.cal-event-tag-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.cal-event-tag .remove-event-btn {
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0;
  padding: 0;
  color: inherit;
  transition: opacity 0.1s, color 0.1s;
}
.cal-event-tag:hover .remove-event-btn { opacity: 1; }
.cal-event-tag:hover { background: #bfdbfe; }
.cal-event-tag.cal-event-relevant { background: #dcfce7; color: #15803d; border-left: 2px solid #22c55e; }
.cal-event-tag.cal-event-relevant:hover { background: #bbf7d0; }
.cal-event-tag.cal-event-irrelevant { background: #f1f5f9; color: #94a3b8; opacity: 0.65; }
.cal-event-tag.cal-event-irrelevant:hover { background: #e2e8f0; opacity: 1; }
.no-date-section { padding: 0 1.25rem 1.25rem; }
.no-date-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}
.cal-no-date-item {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cal-no-date-item:hover { background: #f8fafc; }
.cal-no-date-title { font-size: 0.82rem; font-weight: 600; color: #0f172a; }
.cal-no-date-desc  { font-size: 0.75rem; color: #64748b; }
.cal-no-date-loc   { font-size: 0.72rem; color: #94a3b8; }
/* ===== Auto-scan log ===== */
.auto-scan-log {
  margin: 0 1.25rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow-y: auto;
  max-height: 190px;
  font-size: 0.8rem;
}

.auto-scan-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.45;
  color: #475569;
}
.auto-scan-entry:last-child { border-bottom: none; }

.auto-scan-icon {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  font-size: 0.72rem;
  margin-top: 0.1rem;
  color: #94a3b8;
}

.auto-scan-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-scan-pct  { flex-shrink: 0; font-variant-numeric: tabular-nums; color: #94a3b8; font-size: 0.72rem; }

.auto-scan-track {
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 0.25rem;
  overflow: hidden;
}
.auto-scan-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Type-specific colours */
.auto-scan-start     { color: #64748b; }
.auto-scan-ranking   { color: #2563eb; font-weight: 600; }
.auto-scan-ranking   .auto-scan-icon { color: #2563eb; }
.auto-scan-progress  { color: #0f172a; }
.auto-scan-progress  .auto-scan-icon { color: #94a3b8; }
.auto-scan-page_done { color: #475569; }
.auto-scan-done      { color: #15803d; font-weight: 600; }
.auto-scan-done      .auto-scan-icon { color: #22c55e; }
.auto-scan-error,
.auto-scan-page_error { color: #dc2626; }
.auto-scan-error      .auto-scan-icon,
.auto-scan-page_error .auto-scan-icon { color: #dc2626; }

/* ===== Calendar Legend ===== */
.cal-legend-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cal-legend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: default;
  flex-shrink: 0;
  line-height: 1;
  font-style: normal;
}
.cal-legend-btn:hover { background: #94a3b8; }

.cal-legend-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  border-radius: 7px;
  width: 265px;
  white-space: normal;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}
.cal-legend-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
}

.cal-legend-wrap:hover .cal-legend-popup { opacity: 1; }

.cal-legend-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.55rem;
}

.cal-legend-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}
.cal-legend-row:last-child { margin-bottom: 0; }

.cal-legend-swatch {
  width: 26px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cal-legend-relevant   { background: #dcfce7; border-left: 2px solid #22c55e; }
.cal-legend-neutral    { background: #dbeafe; }
.cal-legend-irrelevant { background: #e2e8f0; opacity: 0.7; }

.cal-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #94a3b8;
}
.cal-empty-state strong { display: block; font-size: 0.95rem; color: #64748b; margin-bottom: 0.4rem; }
.cal-empty-state p { font-size: 0.82rem; }

.event-description {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.future-badge {
  background: #fef3c7;
  color: #92400e;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== Spinners ===== */
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}

.spinner-dark {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,0,0,0.12);
  border-top-color: #475569;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}

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

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #f1f5f9;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  min-width: 220px;
  max-width: 320px;
  animation: slideUp 0.2s ease;
  pointer-events: all;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid #3b82f6; }

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

/* ===== Public pages (login, contact, etc.) ===== */
.login-body {
  background: #0f172a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

.login-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.login-header { margin-bottom: 1.75rem; text-align: center; }

.login-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.login-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.login-card .input-group label { color: #94a3b8; }

.login-card input,
.login-card textarea {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
}
.login-card input::placeholder,
.login-card textarea::placeholder { color: #475569; }
.login-card input:focus,
.login-card textarea:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.login-card p { color: #94a3b8; }

.login-message {
  border-radius: 7px;
  padding: 0.6rem 0.875rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.login-message--error {
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.4);
  color: #fca5a5;
}
.login-message--warning {
  background: rgba(217,119,6,0.15);
  border: 1px solid rgba(217,119,6,0.4);
  color: #fcd34d;
}
.login-message--success {
  background: rgba(21,128,61,0.15);
  border: 1px solid rgba(21,128,61,0.4);
  color: #86efac;
}
.login-message--info {
  background: rgba(29,78,216,0.15);
  border: 1px solid rgba(29,78,216,0.4);
  color: #93c5fd;
}
.login-forgot {
  font-size: 0.8rem;
  color: #3b82f6;
  text-decoration: none;
}
.login-forgot:hover {
  text-decoration: underline;
}

/* ===== Public site nav (home, login, contact, etc.) ===== */
.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}
.home-nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.home-nav-links { display: flex; gap: 0.75rem; align-items: center; }
.home-nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s;
}
.home-nav-link:hover { color: #f8fafc; }
.home-btn-outline {
  border: 1px solid #334155;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.home-btn-outline:hover { border-color: #64748b; color: #f8fafc; }

/* ===== Locations textarea (admin) ===== */
.locations-textarea {
  width: 100%;
  min-height: 90px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.875rem;
  font-family: inherit;
  color: #0f172a;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
.locations-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Admin table ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table thead th {
  padding: 0.6rem 1.5rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  border-bottom: 1px solid #e2e8f0;
}

.admin-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: #fafafa; }
.admin-table.dark tbody tr:hover { background: rgba(255,255,255,0.06); }
.admin-table.dark tbody tr { border-bottom-color: #1e293b; }

.admin-table tbody td { padding: 0.75rem 1.5rem; color: #0f172a; }

.admin-td-main { font-weight: 600; }

.role-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-admin { background: #eff6ff; color: #1d4ed8; }
.role-staff { background: #f1f5f9; color: #475569; }

/* ===== Source Badges (used in builder + sentiment templates) ===== */
.source-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.source-badge.twitter { background: #eff6ff; color: #1d4ed8; }
.source-badge.manual  { background: #f0fdf4; color: #15803d; }

/* ===== Responsive ===== */
@media (max-width: 800px) {
  .form-row { flex-direction: column; }
  nav { padding: 0 1rem; gap: 1rem; }
}
