:root {
  color-scheme: light;
  --ink: #21171d;
  --muted: #74636c;
  --line: #eadfe5;
  --soft: #fff7fb;
  --panel: #ffffff;
  --brand: #6e123f;
  --brand-2: #b40755;
  --green: #2d8a42;
  --blue: #1267cf;
  --amber: #b26b00;
  --shadow: 0 22px 60px rgba(84, 16, 44, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fff8fb;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(180, 7, 85, 0.12), transparent 34%),
    linear-gradient(135deg, #fff8fb, #f8edf3);
}

.auth-card {
  width: min(100%, 430px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(84, 16, 44, 0.12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.02em;
}

.auth-card h1 {
  margin-top: 18px;
  font-size: 34px;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.form-stack,
.editor-card {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #4a3b43;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(180, 7, 85, 0.55);
  box-shadow: 0 0 0 4px rgba(180, 7, 85, 0.08);
}

.primary-button,
.ghost-button,
.light-button,
.danger-button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.primary-button.compact {
  min-height: 40px;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ghost-button.dark {
  background: #ffffff;
  color: var(--brand);
  border: 1px solid var(--line);
}

.light-button {
  background: #ffffff;
  color: var(--brand);
}

.danger-button {
  background: #fff0f3;
  color: #b42343;
  border: 1px solid #ffd0d9;
}

.message,
.toast {
  min-height: 20px;
  color: #b42343;
  font-size: 13px;
  font-weight: 800;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #641139;
  color: #ffffff;
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-row .eyebrow {
  color: #f2bfd4;
}

.brand-row h2 {
  font-size: 24px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 14px;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.panel-header,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
}

.status-pill.live {
  color: var(--green);
}

.blocked-panel,
.panel,
.stat-card,
.hero-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(84, 16, 44, 0.06);
}

.blocked-panel {
  padding: 24px;
  max-width: 720px;
}

.uid-text {
  word-break: break-all;
  font-weight: 900;
  color: var(--brand);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.hero-panel {
  grid-column: span 8;
  min-height: 190px;
  padding: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #ffffff;
}

.hero-panel .eyebrow {
  color: #f4bfd5;
}

.hero-panel h2 {
  max-width: 590px;
  font-size: clamp(28px, 4vw, 44px);
}

.hero-panel p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.stats-grid {
  grid-column: span 4;
  display: grid;
  gap: 12px;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  font-size: 32px;
  font-weight: 950;
  color: var(--brand);
}

.stat-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.panel {
  grid-column: span 6;
  padding: 22px;
}

.wide-panel {
  grid-column: 1 / -1;
}

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

.form-grid.tight {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-list,
.list-column,
.queue-grid {
  display: grid;
  gap: 12px;
}

.module-card,
.article-row,
.queue-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffbfd;
  padding: 14px;
}

.module-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.module-card h3,
.article-row h3,
.queue-card h3 {
  margin: 0;
  font-size: 15px;
}

.module-card p,
.article-row p,
.queue-card p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.switch {
  width: 54px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 3px;
  background: #d8ccd3;
}

.switch::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
}

.switch.is-on {
  background: var(--brand-2);
}

.switch.is-on::after {
  transform: translateX(24px);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.article-row {
  text-align: left;
  cursor: pointer;
}

.article-row.is-active {
  border-color: rgba(180, 7, 85, 0.55);
  box-shadow: 0 0 0 4px rgba(180, 7, 85, 0.08);
}

.editor-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #ffffff;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

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

.queue-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.queue-actions button {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--brand);
  padding: 0 12px;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  min-height: auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: #21171d;
  color: #ffffff;
  box-shadow: var(--shadow);
}

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

  .sidebar {
    position: relative;
    height: auto;
    gap: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-panel,
  .stats-grid,
  .panel {
    grid-column: 1 / -1;
  }

  .split-grid,
  .form-grid,
  .form-grid.tight,
  .queue-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .hero-panel,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

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