:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --panel: #ffffff;
  --ink: #1d2428;
  --muted: #63707a;
  --line: #d9ded9;
  --primary: #246b5b;
  --primary-strong: #194b40;
  --danger: #a33a33;
  --danger-bg: #fff0ee;
  --success-bg: #edf8f0;
  --error-bg: #fff1ed;
  --shadow: 0 16px 40px rgb(29 36 40 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.admin-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 78%), rgb(255 255 255 / 0%) 260px),
    var(--bg);
  color: var(--ink);
}

.admin-page--login {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 420px);
}

.login-panel,
.panel,
.publication {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 18px;
}

.topbar h1,
.login-panel h1,
.panel h2,
.publication h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 30px;
}

.login-panel h1 {
  font-size: 28px;
  margin-bottom: 22px;
}

.panel h2 {
  font-size: 22px;
}

.publication h3 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-layout {
  display: grid;
  gap: 22px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 42px;
}

.panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

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

.grid-form {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.1fr) auto auto;
  align-items: end;
}

.grid-form--compact {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 1fr) auto auto;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(36 107 91 / 14%);
}

.file-input small,
.publication small,
.muted {
  color: var(--muted);
}

.switch {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  white-space: nowrap;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
  border-color: #aeb9b2;
}

.button--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

.button--ghost {
  background: transparent;
}

.button--danger {
  border-color: #edc8c3;
  background: var(--danger-bg);
  color: var(--danger);
}

.notice {
  border-radius: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  font-weight: 700;
}

.notice--success {
  background: var(--success-bg);
  color: #17613a;
  border-color: #b8dfc5;
}

.notice--error {
  background: var(--error-bg);
  color: #91352e;
  border-color: #f0c0b8;
}

.empty-state {
  border: 1px dashed #bbc4bd;
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.publication-list {
  display: grid;
  gap: 16px;
}

.publication {
  position: relative;
  padding: 18px;
  box-shadow: none;
}

.publication-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.publication p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 9px 0 5px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status--active {
  background: #e6f5ec;
  color: #16613c;
}

.status--inactive {
  background: #eceff1;
  color: #5b6670;
}

.delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
  }

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

  .publication-main {
    display: grid;
  }
}

@media (max-width: 560px) {
  .topbar {
    width: min(100% - 24px, 1120px);
  }

  .admin-layout {
    width: min(100% - 24px, 1120px);
  }

  .panel,
  .login-panel,
  .publication {
    padding: 18px;
  }

  .topbar h1,
  .login-panel h1 {
    font-size: 24px;
  }
}
