/* ═══════════════════════════════════════════════════
   ReviewReply Pro — Main Stylesheet
   ═══════════════════════════════════════════════════ */

:root {
  --bg:          #09090e;
  --surface:     #101018;
  --surface2:    #16161f;
  --surface3:    #1e1e2a;
  --border:      #252535;
  --border2:     #1c1c28;
  --accent:      #e8b84b;
  --accent-dim:  rgba(232,184,75,.12);
  --accent-glow: rgba(232,184,75,.2);
  --text:        #e8e8f2;
  --muted:       #6a6a88;
  --muted2:      #3a3a55;
  --green:       #3dd68c;
  --green-dim:   rgba(61,214,140,.12);
  --red:         #f87171;
  --red-dim:     rgba(248,113,113,.1);
  --orange:      #fb923c;
  --blue:        #60a5fa;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      10px;
  --radius-sm:   7px;
  --shadow:      0 4px 24px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,184,75,.06) 0%, transparent 70%);
}

.login-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 44px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}

.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo-icon {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 17px;
  color: #09090e;
}
.login-logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 20px;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.google-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 28px;
  background: #fff;
  color: #1f1f1f;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: box-shadow .2s, transform .15s;
  width: 100%;
  justify-content: center;
}
.google-btn:hover { box-shadow: 0 4px 16px rgba(0,0,0,.3); transform: translateY(-1px); }

.login-note {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.login-footer { font-size: 11px; color: var(--muted2); }

.alert {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 100%;
  text-align: center;
}
.alert-info { background: var(--accent-dim); border: 1px solid var(--accent-glow); color: var(--accent); }

/* ══════════════════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════════════════ */
body:not(.login-body) {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 14px;
  color: #09090e;
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 15px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px 10px;
}

.nav-biz {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all .15s;
}
.nav-biz:hover { background: var(--surface3); color: var(--text); }
.nav-biz.active { background: var(--accent-dim); color: var(--accent); }
.nav-biz.active .nav-biz-dot { background: var(--accent); }

.nav-biz-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted2);
  flex-shrink: 0;
}
.nav-biz-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.no-biz { font-size: 12px; color: var(--muted); padding: 10px 12px; line-height: 1.6; }

.btn-sync {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: all .2s;
}
.btn-sync:hover { border-color: var(--accent); color: var(--accent); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
  color: var(--muted);
  display: flex;
  padding: 4px;
  transition: color .15s;
}
.logout-btn:hover { color: var(--red); }

/* ── MAIN ── */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(9,9,14,.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  gap: 1px;
  border-bottom: 1px solid var(--border2);
  background: var(--border2);
}

.stat-card {
  flex: 1;
  padding: 16px 24px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.stat-label { font-size: 11px; color: var(--muted); }
.stat-warn .stat-num { color: var(--orange); }
.stat-ok   .stat-num { color: var(--green); }

/* ── REVIEWS AREA ── */
.reviews-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.welcome-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  gap: 12px;
  color: var(--muted);
}
.welcome-icon { font-size: 40px; margin-bottom: 8px; }
.welcome-state h2 { font-family: 'Syne', sans-serif; font-size: 20px; color: var(--text); }
.welcome-state p { font-size: 14px; }
.welcome-state strong { color: var(--accent); }

/* ── REVIEW CARDS ── */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  transition: border .2s;
}
.review-card:hover { border-color: var(--border); }
.review-card.status-published { border-left: 3px solid var(--green); }
.review-card.status-pending   { border-left: 3px solid var(--orange); }
.review-card.status-draft     { border-left: 3px solid var(--blue); }

.review-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reviewer-info { display: flex; align-items: center; gap: 10px; }

.reviewer-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  overflow: hidden;
}
.reviewer-avatar img { width: 100%; height: 100%; object-fit: cover; }

.reviewer-name { font-weight: 600; font-size: 14px; }
.review-date   { font-size: 11px; color: var(--muted); }

.review-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.stars { font-size: 14px; letter-spacing: 1px; }
.star-filled { color: var(--accent); }
.star-empty  { color: var(--muted2); }

.status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.badge-pending   { background: rgba(251,146,60,.12); color: var(--orange); }
.badge-published { background: var(--green-dim);     color: var(--green); }
.badge-draft     { background: rgba(96,165,250,.1);  color: var(--blue); }
.badge-skipped   { background: var(--surface3);       color: var(--muted); }

.review-comment {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
}
.review-comment.no-text { color: var(--muted); font-style: italic; }

.existing-reply {
  padding: 12px 14px;
  background: var(--green-dim);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  border-left: 2px solid var(--green);
  margin-bottom: 14px;
}
.existing-reply-label { font-size: 10px; color: var(--green); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px; }

.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #09090e;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #d4a63e; box-shadow: 0 4px 14px var(--accent-glow); }

.btn-secondary {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--border); background: var(--surface2); }

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: rgba(96,165,250,.3);
}
.btn-ghost:hover:not(:disabled) { background: rgba(96,165,250,.08); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { border-color: rgba(248,113,113,.3); color: var(--red); background: transparent; }
.btn-danger:hover { background: var(--red-dim); }

/* ── TONE SELECT ── */
.tone-select {
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border .15s;
}
.tone-select:focus { border-color: var(--accent); }
.tone-select option { background: #16161f; }

/* ── FILTERS ── */
.review-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--border); color: var(--text); }
.filter-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.filter-count { font-size: 10px; background: var(--surface3); padding: 1px 6px; border-radius: 10px; margin-left: 4px; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
}
.modal-backdrop.open { display: block; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  width: 620px;
  max-width: calc(100vw - 40px);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  z-index: 201;
  opacity: 0;
  pointer-events: none;
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
}
.modal.open { opacity: 1; pointer-events: all; transform: translate(-50%,-50%) scale(1); }

.modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 18px; }

.review-snippet {
  padding: 14px 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
}
.snippet-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.snippet-name { font-weight: 600; font-size: 13px; }
.snippet-comment { font-size: 14px; line-height: 1.65; color: var(--text); }

.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.badge-ai {
  font-size: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.reply-textarea {
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Instrument Serif', serif;
  font-size: 15px;
  line-height: 1.75;
  resize: vertical;
  outline: none;
  transition: border .15s;
  width: 100%;
}
.reply-textarea:focus { border-color: var(--accent); }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── LOADING ── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 999;
  transform: translateY(24px);
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }
.toast.warning { border-color: var(--orange); }

/* ── EMPTY REVIEWS ── */
.empty-reviews {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-reviews h3 { font-family: 'Syne', sans-serif; font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-reviews p  { font-size: 13px; }

/* ── LOADING OVERLAY ── */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
