:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --line: rgba(16, 24, 40, 0.08);
  --text: #101828;
  --muted: #667085;
  --primary: #5b5cf0;
  --navy: #1d2a4d;
  --success: #18a957;
  --danger: #ef476f;
  --shadow: 0 24px 56px rgba(17, 24, 39, 0.10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(91, 92, 240, .12), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 195, 137, .10), transparent 22%),
    linear-gradient(180deg, #f9fbff 0%, #f6f8fc 48%, #fff 100%);
}

a { color: inherit; }

.auth-shell,
.dashboard-shell {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 48px 0;
}

.auth-card,
.dashboard-card,
.dashboard-top,
.stat-card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-card {
  width: min(100%, 560px);
  margin: 0 auto;
  border-radius: 28px;
  padding: 32px;
}

.auth-brand {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(91, 92, 240, 0.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 16px 0 10px;
  color: var(--navy);
  letter-spacing: -.04em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: 1.5rem; }

.auth-copy,
.empty-state,
.muted-note,
.stat-card small {
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--navy);
}

.auth-form input {
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 0 18px;
  font: inherit;
}

.auth-form input:focus {
  outline: 2px solid rgba(91, 92, 240, .18);
  border-color: rgba(91, 92, 240, .25);
}

.auth-form button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 18px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.auth-form button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #6a88ff 100%);
}

.button-secondary {
  color: var(--primary);
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
}

.auth-footer {
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 700;
}

.auth-alert {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 600;
}

.auth-alert-error {
  background: rgba(239, 71, 111, 0.08);
  color: #b42318;
  border: 1px solid rgba(239, 71, 111, 0.14);
}

.dashboard-shell {
  align-items: start;
  gap: 20px;
}

.dashboard-top {
  border-radius: 28px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  border-radius: 22px;
  padding: 22px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  color: var(--navy);
}

.dashboard-card {
  border-radius: 28px;
  padding: 28px;
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.reports-table-wrap {
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.reports-table th,
.reports-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.reports-table th {
  background: #f8faff;
  color: var(--navy);
  font-size: 13px;
}

.report-url-cell {
  max-width: 360px;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .dashboard-top {
    flex-direction: column;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }
}
