/* ОтзывПульс — общие стили лендинга и дашборда */
:root {
  --bg: #0b1220;
  --surface: #111827;
  --surface2: #1e293b;
  --border: rgba(148, 163, 184, 0.2);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.15);
  --danger: #f87171;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.dash-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.dash-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .dash-layout {
    grid-template-columns: 200px 1fr;
    gap: 2rem;
  }
}

.dash-nav {
  position: sticky;
  top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.dash-nav a {
  color: var(--muted);
  padding: 0.4rem 0;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.dash-nav a:hover {
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-dim);
}

.dash-main {
  min-width: 0;
}

.dash-section {
  scroll-margin-top: 1rem;
  margin-bottom: 2rem;
}

.dash-h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.dash-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.35;
}

.muted-inline {
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.reviews-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.toolbar-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toolbar-select {
  min-width: 200px;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  font-size: 0.92rem;
}

.reviews-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.review-card {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.review-card:hover {
  border-color: rgba(45, 212, 191, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.review-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.review-rating {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.review-rating-max {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.88rem;
}

.review-time {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.review-pill {
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.review-pill-dim {
  background: var(--surface2);
  color: var(--muted);
  border-color: var(--border);
}

.review-author {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.35rem;
}

.review-text {
  margin: 0;
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.reviews-more-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.reviews-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Landing */
.landing-hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(165deg, #0b1220 0%, #0f172a 40%, #134e4a 100%);
  border-bottom: 1px solid var(--border);
}

.landing-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.landing-hero .lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #042f2e;
  box-shadow: 0 8px 24px rgba(20, 184, 166, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 10px 28px rgba(20, 184, 166, 0.45);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.landing-section {
  padding: 3rem 0;
}
.landing-section h2 {
  font-size: 1.35rem;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card-lite {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.card-lite h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.card-lite p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.code-block {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: #020617;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  overflow-x: auto;
  color: #a5f3fc;
  font-family: ui-monospace, Consolas, monospace;
}

.landing-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

/* Dashboard */
.dash-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.dash-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}
.dash-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

.kpi {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.kpi .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.kpi .value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

.dist {
  margin: 1.5rem 0;
}
.dist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}
.dist-row .stars,
.dist-label {
  min-width: 3.25rem;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.dist-label {
  font-size: 0.88rem;
}
.dist-bar {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}
.dist-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 999px;
}
.dist-count {
  width: 2.5rem;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.tag {
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-size: 0.82rem;
}

.reviews-wrap {
  margin-top: 0.5rem;
}
.reviews-wrap h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

table.reviews {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.reviews th,
table.reviews td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.reviews th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.reviews tr:last-child td {
  border-bottom: none;
}
.rating-cell {
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
}

.ai-summary {
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  white-space: pre-wrap;
}
.ai-summary.empty {
  color: var(--muted);
  font-style: italic;
}

.msg-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, #0b1220, #134e4a 50%, #0f172a);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem 1.75rem;
  border-radius: var(--radius);
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}
.login-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.login-card input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.login-card .btn-primary {
  width: 100%;
  border: none;
}

@media (max-width: 600px) {
  .dash-top {
    flex-direction: column;
    align-items: flex-start;
  }
}
