/* SEO Rank Dashboard — dark "Framer canvas" theme.
   Pure-black artboard, white display type, single blue accent for links/focus. */

:root {
  color-scheme: dark;
  --font-display: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Menlo", "Consolas", monospace;

  --canvas: #090909;
  --surface-1: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #242424;
  --hairline: #262626;
  --hairline-soft: #1a1a1a;

  --ink: #ffffff;
  --text: #ededed;
  --muted: #9a9a9a;
  --muted-soft: #6a6a6a;

  --accent: #0099ff;
  --accent-hover: #33adff;
  --accent-soft: rgba(0, 153, 255, 0.14);
  --accent-ring: rgba(0, 153, 255, 0.35);

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.13);
  --info: #0099ff;
  --info-soft: rgba(0, 153, 255, 0.13);
  --warning: #ff9e3d;
  --warning-soft: rgba(255, 158, 61, 0.13);
  --danger: #ff5577;
  --danger-soft: rgba(255, 85, 119, 0.13);

  --gradient-violet: #6a4cf5;
  --gradient-magenta: #d44df0;
  --gradient-orange: #ff7a3d;

  --shadow-keyline: 0 0 0 1px var(--hairline);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --focus: 0 0 0 3px var(--accent-soft);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --pill: 100px;

  /* Subtle "lifted surface" depth on the dark canvas (Framer level-2 light-edge). */
  --lift: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 1px 2px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.011em;
  font-feature-settings: "cv01", "cv05", "cv09", "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease;
}

a:hover {
  color: var(--accent-hover);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

/* ------------------------------------------------------------------ Sidebar */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: var(--canvas);
  border-right: 1px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #000;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.side-nav {
  display: grid;
  gap: 2px;
}

.side-nav__item,
.side-subnav__item {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}

.side-nav__item:hover,
.side-subnav__item:hover {
  background: var(--surface-1);
  color: var(--ink);
}

.side-nav__item.is-active,
.side-subnav__item.is-active {
  background: var(--surface-1);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--accent);
}

.project-context {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.side-label {
  padding: 0 11px;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-switch {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: var(--surface-1);
  transition: border-color 120ms ease, background 120ms ease;
}

.project-switch:hover {
  border-color: var(--surface-3);
  background: var(--surface-2);
  color: var(--muted);
}

.project-switch strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-switch span {
  color: var(--muted-soft);
  font-size: 12px;
}

.side-subnav {
  display: grid;
  gap: 2px;
}

.side-subnav__item {
  padding-left: 20px;
}

/* ------------------------------------------------------------------ Topbar */

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(9, 9, 9, 0.72);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.search-box {
  width: min(520px, 50vw);
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--muted-soft);
}

.search-box::before {
  content: "⌕";
  margin-right: 8px;
  font-size: 15px;
  color: var(--muted-soft);
}

.topbar-note,
.muted,
.small {
  color: var(--muted);
}

.topbar-note {
  font-size: 12px;
  font-weight: 500;
}

.breadcrumb {
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.user-menu a {
  color: var(--ink);
  font-weight: 500;
}

.user-menu a:hover {
  color: var(--accent);
}

.env-badge,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ Content */

.content {
  display: grid;
  gap: 22px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px 32px 64px;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.page-header p {
  margin-top: 6px;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.hero,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.hero-compact {
  grid-template-columns: 1fr;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.main-column,
.right-rail {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.main-column {
  overflow: hidden;
}

.right-rail {
  position: sticky;
  top: 80px;
}

/* ------------------------------------------------------------------ Panels & cards */

.panel,
.project-card,
.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift);
}

.panel {
  padding: 20px;
}

.project-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  color: inherit;
  transition: background 140ms ease, border-color 140ms ease;
}

.project-card:hover {
  background: var(--surface-2);
  border-color: var(--surface-3);
}

.project-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--font-display);
}

h1 {
  font-size: 30px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero > div > p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.project-card__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.projects-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.projects-panel {
  min-height: 360px;
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(390px, 0.9fr);
  gap: 16px;
  align-items: center;
  min-height: 84px;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--lift);
  color: inherit;
  transition: background 140ms ease, border-color 140ms ease;
}

.project-row:hover {
  border-color: var(--surface-3);
  background: var(--surface-2);
}

.project-row__main {
  min-width: 0;
}

.project-row__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.project-row__stats span,
.project-row__stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.project-row__stats strong {
  display: inline-block;
  color: var(--ink);
  font-size: 19px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-lg);
}

.cards,
.stats-grid {
  display: grid;
  gap: 12px;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stats-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.hero-stats {
  margin-top: 18px;
}

/* ------------------------------------------------------------------ KPI / metrics */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--lift);
  overflow: hidden;
}

.metric-card {
  min-height: 94px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 18px 18px;
  border: 0;
  border-right: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.metric-card strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.stat-card,
.stats-grid > div {
  padding: 15px 16px;
}

.stat-card span,
.stats-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stat-card strong,
.stats-grid strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ Forms */

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-soft);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus);
  background: var(--surface-1);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.5;
}

button {
  min-height: 38px;
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--pill);
  background: var(--ink);
  color: #000;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: none;
  transition: background 140ms ease, border-color 140ms ease, transform 80ms ease, opacity 140ms ease;
}

button:hover {
  background: #e4e4e4;
  border-color: #e4e4e4;
}

button:active {
  transform: scale(0.98);
}

.button-secondary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--pill);
  background: var(--surface-1);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: none;
}

.button-secondary:hover {
  border-color: var(--surface-3);
  background: var(--surface-2);
  color: var(--ink);
}

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

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

.checkbox input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--accent);
}

.notice {
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

/* ------------------------------------------------------------------ Tabs / chips */

.tabs,
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tabs {
  margin-top: 14px;
}

.filter-chips {
  margin-top: 14px;
}

.sort-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -2px 0 14px;
}

.sort-toolbar > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.tab,
.filter-chip,
.sort-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--pill);
  background: var(--surface-1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.tab:hover,
.filter-chip:hover,
.sort-chip:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tab.is-active,
.filter-chip.is-active,
.sort-chip.is-active {
  border-color: var(--surface-3);
  background: var(--surface-3);
  color: var(--ink);
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(120px, 160px) auto;
  gap: 12px;
  align-items: end;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* ------------------------------------------------------------------ Tables */

.table-wrap {
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--lift);
}

/* Long "found URL" cells: one tidy line with ellipsis instead of a ragged 3-line wrap. */
td.small a {
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  word-break: normal;
}

.keyword-table-wrap {
  max-height: 620px;
}

.compact-table {
  max-height: 240px;
}

.compact-table table {
  min-width: 0;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
  font-size: 12px;
}

.keyword-table-wrap table {
  min-width: 720px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  font-size: 13px;
  color: var(--text);
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: var(--surface-2);
}

tr:last-child td {
  border-bottom: 0;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: inherit;
}

.sort-link:hover {
  color: var(--ink);
}

.num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ Deltas & badges */

.delta-up,
.delta-down,
.delta-flat,
.job-badge,
.cell-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.delta-up,
.delta-down,
.delta-flat {
  min-width: 44px;
  padding: 3px 9px;
}

.delta-up {
  color: var(--success);
  background: var(--success-soft);
}

.delta-down {
  color: var(--danger);
  background: var(--danger-soft);
}

.delta-flat {
  color: var(--muted);
  background: var(--surface-2);
}

.job-badge {
  min-width: 82px;
  padding: 3px 9px;
}

.job-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.job-running {
  color: var(--info);
  background: var(--info-soft);
}

.job-done {
  color: var(--success);
  background: var(--success-soft);
}

.job-error {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ------------------------------------------------------------------ Chart */

.chart-card {
  min-height: 330px;
}

.chart-wrap {
  position: relative;
  height: 260px;
  overflow: hidden;
}

.chart-wrap canvas {
  max-width: 100%;
}

.action-panel {
  border-color: var(--surface-3);
}

.latest-job {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.latest-job > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ------------------------------------------------------------------ Disclosure */

.disclosure {
  padding: 0;
}

.disclosure summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  list-style-position: inside;
}

.disclosure[open] {
  padding-bottom: 18px;
}

.disclosure[open] summary {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.disclosure form {
  padding: 0 18px;
}

.back {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.back:hover {
  color: var(--accent);
}

.small {
  font-size: 12px;
  line-height: 18px;
}

.small a {
  word-break: break-word;
}

/* ------------------------------------------------------------------ Dynamics table */

.dynamics-wrap {
  max-height: 70vh;
}

.dynamics-table {
  min-width: 1040px;
}

.dynamics-table th,
.dynamics-table td {
  padding: 9px 12px;
}

.sticky-keyword {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 310px;
  max-width: 420px;
  background: var(--surface-2);
  box-shadow: 1px 0 0 var(--hairline);
}

td.sticky-keyword {
  background: var(--surface-1);
}

th.sticky-keyword {
  z-index: 4;
}

.dynamics-date {
  min-width: 82px;
  text-align: center;
}

.dynamics-date span,
.dynamics-date small {
  display: block;
}

.dynamics-date small {
  margin-top: 2px;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 500;
}

.keyword-title {
  max-width: 390px;
  color: var(--ink);
  font-weight: 600;
  line-height: 18px;
}

.keyword-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  word-break: break-word;
}

.dynamics-cell {
  min-width: 82px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cell-position {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cell-delta {
  min-width: 34px;
  margin-top: 4px;
  padding: 1px 7px;
}

.cell-delta-up {
  color: var(--success);
  background: var(--success-soft);
}

.cell-delta-down {
  color: var(--danger);
  background: var(--danger-soft);
}

.cell-delta-flat {
  color: var(--muted);
  background: var(--surface-2);
}

.position-top10 {
  background: var(--success-soft);
}

.position-top30 {
  background: var(--info-soft);
}

.position-low {
  background: var(--warning-soft);
}

.position-missing {
  background: var(--surface-2);
  color: var(--muted);
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* ------------------------------------------------------------------ Auth */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 18% -10%, rgba(106, 76, 245, 0.20), transparent 60%),
    radial-gradient(820px 520px at 100% 0%, rgba(212, 77, 240, 0.14), transparent 55%),
    radial-gradient(760px 600px at 80% 120%, rgba(0, 153, 255, 0.16), transparent 60%),
    var(--canvas);
}

.auth-card {
  width: min(100%, 396px);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  background: rgba(20, 20, 20, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-card h1 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-card button {
  margin-top: 4px;
}

.login-error {
  padding: 11px 14px;
  border: 1px solid var(--danger-soft);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 600;
}

/* ------------------------------------------------------------------ Scrollbars */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #2e2e2e;
  border: 2px solid var(--canvas);
  border-radius: var(--pill);
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ------------------------------------------------------------------ Responsive */

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .side-nav {
    grid-template-columns: repeat(3, max-content);
    overflow-x: auto;
  }

  .topbar {
    position: static;
    padding: 0 16px;
  }

  .search-box {
    width: 100%;
  }

  .topbar-actions {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .hero,
  .split,
  .filters,
  .page-header,
  .dashboard-grid,
  .projects-grid,
  .project-row {
    grid-template-columns: 1fr;
  }

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

  .right-rail {
    position: static;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .project-row__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 16px;
  }

  table {
    min-width: 760px;
  }

  .panel-head {
    display: grid;
  }

  .sticky-keyword {
    min-width: 240px;
    max-width: 280px;
  }
}

@media (max-width: 620px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }
}
