:root {
  --argon-blue: #5e72e4;
  --argon-cyan: #11cdef;
  --argon-green: #2dce89;
  --argon-orange: #fb6340;
  --argon-red: #f5365c;
  --navy: #172b4d;
  --ink: #32325d;
  --muted: #8898aa;
  --paper: #f6f9fc;
  --white: #ffffff;
  --line: #e9ecef;
  --shadow: 0 0 2rem rgba(136, 152, 170, 0.16);
  --font-display: "Bebas Neue", sans-serif;
  --font-body: Outfit, sans-serif;
  --font-accent: "Playfair Display", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--white);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.brand,
.side-nav a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand {
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  padding-bottom: 1.2rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--argon-blue), var(--argon-cyan));
  color: white;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

.brand strong {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 900;
}

.brand small {
  color: var(--muted);
  font-size: 0.75rem;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
}

.side-nav a {
  gap: 0.75rem;
  border-radius: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  padding: 0.85rem 0.9rem;
}

.side-nav a:hover,
.side-nav a.active {
  background: rgba(94, 114, 228, 0.09);
  color: var(--argon-blue);
}

.side-nav span {
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.side-card {
  margin-top: auto;
  border-radius: 1rem;
  background: linear-gradient(135deg, #172b4d, #5e72e4);
  color: white;
  padding: 1rem;
}

.side-label {
  margin: 0 0 0.3rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-card strong {
  display: block;
  font-size: 1.05rem;
}

.side-card span {
  display: block;
  margin-top: 0.45rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-main {
  min-width: 0;
  padding: 1.5rem;
}

.topbar,
.hero,
.panel-head,
.form-actions,
.token-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.breadcrumb,
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy);
  line-height: 1.08;
}

h1 {
  font-size: 1.55rem;
  font-weight: 850;
}

h2 {
  max-width: 680px;
  color: white;
  font-family: var(--font-accent);
  font-size: clamp(2rem, 5vw, 3.35rem);
}

h3 {
  font-size: 1.1rem;
  font-weight: 850;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.45rem;
  min-height: 2.55rem;
  padding: 0.68rem 1rem;
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--argon-blue);
  box-shadow: 0 4px 12px rgba(94, 114, 228, 0.28);
}

.button.ghost,
.button.light {
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
}

.button.danger {
  color: var(--argon-red);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.hero {
  justify-content: space-between;
  gap: 1.5rem;
  overflow: hidden;
  border-radius: 1.2rem;
  background:
    radial-gradient(circle at 86% 14%, rgba(17, 205, 239, 0.44), transparent 28%),
    radial-gradient(circle at 4% 100%, rgba(245, 54, 92, 0.42), transparent 34%),
    linear-gradient(120deg, rgba(23, 43, 77, 0.98), rgba(94, 114, 228, 0.9));
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 2.4rem);
}

.hero .eyebrow {
  color: #a7f3ff;
}

.hero p {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.hero-status {
  min-width: min(280px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  padding: 1rem;
  backdrop-filter: blur(14px);
}

.hero-status span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-status strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
}

.hero-status[data-kind="ok"] {
  border-color: rgba(45, 206, 137, 0.35);
}

.hero-status[data-kind="error"] {
  border-color: rgba(245, 54, 92, 0.45);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -1.2rem;
  top: -1.2rem;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: rgba(94, 114, 228, 0.1);
}

.metric-card:nth-child(2)::after {
  background: rgba(45, 206, 137, 0.13);
}

.metric-card:nth-child(3)::after {
  background: rgba(251, 99, 64, 0.13);
}

.metric-card:nth-child(4)::after {
  background: rgba(17, 205, 239, 0.13);
}

.metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  color: var(--navy);
  font-size: 2.15rem;
  line-height: 1.1;
  margin-top: 0.35rem;
}

.metric-card small {
  color: var(--muted);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel {
  padding: 1.1rem;
}

.panel-head {
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.panel-head.compact {
  margin-bottom: 0.8rem;
}

.panel-copy {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

label {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cad1d7;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  outline: none;
  transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--argon-blue);
  box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.14);
}

.permalink-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
}

.muted-input {
  background: #f6f9fc;
  color: var(--muted);
  font-size: 0.78rem;
}

textarea {
  resize: vertical;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.check-row input {
  width: auto;
}

.form-actions,
.token-actions {
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 1rem;
}

.token-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.status-pill,
.count-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(94, 114, 228, 0.1);
  color: var(--argon-blue);
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill.ok {
  background: rgba(45, 206, 137, 0.12);
  color: #0f8d62;
}

.status-pill.error {
  background: rgba(245, 54, 92, 0.12);
  color: var(--argon-red);
}

.pipeline-card {
  border-radius: 0.8rem;
  background: #f7fafc;
  margin-top: 1rem;
  padding: 1rem;
}

.pipeline-card ol {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.table-panel {
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

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

th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.75rem;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.88rem;
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
}

tbody tr {
  transition: 0.18s ease;
}

tbody tr:hover {
  background: #f8fbff;
}

.article-button {
  display: grid;
  gap: 0.18rem;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.article-title {
  color: var(--navy);
  font-weight: 850;
}

.article-summary {
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.tag,
.source-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 900;
}

.tag {
  background: rgba(17, 205, 239, 0.1);
  color: #0b88a1;
}

.tag.draft {
  background: rgba(251, 99, 64, 0.12);
  color: var(--argon-orange);
}

.tag.published {
  background: rgba(45, 206, 137, 0.12);
  color: #0f8d62;
}

.source-chip {
  background: #f6f9fc;
  color: var(--muted);
}

.empty-row td {
  color: var(--muted);
  padding: 1.2rem 0.75rem;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .admin-main {
    padding: 1rem;
  }

  .hero,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid,
  .studio-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 1rem;
  }

  .top-actions,
  .form-actions,
  .token-actions {
    width: 100%;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .permalink-row {
    grid-template-columns: 1fr;
  }
}
