:root {
  --ink: #ffffff;
  --muted: #cfc7df;
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --field: rgba(0, 0, 0, 0.28);
  --green: #92ff74;
  --gold: #d8ff6f;
  --purple: #7a2fd0;
  --danger: #ff8ca0;
  --teal: #5fe7ca;
  --shadow: 0 28px 90px rgba(110, 35, 180, 0.28);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 35% 14%, rgba(118, 45, 191, 0.42), transparent 28%),
    radial-gradient(circle at 78% 40%, rgba(95, 231, 202, 0.12), transparent 26%),
    linear-gradient(135deg, #06050b 0%, #13081d 48%, #24063a 100%);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 10, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  display: block;
  flex: 0 0 auto;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(146, 255, 116, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.admin-hero p,
.panel-heading p,
.result-note,
small {
  color: var(--muted);
}

.admin-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.admin-header a,
.admin-header button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 9px 13px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr);
  gap: 26px;
  align-items: end;
  padding: 64px clamp(18px, 5vw, 80px) 38px;
}

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

.admin-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(52px, 8vw, 104px);
  line-height: 0.98;
  letter-spacing: 0;
}

.admin-hero p {
  max-width: 760px;
  font-size: 22px;
  line-height: 1.55;
}

.login-card,
.panel,
.metrics-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.login-card span {
  width: max-content;
  border-radius: 999px;
  background: rgba(146, 255, 116, 0.16);
  color: var(--green);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

form {
  display: grid;
  gap: 16px;
}

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

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: #fff;
  outline: none;
  padding: 12px 14px;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

input:focus,
select:focus {
  border-color: rgba(146, 255, 116, 0.7);
  box-shadow: 0 0 0 4px rgba(146, 255, 116, 0.12);
}

button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
  padding: 11px 15px;
}

form button[type="submit"],
.login-card button {
  border: 0;
  background: linear-gradient(135deg, var(--green), var(--gold));
  color: #061006;
}

button.muted,
button:disabled {
  color: rgba(255, 255, 255, 0.38);
  cursor: not-allowed;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0 clamp(18px, 5vw, 80px) 26px;
}

.metrics-grid article {
  padding: 22px;
}

.metrics-grid span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.metrics-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 42px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.43fr) minmax(0, 1fr);
  gap: 20px;
  padding: 0 clamp(18px, 5vw, 80px) 70px;
}

.settings-stack,
.content-stack {
  display: grid;
  align-content: start;
  gap: 20px;
}

.panel {
  padding: clamp(20px, 3vw, 34px);
}

.panel-heading {
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

.panel-heading.row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.admin-user-card,
.member-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  padding: 18px;
}

.admin-user-card {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.admin-user-card strong {
  overflow-wrap: anywhere;
  font-size: 24px;
}

.admin-user-card > span,
.badge {
  display: inline-flex;
  width: max-content;
  border-radius: var(--radius);
  background: rgba(146, 255, 116, 0.18);
  color: var(--green);
  padding: 7px 10px;
  font-weight: 900;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #fff;
  font-size: 18px;
}

.check-row input {
  width: 22px;
  min-height: 22px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  padding: 16px;
}

.filters label:nth-child(3) {
  grid-column: span 2;
}

.result-note {
  margin: 18px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.member-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.member-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.banner-manager-grid {
  display: grid;
  gap: 16px;
}

.ad-slot-card,
.banner-slot-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  padding: 16px;
}

.banner-slot-card {
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1fr);
  align-items: start;
}

.banner-slot-card .ad-slot-head,
.banner-slot-card .banner-spec,
.banner-slot-card .ad-dates,
.banner-slot-card .banner-actions {
  grid-column: 1 / -1;
}

.banner-preview {
  overflow: hidden;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  aspect-ratio: 1920 / 520;
}

.banner-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-preview.empty {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.banner-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.banner-spec strong,
.banner-spec span {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.banner-spec strong {
  color: var(--green);
}

.banner-actions {
  display: flex;
  justify-content: flex-end;
}

.banner-actions button {
  background: linear-gradient(135deg, var(--green), var(--gold));
  color: #061006;
}

.ad-slot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.ad-slot-head span {
  color: var(--green);
  font-weight: 950;
}

.ad-slot-head em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.ad-slot-head button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--danger);
}

.ad-selected {
  display: grid;
  gap: 8px;
  min-height: 78px;
  border: 1px solid rgba(146, 255, 116, 0.22);
  border-radius: var(--radius);
  background: rgba(146, 255, 116, 0.1);
  padding: 12px;
}

.ad-selected.empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.055);
}

.ad-selected strong {
  font-size: 18px;
}

.ad-selected span {
  color: var(--muted);
  line-height: 1.45;
}

.ad-selected > button {
  justify-self: start;
  min-height: 36px;
  padding: 7px 11px;
  background: rgba(95, 231, 202, 0.16);
  color: var(--teal);
}

.ad-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.ad-dates small,
.ad-dates b {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.ad-dates b {
  color: var(--green);
}

.ad-dates b.warning {
  color: #ffd26e;
}

.ad-dates b.danger {
  color: var(--danger);
}

.ad-search-results {
  display: grid;
  gap: 8px;
  min-height: 42px;
}

.ad-search-results p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ad-search-results button {
  display: grid;
  gap: 4px;
  min-height: auto;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.ad-search-results button:hover {
  border-color: rgba(146, 255, 116, 0.5);
}

.ad-search-results button span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.member-card {
  position: relative;
  display: grid;
  gap: 10px;
}

.member-card h3 {
  margin: 0;
  max-width: 75%;
  font-size: 24px;
}

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

.member-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.member-card dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: #fff;
}

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

.member-actions button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 14px;
}

.member-card .badge {
  position: absolute;
  top: 18px;
  right: 18px;
}

.member-badge-stack {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.member-badge-stack .badge {
  position: static;
}

.badge.success {
  background: rgba(119, 255, 147, 0.18);
  color: #7dff93;
}

.badge.warning {
  background: rgba(255, 210, 110, 0.18);
  color: #ffd26e;
}

.badge.danger {
  background: rgba(255, 140, 160, 0.18);
  color: var(--danger);
}

.badge.neutral {
  background: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(18px, 5vw, 80px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer a {
  color: var(--green);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  transform: translateY(20px);
  opacity: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  padding: 11px 16px;
  font-weight: 900;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .admin-hero,
  .admin-layout {
    grid-template-columns: 1fr;
  }

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

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

  .banner-slot-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-hero h1 {
    font-size: 48px;
  }

  .metrics-grid,
  .filters,
  .ad-manager-grid,
  .banner-manager-grid,
  .ad-dates,
  .member-list.two-col,
  .member-card dl {
    grid-template-columns: 1fr;
  }

  .filters label:nth-child(3) {
    grid-column: auto;
  }

  .panel-heading.row {
    flex-direction: column;
  }
}
