.tests-admin-page {
  min-height: 100vh;
}

.tests-admin-main {
  display: grid;
  width: min(100% - 40px, 1540px);
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
  margin-inline: auto;
  padding: 28px 0 70px;
}

.tests-admin-nav,
.tests-admin-content,
.tests-admin-card,
.tests-admin-gate section {
  border: 1px solid var(--tests-line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(11, 29, 53, 0.9), rgba(3, 10, 21, 0.96));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.22);
}

.tests-admin-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
}

.tests-admin-nav button,
.tests-admin-table button,
.tests-admin-card button {
  border: 1px solid rgba(113, 174, 255, 0.2);
  border-radius: 8px;
  color: #c7ddf7;
  background: rgba(9, 26, 48, 0.8);
  cursor: pointer;
}

.tests-admin-nav button {
  padding: 12px;
  text-align: left;
}

.tests-admin-nav button.is-active,
.tests-admin-table button:hover,
.tests-admin-card button:hover {
  border-color: rgba(241, 203, 120, 0.65);
  color: var(--tests-gold);
}

.tests-admin-table button.is-danger,
.tests-admin-card button.is-danger {
  border-color: rgba(255, 135, 148, 0.4);
  color: var(--tests-red);
}

.tests-admin-content {
  min-width: 0;
  padding: 20px;
}

.tests-admin-toolbar,
.tests-admin-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tests-admin-toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.tests-admin-toolbar h1 {
  margin: 5px 0 0;
  color: #f4f8ff;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.07em;
}

.tests-admin-filters {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tests-admin-filters input,
.tests-admin-filters select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--tests-line);
  border-radius: 8px;
  color: #eaf4ff;
  background: rgba(4, 14, 29, 0.92);
}

.tests-admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tests-admin-stat-grid article,
.tests-admin-card {
  padding: 18px;
}

.tests-admin-stat-grid article {
  border: 1px solid var(--tests-line);
  border-radius: 14px;
  background: rgba(9, 26, 48, 0.76);
}

.tests-admin-stat-grid strong,
.tests-admin-card strong {
  display: block;
  color: var(--tests-gold);
  font-size: 2rem;
}

.tests-admin-stat-grid span,
.tests-admin-card span,
.tests-admin-muted {
  color: rgba(197, 216, 240, 0.7);
  font-size: 0.78rem;
}

.tests-admin-card {
  margin-top: 14px;
}

.tests-admin-card h2 {
  margin-top: 0;
}

.tests-admin-danger-zone {
  border-color: rgba(255, 135, 148, 0.42);
  background: linear-gradient(145deg, rgba(66, 12, 26, 0.65), rgba(18, 5, 14, 0.94));
}

.tests-admin-danger-zone p {
  color: rgba(255, 207, 212, 0.78);
  line-height: 1.55;
}

.tests-admin-card button,
.tests-admin-table button {
  padding: 6px 8px;
}

.tests-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tests-admin-notice {
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.tests-admin-notice.is-ok {
  color: var(--tests-green);
  background: rgba(91, 221, 158, 0.08);
}

.tests-admin-notice.is-error {
  color: var(--tests-red);
  background: rgba(255, 135, 148, 0.08);
}

.tests-admin-table-wrap {
  overflow-x: auto;
}

.tests-admin-table {
  width: 100%;
  border-collapse: collapse;
  color: #dcecff;
  font-size: 0.76rem;
  white-space: nowrap;
}

.tests-admin-table th,
.tests-admin-table td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--tests-line);
  text-align: left;
  vertical-align: top;
}

.tests-admin-table th {
  color: rgba(197, 216, 240, 0.62);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tests-admin-status {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--tests-blue);
  background: rgba(112, 178, 255, 0.1);
}

.tests-admin-status.is-approved,
.tests-admin-status.is-configured,
.tests-admin-status.is-completed,
.tests-admin-status.is-available {
  color: var(--tests-green);
  background: rgba(91, 221, 158, 0.1);
}

.tests-admin-status.is-rejected,
.tests-admin-status.is-revoked,
.tests-admin-status.is-missing {
  color: var(--tests-red);
  background: rgba(255, 135, 148, 0.1);
}

.tests-admin-status.is-interrupted,
.tests-admin-status.is-legacy {
  color: var(--tests-gold);
  background: rgba(241, 203, 120, 0.1);
}

.tests-admin-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.tests-admin-gate section {
  width: min(100%, 580px);
  padding: 34px;
}

.tests-admin-gate h1 {
  margin: 8px 0;
  color: #f4f8ff;
  font-size: clamp(2.6rem, 10vw, 5rem);
  letter-spacing: -0.1em;
}

.tests-admin-gate p {
  margin-bottom: 24px;
  color: rgba(197, 216, 240, 0.76);
  line-height: 1.6;
}

@media (max-width: 820px) {
  .tests-admin-main {
    width: min(100% - 20px, 1540px);
    grid-template-columns: 1fr;
    padding-top: 16px;
  }

  .tests-admin-nav {
    display: flex;
    overflow-x: auto;
  }

  .tests-admin-nav button {
    flex: 0 0 auto;
  }

  .tests-admin-content {
    padding: 14px;
  }

  .tests-admin-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
