:root {
  --bg: #08111f;
  --panel: rgba(15, 27, 47, 0.88);
  --border: rgba(164, 191, 255, 0.15);
  --text: #eef4ff;
  --muted: #94a6c6;
  --brand: #4ade80;
  --brand-strong: #22c55e;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 25%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 20%),
    linear-gradient(160deg, #050a14 0%, #0b1526 42%, #07101c 100%);
  color: var(--text);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(34, 197, 94, 0.05), transparent 30%),
    linear-gradient(310deg, rgba(96, 165, 250, 0.08), transparent 35%);
}

.hidden {
  display: none !important;
}

.auth-view,
.dashboard-view {
  position: relative;
  z-index: 1;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card,
.panel,
.sidebar {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(100%, 620px);
  border-radius: var(--radius-xl);
  padding: 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

h3 {
  font-size: 1.4rem;
}

h4 {
  font-size: 1rem;
}

.auth-copy,
code,
.message,
.pill,
input,
select,
button,
table {
  font-size: 0.95rem;
}

code {
  font-family: Consolas, "Courier New", monospace;
  color: #d4f7e1;
}

.auth-copy {
  margin: 18px 0 28px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 60ch;
}

.auth-form,
.filters {
  display: grid;
  gap: 14px;
}

.auth-form label,
.api-config {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input,
select,
button {
  width: 100%;
  border: 1px solid rgba(173, 194, 255, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 30, 0.85);
  color: var(--text);
  padding: 13px 14px;
}

input::placeholder {
  color: rgba(148, 166, 198, 0.75);
}

button {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(173, 194, 255, 0.3);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand-strong), #16a34a);
  color: #05110a;
  font-weight: 700;
}

.ghost-button {
  background: rgba(13, 22, 37, 0.65);
  color: var(--text);
}

.auth-footer,
.topbar,
.panel-header,
.subpanel-header,
.pagination,
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-footer {
  margin-top: 20px;
  align-items: end;
}

.auth-footer .api-config {
  flex: 1;
}

.message {
  margin-top: 16px;
  color: var(--muted);
  min-height: 20px;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 0 24px 24px;
}

.topbar {
  padding: 24px;
}

.admin-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 18, 30, 0.8);
}

.pill.muted {
  color: var(--muted);
}

.sidebar {
  padding: 18px;
  border-radius: var(--radius-xl);
  align-self: start;
  position: sticky;
  top: 24px;
}

.nav-button {
  text-align: left;
  margin-bottom: 10px;
  background: transparent;
}

.nav-button.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.06));
  border-color: rgba(34, 197, 94, 0.4);
}

.content {
  display: grid;
  gap: 18px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 22px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-card,
.subpanel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 29, 0.72);
}

.metric-card {
  padding: 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric-value {
  margin-top: 10px;
  font-size: 1.9rem;
  font-weight: 700;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.subpanel {
  padding: 18px;
}

.subpanel-header {
  margin-bottom: 14px;
}

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

.list-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(7, 14, 25, 0.82);
  border: 1px solid rgba(173, 194, 255, 0.08);
}

.list-row-title {
  font-weight: 600;
}

.list-row-meta {
  color: var(--muted);
  font-size: 0.87rem;
}

.filters {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  margin: 18px 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(173, 194, 255, 0.08);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(8, 16, 28, 0.92);
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(173, 194, 255, 0.08);
}

tbody tr:hover {
  background: rgba(17, 30, 51, 0.4);
}

.stack {
  display: grid;
  gap: 4px;
}

.muted {
  color: var(--muted);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(9, 18, 30, 0.85);
}

.badge.success {
  border-color: rgba(34, 197, 94, 0.4);
  color: #c8f5d8;
}

.badge.warning {
  border-color: rgba(245, 158, 11, 0.4);
  color: #ffe2ab;
}

.badge.danger {
  border-color: rgba(251, 113, 133, 0.4);
  color: #ffd1da;
}

.badge.info {
  border-color: rgba(96, 165, 250, 0.4);
  color: #cfe0ff;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

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

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-button {
    margin-bottom: 0;
  }

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

  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .auth-view,
  .topbar,
  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .auth-card,
  .panel,
  .sidebar {
    border-radius: 22px;
  }

  .topbar,
  .auth-footer,
  .panel-header,
  .subpanel-header,
  .pagination,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar {
    grid-template-columns: 1fr 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }
}
