:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-alt: #f0f4fb;
  --surface-dark: #0f172a;
  --surface-dark-alt: #111827;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe4f0;
  --brand: #0f6fff;
  --brand-2: #1fb6ff;
  --accent: #7c3aed;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 182, 255, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 26%),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(245, 248, 252, 0.82);
  border-bottom: 1px solid rgba(219, 228, 240, 0.7);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.05rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px rgba(15, 111, 255, 0.28);
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a,
.nav-actions a,
.nav-actions button {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
}

.nav-links a:hover,
.nav-actions a:hover,
.nav-actions button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  padding: 14px 22px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.68;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 16px 30px rgba(15, 111, 255, 0.22);
}

.button-dark {
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

.button-soft {
  color: var(--brand);
  background: #eaf2ff;
}

.button-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.hero {
  padding: 72px 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
}

.hero-card,
.panel,
.card,
.form-card,
.stat-card,
.table-card,
.metric-card,
.dashboard-shell,
.sidebar,
.summary-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--brand);
  font-weight: 800;
  font-size: 0.84rem;
}

.hero h1,
.page-title {
  margin: 18px 0 14px;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p,
.lead,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.actions,
.stack,
.inline-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.metrics-grid,
.cards-grid,
.stats-grid,
.dashboard-grid,
.admin-grid,
.two-col,
.three-col {
  display: grid;
  gap: 18px;
}

.metrics-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.two-col {
  grid-template-columns: 1.15fr 0.85fr;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric,
.card,
.stat-card,
.metric-card {
  padding: 22px;
}

.metric strong,
.stat-card strong,
.metric-card strong {
  display: block;
  font-size: 1.65rem;
  margin-bottom: 4px;
}

.section {
  padding: 32px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
}

.card h3,
.summary-card h3,
.form-card h3,
.table-card h3 {
  margin: 0 0 10px;
}

.card p,
.summary-card p,
.table-card p {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-blue { background: #e8f1ff; color: #1458d4; }
.badge-green { background: #e8f8ee; color: #13773a; }
.badge-violet { background: #f2ebff; color: #6d28d9; }
.badge-amber { background: #fff3de; color: #a16207; }
.badge-red { background: #feeaea; color: #b91c1c; }
.badge-slate { background: #eef2f7; color: #475569; }

.feature-list,
.mini-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.feature-list li,
.mini-list li {
  display: flex;
  gap: 10px;
  align-items: start;
  color: var(--muted);
}

.feature-list li::before,
.mini-list li::before {
  content: "●";
  color: var(--brand);
  font-size: 0.8rem;
  margin-top: 5px;
}

.form-shell,
.dashboard-layout,
.admin-layout {
  padding: 42px 0 54px;
}

.page-hero {
  text-align: center;
  padding: 44px 0 26px;
}

.page-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-card,
.summary-card,
.table-card,
.panel {
  padding: 26px;
}

.field,
.field-full {
  display: grid;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 111, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 111, 255, 0.1);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.field-error,
.status-note.error {
  color: var(--danger);
}

.status-note,
.helper {
  color: var(--muted);
  font-size: 0.88rem;
}

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.alert-error {
  background: #fff0f0;
  border-color: #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #ebfbef;
  border-color: #bbf7d0;
  color: #166534;
}

.auth-wrap,
.status-wrap {
  min-height: calc(100vh - 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 40px;
}

.auth-card,
.status-card {
  width: min(100%, 520px);
}

.status-card {
  text-align: center;
}

.status-icon {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 2rem;
}

.status-icon.success { background: #e9f8ef; color: var(--success); }
.status-icon.pending { background: #fff5dd; color: var(--warning); }
.status-icon.failed { background: #fff0f0; color: var(--danger); }

.summary-row,
.data-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(219, 228, 240, 0.65);
}

.summary-row:last-child,
.data-row:last-child {
  border-bottom: 0;
}

.dashboard-layout,
.admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.sidebar {
  padding: 20px;
  position: sticky;
  top: 98px;
  align-self: start;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.sidebar-nav button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 700;
}

.sidebar-nav button.active {
  background: #ecf4ff;
  color: var(--brand);
}

.admin-layout .sidebar {
  background: linear-gradient(180deg, #0f172a, #111827);
  border-color: #1f2937;
  color: #fff;
}

.admin-layout .sidebar-nav button {
  color: #93a4bc;
}

.admin-layout .sidebar-nav button.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.22);
}

.dashboard-main,
.admin-main {
  min-width: 0;
}

.tabs-section {
  display: none;
}

.tabs-section.active {
  display: block;
}

.list-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table th,
.list-table td,
.data-table th,
.data-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(219, 228, 240, 0.7);
  vertical-align: top;
}

.list-table th,
.data-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  min-height: 240px;
  margin-top: 22px;
}

.chart-bar {
  display: grid;
  gap: 10px;
  align-items: end;
  text-align: center;
}

.chart-bar-fill {
  min-height: 10px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}

.footer {
  padding: 30px 0 60px;
  color: var(--muted);
}

.footer-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 24px 28px;
}

.kicker {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
  font-weight: 800;
}

.empty-state,
.loading-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.spacer-top {
  margin-top: 20px;
}

.search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-row input {
  flex: 1;
}

@media (max-width: 980px) {
  .hero-grid,
  .two-col,
  .dashboard-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }

  .form-grid,
  .metrics-grid,
  .three-col,
  .chart-bars {
    grid-template-columns: 1fr;
  }

  .footer-card,
  .section-head,
  .summary-row,
  .data-row {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--container), calc(100% - 20px));
  }

  .hero,
  .page-hero,
  .form-shell,
  .dashboard-shell,
  .admin-shell {
    padding-top: 24px;
  }

  .button,
  .nav-actions a,
  .nav-actions button {
    width: 100%;
  }

  .nav-actions {
    width: 100%;
  }
}