:root {
  --ink: #0f172a;
  --muted: #64748b;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #e0f2fe, transparent 50%),
    radial-gradient(circle at 20% 70%, #fef3c7, transparent 50%),
    #f8fafc;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: "DM Serif Display", "Times New Roman", serif;
  letter-spacing: 0.4px;
}

.app-body {
  display: flex;
  flex-direction: column;
}

.app-shell {
  padding: 2.5rem 0 4rem;
}

.app-nav {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.8px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.75) !important;
}

.nav-link:hover {
  color: #ffffff !important;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  padding: 2.5rem;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(15, 23, 42, 0.9));
  color: #ffffff;
  box-shadow: var(--shadow);
}

.hero-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-card-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.panel-title {
  font-weight: 600;
  margin-bottom: 1rem;
}

.card h3 {
  margin-top: 0;
}

.link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-header > div:first-child {
  display: grid;
  gap: 0.25rem;
}

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

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
  background: var(--panel);
  padding: 1rem 1.25rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.form-control {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-outline-secondary {
  border-color: rgba(15, 23, 42, 0.2);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.alert {
  border-radius: 12px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.inline-form {
  display: inline;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kv-grid .label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.kv-grid .value {
  font-weight: 600;
}

.config-content pre {
  background: var(--panel-soft);
  padding: 1rem;
  border-radius: 12px;
  margin: 0;
}

.content-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.content-feedback {
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  display: none;
}

.content-feedback-ok {
  color: #166534;
  background: #dcfce7;
}

.content-feedback-error {
  color: #991b1b;
  background: #fee2e2;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.5rem;
}

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

.footer {
  padding: 1.5rem 0;
  color: var(--muted);
}

@media (max-width: 768px) {
  .hero {
    padding: 2rem 1.5rem;
  }

  .filter-form {
    grid-template-columns: 1fr;
  }
}

.hero .muted {
  color: rgba(255, 255, 255, 0.78);
}

.auth-shell {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
}

.auth-card {
  width: min(520px, 100%);
  background: var(--panel);
  border-radius: 24px;
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

.auth-title {
  margin: 0.25rem 0 0.25rem;
}

.auth-panel {
  background: var(--panel-soft);
  border-radius: 18px;
  padding: 1.5rem;
}

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

@media (max-width: 576px) {
  .auth-logo {
    margin: 0 auto;
  }
}