﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #E8620A;
  --brand-hover: #CC5208;
  --brand-dim: rgba(232,98,10,0.15);
  --bg: #0f1117;
  --bg-card: #1a1c23;
  --bg-input: #22252e;
  --bg-hover: #1e2028;
  --border: #2a2d38;
  --border-light: #33374a;
  --text: #f0f0f0;
  --text-secondary: #8b95a8;
  --text-muted: #4a5168;
  --google-blue: #4285f4;
  --facebook-blue: #1877f2;
  --star: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --sidebar-w: 220px;
}

html { height: 100%; } body { min-height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--brand); text-decoration: none; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; color: var(--text); }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.3; color: var(--text); }
h3 { font-size: 15px; font-weight: 600; color: var(--text); }
a:hover { text-decoration: underline; }

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 38px; height: 38px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.auth-logo .logo-text { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.auth-logo .logo-text span { color: var(--brand); }

.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; }
.auth-card .subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text); padding: 11px 14px; font-size: 15px;
  transition: border-color 0.15s; outline: none;
}
.form-group input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim); }
.form-group input::placeholder { color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); text-decoration: none; }

.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border-light); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--text-secondary); padding: 8px 14px; font-size: 13px; font-weight: 500; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }

.btn-sm { padding: 7px 13px; font-size: 13px; }

.btn-ai {
  background: linear-gradient(135deg, rgba(216,90,48,0.2), rgba(216,90,48,0.08));
  color: var(--brand);
  border: 1px solid rgba(216,90,48,0.45);
  box-shadow: 0 0 12px rgba(216,90,48,0.15);
}
.btn-ai:hover:not(:disabled) { background: linear-gradient(135deg, rgba(216,90,48,0.3), rgba(216,90,48,0.15)); box-shadow: 0 0 18px rgba(216,90,48,0.25); text-decoration: none; }

.btn-connect-google {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-light);
  font-size: 10px; padding: 10px 4px;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.btn-connect-google:hover { background: var(--bg-hover); text-decoration: none; }
.btn-connect-google svg { width: 20px; height: 20px; }

.btn-connect-facebook {
  background: var(--bg-card);
  color: white;
  border: 1px solid #60a5fa;
  font-size: 10px; padding: 10px 4px;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.btn-connect-facebook:hover { background: var(--bg-hover); text-decoration: none; }
.btn-connect-facebook svg { width: 20px; height: 20px; }

.btn-google {
  background: var(--bg-input); color: var(--text); border: 1px solid var(--border-light);
  width: 100%; margin-bottom: 20px; font-weight: 500;
}
.btn-google:hover { background: var(--bg-hover); text-decoration: none; }

.divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: var(--text-muted); font-size: 13px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-secondary); }

.error-banner {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #f87171;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; margin-bottom: 16px; display: none;
}
.error-banner.show { display: block; }

/* ── APP LAYOUT ── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #13151d;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 18px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-icon {
  width: 30px; height: 30px;
  background: var(--brand);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.logo-text { color: var(--text); }
.logo-accent { color: var(--brand); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.sidebar-item.active {
  background: rgba(216,90,48,0.12);
  color: var(--text);
  border-left: 3px solid var(--brand);
  padding-left: 9px;
}
.sidebar-item.active svg { stroke: var(--brand); }

.sidebar-badge {
  margin-left: auto;
  background: var(--brand);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.restaurant-avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  flex-shrink: 0;
}

.logout-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.logout-btn:hover { background: var(--bg-hover); color: #ef4444; }

.restaurant-info { min-width: 0; }
.restaurant-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.restaurant-plan { font-size: 11px; color: var(--text-secondary); }

/* ── MAIN AREA ── */
.main-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
  padding: 0 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-gutter: stable;
}

/* ── DASHBOARD STICKY HEADER ── */
.dashboard-sticky-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #0f1117;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  transform: translateZ(0);
}

/* In dashboard, sticky-filters sits below the sticky header */
.dashboard-sticky-header ~ .content-row .sticky-filters {
  top: 95px;
}



/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.greeting {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.greeting-sub { font-size: 14px; color: var(--text-secondary); margin-top: 3px; }
.highlight-text { color: var(--brand); font-weight: 600; }

.connect-btns { display: flex; align-items: center; gap: 8px; }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-amber::before { background: #f59e0b; }
.stat-orange::before { background: var(--brand); }
.stat-blue::before { background: #3b82f6; }
.stat-green::before { background: #22c55e; }

.stat-label {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px;
}

.stat-value {
  font-size: 26px; font-weight: 800; letter-spacing: -1px;
  line-height: 1; margin-bottom: 4px; color: var(--text);
}

.stat-sub { font-size: 12px; color: var(--text-secondary); }
/* Average Rating card: stars sit beside the number instead of on their own
   line below, on both desktop and mobile. */
.rating-value-row { display: flex; align-items: baseline; gap: 8px; }
.rating-value-row .stat-value { margin-bottom: 0; }
.rating-value-row .stat-sub { margin-bottom: 0; }
.stat-trend { font-size: 12px; margin-top: 4px; }
.trend-up { color: #4ade80; }
.trend-down { color: #f87171; }

/* ── CONTENT ROW ── */
.content-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* ── REVIEWS SECTION ── */
.reviews-section { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.pending-pill {
  background: var(--brand);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.sticky-filters {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0f1117;
  padding: 12px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ── TAB FILTERS ── */
.tab-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.tab-btn:hover { background: var(--bg-hover); color: var(--text); }

.tab-btn.active {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text);
  font-weight: 600;
}

/* ── REVIEWS LIST ── */
.reviews-list { display: flex; flex-direction: column; gap: 12px; }

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.2s ease, box-shadow 0.2s ease;
  padding: 20px;
}
.review-card:hover { border-color: rgba(216,90,48,0.3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.rep-panel:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.review-card.responded { border-left: 3px solid var(--green); }
.review-card.low-rating { border-left: 3px solid var(--red); }

/* Briefly highlights the review a user was sent to from an alert's
   "Respond now" link, so it's obvious which one it jumped to. */
.review-card.review-highlight {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,98,10,0.35);
  animation: reviewHighlightFade 2.5s ease forwards;
}
@keyframes reviewHighlightFade {
  0%, 60% { box-shadow: 0 0 0 3px rgba(232,98,10,0.35); }
  100% { box-shadow: 0 0 0 3px rgba(232,98,10,0); }
}

.review-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.reviewer-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-input);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--brand);
  flex-shrink: 0;
  border: 2px solid var(--border-light);
}

.reviewer-info { flex: 1; min-width: 0; }

.reviewer-top {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 3px;
}

.reviewer-name { font-weight: 600; font-size: 14px; }

.review-meta {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; flex-shrink: 0;
}

.review-time { font-size: 11px; color: var(--text-muted); }

.badge-pending {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(216,90,48,0.15);
  color: var(--brand);
  border: 1px solid rgba(216,90,48,0.3);
}

.badge-responded {
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
}

.platform-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.4px;
}
.badge-google { background: rgba(66,133,244,0.12); color: #60a5fa; border: 1px solid rgba(66,133,244,0.2); }
.badge-facebook { background: rgba(129,140,248,0.12); color: #818cf8; border: 1px solid rgba(129,140,248,0.2); }
.badge-yelp { background: rgba(211,34,34,0.12); color: #f87171; border: 1px solid rgba(211,34,34,0.25); }

.stars { display: inline-flex; gap: 1px; font-size: 13px; }
.star-filled { color: var(--star); }
.star-empty { color: var(--text-muted); }

.review-date { font-size: 11px; color: var(--text-muted); }

.review-content {
  color: var(--text-secondary); font-size: 14px; line-height: 1.7; margin-bottom: 14px;
}

.review-actions { display: flex; align-items: center; gap: 8px; }

/* ── RESPONSE AREA ── */
.response-area {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: none;
}
.response-area.open { display: block; }

.existing-response {
  background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.15);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px;
}
.existing-response-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
  color: #4ade80; margin-bottom: 6px;
}
.existing-response-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.response-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text); padding: 12px 14px;
  font-size: 14px; font-family: inherit; line-height: 1.6; resize: vertical;
  min-height: 100px; outline: none; transition: border-color 0.15s; margin-bottom: 10px;
}
.response-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim); }
.response-textarea::placeholder { color: var(--text-muted); }

.response-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.response-footer-right { display: flex; align-items: center; gap: 8px; }

.ai-loading { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }

/* ── RIGHT COLUMN ── */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 300px;
  min-width: 300px;
  flex-shrink: 0;
}

/* Right panel: fixed on screen with its own scroll, independent of the
   center reviews list. Scrollbar hidden (still scrolls with the mouse
   wheel, just no visible scrollbar track/thumb). */
.right-column-inner {
  position: fixed;
  top: 112px;
  right: 32px;
  width: 310px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 50;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* old Edge */
}
.right-column-inner::-webkit-scrollbar {
  display: none; /* Chrome, Brave, Edge, Safari */
}

/* ── AI PANEL ── */
.ai-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
}

.ai-panel-body { padding: 16px 18px; flex: 1; }

.ai-panel-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.ai-review-preview {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.ai-reviewer-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.ai-review-quote {
  font-size: 13px; color: var(--text-secondary);
  font-style: italic; line-height: 1.5;
}

.ai-suggestion-text {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.7;
}

/* ── ALERTS PANEL ── */
.alerts-panel {
  width: 300px;
  min-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.alerts-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.alerts-list { padding: 8px 0; }

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 18px;
  transition: background 0.15s;
}
.alert-item:hover { background: var(--bg-hover); }

.alert-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.alert-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.alert-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── REPUTATION PANEL ── */
.rep-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: box-shadow 0.2s ease;
}

.rep-section {
  padding: 16px 18px;
}

.rep-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rep-section-label svg { flex-shrink: 0; }

.rep-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* Score */
.rep-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rep-score-number {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
  transition: color 0.5s ease;
}

.rep-score-ring {
  flex-shrink: 0;
}

.rep-score-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  transition: color 0.5s ease;
}

.rep-score-tip {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Sentiment bars */
.sentiment-bars { display: flex; flex-direction: column; gap: 8px; }

.sentiment-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sentiment-label {
  font-size: 11px;
  color: var(--text-secondary);
  width: 46px;
  flex-shrink: 0;
}

.sentiment-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.sentiment-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.8s ease;
}

.sentiment-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Week stats */
.week-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.week-stat {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.week-stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text);
}

.week-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Inline alerts */
.alerts-panel-inline {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

/* AI suggestion panel */
#aiSuggestionPanel {
  flex-direction: column;
}

/* ── AI COPY BUTTON ── */
.ai-copy-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ai-copy-btn:hover { background: var(--bg-hover); color: var(--text); }
.ai-copy-btn.copied { color: #4ade80; }

.copy-tooltip {
  position: absolute;
  right: 18px;
  top: 44px;
  background: #4ade80;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  animation: fadeIn 0.15s ease;
  z-index: 10;
}

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

/* ── AI HISTORY ── */
.ai-history {
  border-top: 1px solid var(--border);
  padding: 12px 18px 16px;
}

.ai-history-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.ai-history-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.ai-history-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.ai-history-actions {
  display: flex;
  gap: 6px;
}

.ai-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ai-history-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── SPINNER ── */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--border-light);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 50px 24px; color: var(--text-secondary); }
.empty-state .icon { font-size: 40px; margin-bottom: 14px; opacity: 0.4; }
.empty-state h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 13px; }

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #222 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-card { height: 140px; border-radius: var(--radius); margin-bottom: 12px; }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 12px 18px; font-size: 14px;
  box-shadow: var(--shadow); animation: slideIn 0.2s ease; max-width: 300px;
}
.toast.success { border-left: 3px solid var(--green); color: #4ade80; }
.toast.error { border-left: 3px solid var(--red); color: #f87171; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  /* Reputation module: shown on mobile too (previously hidden), stacked
     above everything else since the score/sentiment/alerts summary is
     what a returning user wants to see first. No fixed position and no
     independent scroll here, it just flows and scrolls with the page
     like a normal block, same as the rest of the mobile layout. */
  .right-column {
    display: flex;
    order: -1;
    width: 100%;
    min-width: 0;
  }
  .right-column-inner {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
  }
  .content-row { flex-direction: column; }
  /* "This Week" repeats Pending reply / Response rate, which the stat cards
     above already show with more detail (trend vs previous period). On
     desktop the module stays fixed on screen so it's still worth having as
     a glanceable reference; on mobile it just flows away with the page, so
     it's pure repetition there. Hide it (and its own divider) here only. */
  #weekSection, #weekDivider { display: none; }
}

@media (max-width: 640px) {
  .sidebar { display: none; }
  .app-layout { flex-direction: column; }
  .main-area { padding: 16px 12px 140px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 8px; }
  .stat-value { font-size: 22px; }
  .rating-value-row .stat-sub { font-size: 13px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .connect-btns { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  /* Same 2x2 tile layout as before, just shorter: all four buttons shrink
     together so the reputation module underneath starts higher up. */
  .connect-btns .btn, .connect-btns .btn-sm { flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 4px !important; font-size: 10px !important; font-weight: 600; width: 100% !important; min-width: 0; min-height: 44px !important; }
  .connect-btns .btn svg { width: 16px; height: 16px; }
  .tab-filters { gap: 4px; }
  .tab-btn { padding: 7px 13px; font-size: 13px; }
  .review-card { padding: 14px; }
  .greeting { font-size: 20px; }
  .auth-card { padding: 32px 20px; }
  .dashboard-sticky-header { padding: 14px 0 8px; position: relative; margin-bottom: 8px; border-bottom: none; }
  .sticky-filters { position: relative; top: auto; z-index: 100; padding: 8px 0 4px; }
  .content-row { gap: 0; }
  .dashboard-page .sticky-filters { margin-top: -95px; }
  .dashboard-page .reviews-list { margin-top: 116px; }
  .sidebar-logo .logo-icon svg { width: 28px; height: 28px; }
  .reviews-page .sticky-filters,
  .responses-page .sticky-filters,
  .alerts-page .sticky-filters,
  .analytics-page .sticky-filters { position: sticky; top: 0; z-index: 200; background: #0f1117; }
}

.mobile-settings-btn {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  z-index: 400;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.mobile-account-btn {
  display: none;
  position: fixed;
  top: 12px;
  right: 56px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  z-index: 400;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* Brighten the icons themselves — the muted gray they shipped with (matched to the
   bottom nav's "inactive tab" color) barely registered against the dark button
   background. These aren't tabs with an active/inactive state, so they should just
   read clearly at rest. */
.mobile-settings-btn svg,
.mobile-account-btn svg {
  stroke: var(--text);
}

@media (max-width: 640px) {
  .mobile-settings-btn { display: flex; }
  .mobile-account-btn { display: flex; }
  .mobile-scroll-spacer { display: block; height: 90px; }
}

.sidebar-account-link:hover .restaurant-avatar-sm { box-shadow: 0 0 0 2px var(--brand); }
.sidebar-account-link:hover .restaurant-name { color: var(--brand); }

/* ── MOBILE BOTTOM NAV ── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #13151d;
  border-top: 1px solid var(--border);
  padding: 8px 0 12px;
  z-index: 500;
  justify-content: space-around;
  align-items: center;
}

@media (max-width: 640px) {
  .mobile-nav { display: flex; }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 9px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  transition: color 0.15s;
  position: relative;
}
.mobile-nav-item.active { color: var(--brand); }
.mobile-nav-item svg { width: 20px; height: 20px; }
.mobile-nav-badge {
  position: absolute;
  top: 0; right: 4px;
  background: var(--brand);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

