:root {
  --navy: #182651;
  --deep: #111a3d;
  --red: #c94145;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #dfe3ea;
  --soft: #f5f7fa;
  --white: #fff;
  --green: #16844f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Arial, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background: var(--deep);
  color: white;
  z-index: 10;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.admin-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}
.admin-brand strong,
.admin-brand small {
  display: block;
}
.admin-brand small {
  color: #aeb8d0;
  font-size: 0.75rem;
}
.sidebar nav {
  display: grid;
  gap: 5px;
  margin-top: 24px;
}
.sidebar nav button {
  border: 0;
  border-radius: 8px;
  padding: 12px 13px;
  text-align: left;
  background: transparent;
  color: #cfd5e3;
  font-weight: 650;
}
.sidebar nav button:hover,
.sidebar nav button.active {
  background: rgba(255, 255, 255, 0.11);
  color: white;
}
.view-site {
  margin-top: auto;
  padding: 12px;
  color: #ffb4b6;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}
.admin-main {
  min-height: 100vh;
  margin-left: 250px;
  padding: 32px clamp(22px, 4vw, 60px) 70px;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.admin-header p,
.kicker {
  margin: 0;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.admin-header h1 {
  margin: 3px 0 0;
  color: var(--navy);
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 500;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}
.admin-user button {
  margin-left: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 132, 79, 0.12);
}
#global-message .message {
  margin: 0 0 18px;
  padding: 12px 15px;
  border-radius: 8px;
}
.message.success {
  color: #14532d;
  background: #dcfce7;
}
.message.error {
  color: #7f1d1d;
  background: #fee2e2;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
.stats-grid article {
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
}
.stats-grid span,
.stats-grid strong {
  display: block;
}
.stats-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}
.stats-grid strong {
  margin-top: 6px;
  color: var(--navy);
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 2.4rem;
}
.welcome-card {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  align-items: center;
  margin-top: 22px;
  padding: 42px;
  background: var(--navy);
  color: white;
}
.welcome-card h2 {
  margin: 7px 0 12px;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 2.2rem;
  font-weight: 500;
}
.welcome-card p:not(.kicker) {
  color: #d2d7e5;
}
.quick-actions {
  display: grid;
  gap: 9px;
}
.quick-actions button {
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: left;
  border-radius: 8px;
  font-weight: 700;
}
.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.panel-head h2 {
  margin: 4px 0 0;
  color: var(--navy);
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 2.3rem;
  font-weight: 500;
}
.primary,
.ghost,
.danger,
.small-button {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 750;
}
.primary {
  background: var(--red);
  color: white;
}
.ghost {
  background: #e9edf3;
  color: var(--navy);
}
.danger {
  background: #fee2e2;
  color: #991b1b;
}
.small-button {
  padding: 7px 9px;
  background: #eef1f5;
  color: var(--navy);
  font-size: 0.76rem;
}
.editor-card {
  display: grid;
  gap: 15px;
  margin-bottom: 18px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
}
.editor-card.visible {
  display: grid;
}
.editor-card label {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
}
.editor-card input,
.editor-card select,
.editor-card textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: white;
  color: var(--ink);
}
.editor-card textarea {
  resize: vertical;
}
.editor-card input:focus,
.editor-card select:focus,
.editor-card textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(24, 38, 81, 0.1);
}
.form-row {
  display: grid;
  gap: 14px;
}
.form-row.two {
  grid-template-columns: repeat(2, 1fr);
}
.form-row.three {
  grid-template-columns: repeat(3, 1fr);
}
.editor-card .check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-card .check input {
  width: auto;
  margin: 0;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.table-card {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
td {
  font-size: 0.85rem;
}
td strong {
  color: var(--navy);
}
td .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 750;
}
.badge.published,
.badge.done {
  background: #dcfce7;
  color: #166534;
}
.badge.draft,
.badge.new {
  background: #fff3cd;
  color: #8a5b00;
}
.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.auth-block {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--soft);
}
.auth-block > div {
  width: min(440px, 100%);
  max-width: 440px;
  padding: 45px;
  text-align: center;
  background: white;
  border-top: 5px solid var(--red);
  box-shadow: 0 20px 55px rgba(17, 26, 61, 0.15);
}
.auth-block img {
  width: 100px;
  margin: auto;
}
.auth-block h2 {
  margin: 5px 0 8px;
  color: var(--navy);
}
.auth-block .login-kicker {
  margin: 12px 0 0;
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.auth-block p {
  color: var(--muted);
}
.auth-block form {
  display: grid;
  gap: 13px;
  margin-top: 22px;
  text-align: left;
}
.auth-block form label {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
}
.auth-block form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}
.auth-block form input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(24, 38, 81, 0.1);
}
.auth-block form button {
  margin-top: 5px;
}
.auth-block form button:disabled {
  cursor: wait;
  opacity: 0.7;
}
.auth-block a {
  display: inline-block;
  margin-top: 10px;
  color: var(--red);
  font-weight: 750;
}
@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .welcome-card {
    grid-template-columns: 1fr;
  }
  .form-row.three {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 12px;
  }
  .admin-brand {
    padding-bottom: 12px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    margin-top: 12px;
  }
  .sidebar nav button {
    white-space: nowrap;
  }
  .view-site {
    display: none;
  }
  .admin-main {
    margin: 0;
    padding: 22px 14px 50px;
  }
  .admin-header {
    align-items: flex-start;
  }
  .admin-user {
    display: none;
  }
  .stats-grid,
  .form-row.two,
  .form-row.three {
    grid-template-columns: 1fr;
  }
  .welcome-card {
    padding: 26px;
  }
  .auth-block {
    inset: 0;
    padding: 14px;
  }
  .auth-block > div {
    padding: 28px;
  }
  .panel-head {
    align-items: flex-start;
  }
}
