:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #18212f;
  --muted: #667085;
  --line: #d9e1ea;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --amber: #b45309;
  --amber-bg: #fff7ed;
  --red: #b42318;
  --red-bg: #fff1f0;
  --green-bg: #ecfdf3;
  --shadow: 0 18px 45px rgba(24, 33, 47, 0.08);
  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: linear-gradient(135deg, #f5f7fb 0%, #f8fafc 52%, #eef6f5 100%);
  color: var(--text);
}

a {
  color: var(--teal-dark);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
}

button,
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
}

button.warning,
.button.warning {
  background: var(--amber);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.surface {
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.form {
  padding: 22px;
}

.intro {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

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

.span {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.45;
}

.check input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.message {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
}

.success {
  border-color: #abefc6;
  background: var(--green-bg);
  color: #027a48;
}

.error {
  border-color: #fecdca;
  background: var(--red-bg);
  color: var(--red);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.3fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.card {
  padding: 18px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  color: #344054;
  padding: 10px 12px;
  text-decoration: none;
}

.sidebar a span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.sidebar a.active,
.sidebar a:hover {
  background: #e7f5f3;
  color: var(--teal-dark);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
  line-height: 1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #475467;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

td input[type="number"],
td select {
  min-width: 126px;
}

.pill {
  display: inline-flex;
  min-width: 96px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 900;
}

.pill-open {
  background: var(--green-bg);
  color: #027a48;
}

.pill-closed {
  background: var(--amber-bg);
  color: var(--amber);
}

.pill-full,
.pill-control {
  background: var(--red-bg);
  color: var(--red);
}

.pill-hidden {
  background: #eef2f6;
  color: #475467;
}

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

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

@media (max-width: 920px) {
  .topbar,
  .admin-layout {
    display: block;
  }

  .sidebar {
    margin-bottom: 18px;
  }

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

@media (max-width: 680px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .form,
  .card,
  .sidebar {
    padding: 16px;
  }

  .grid,
  .cards,
  .settings {
    grid-template-columns: 1fr;
  }

  .actions,
  .actions button,
  .actions .button {
    width: 100%;
  }
}
