:root {
  color-scheme: dark;
  --bg: #0b1020;
  --card: rgba(18, 26, 47, .9);
  --card-soft: rgba(255,255,255,.055);
  --text: #eef3ff;
  --muted: #9ca8c3;
  --line: rgba(255,255,255,.12);
  --accent: #77d4ff;
  --danger: #ff8b8b;
  --ok: #9dffbd;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(119, 212, 255, .18), transparent 30rem),
    radial-gradient(circle at 82% 0%, rgba(156, 126, 255, .16), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) 0;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: clamp(18px, 4vw, 32px);
}

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

.brand h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: .95;
  letter-spacing: -.055em;
}

.lead {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.55;
}

.session-badge {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--muted);
  white-space: nowrap;
  font-size: 14px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: clamp(20px, 4vw, 30px);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 30px);
  backdrop-filter: blur(10px);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: clamp(21px, 3vw, 28px);
  letter-spacing: -.03em;
}

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

.status {
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  max-width: 520px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
}

input:focus {
  border-color: rgba(119, 212, 255, .75);
  box-shadow: 0 0 0 3px rgba(119, 212, 255, .13);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #05101a;
  padding: 12px 18px;
  font-weight: 750;
  cursor: pointer;
}

button.secondary {
  color: var(--text);
  background: rgba(255,255,255,.1);
  border: 1px solid var(--line);
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

.hidden {
  display: none !important;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.section-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  border-radius: 18px;
  padding: 17px;
  min-height: 126px;
}

.section-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.section-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

code {
  color: var(--accent);
  background: rgba(119, 212, 255, .1);
  padding: 2px 6px;
  border-radius: 8px;
}

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

  .section-card {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .top {
    display: block;
  }

  .session-badge {
    display: inline-flex;
    margin-top: 18px;
    max-width: 100%;
    white-space: normal;
  }

  .panel-head {
    display: block;
  }

  .panel-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .page {
    width: min(100% - 20px, 1040px);
    padding: 18px 0;
  }

  .admin-card {
    border-radius: 18px;
    padding: 16px;
  }

  .brand h1 {
    font-size: 34px;
  }
}

.posts-panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 22px;
  padding: clamp(16px, 3vw, 22px);
}

.posts-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.posts-head h3 {
  margin: 0 0 8px;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -.03em;
}

.posts-head p {
  margin: 0;
}

.filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

select:focus {
  border-color: rgba(119, 212, 255, .75);
  box-shadow: 0 0 0 3px rgba(119, 212, 255, .13);
}

.mini-status {
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.mini-status.ok {
  color: var(--ok);
}

.mini-status.error {
  color: var(--danger);
}

.posts-list {
  display: grid;
  gap: 12px;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  border-radius: 17px;
  padding: 15px;
}

.post-title {
  margin: 0 0 7px;
  font-weight: 750;
  line-height: 1.35;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.post-pill {
  display: inline-flex;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  border-radius: 999px;
  padding: 5px 9px;
}

.post-stats {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  min-width: 116px;
}

@media (max-width: 820px) {
  .posts-head {
    display: block;
  }

  .filters {
    justify-content: flex-start;
    margin-top: 14px;
  }
}

@media (max-width: 620px) {
  .filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filters button {
    width: 100%;
  }

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

  .post-stats {
    text-align: left;
    min-width: 0;
  }
}

.create-post-form {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: clamp(15px, 3vw, 20px);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 19px;
}

.create-post-head h4 {
  margin: 0 0 7px;
  font-size: 19px;
  letter-spacing: -.02em;
}

.create-post-head p {
  margin: 0;
}

.create-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr .7fr;
  gap: 12px;
}

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

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
  resize: vertical;
  min-height: 128px;
  line-height: 1.5;
}

textarea:focus {
  border-color: rgba(119, 212, 255, .75);
  box-shadow: 0 0 0 3px rgba(119, 212, 255, .13);
}

@media (max-width: 760px) {
  .create-grid,
  .optional-grid {
    grid-template-columns: 1fr;
  }
}
