* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #12081d;
  --shell: #1b0b2e;
  --surface: #ffffff;
  --surface-soft: #fbf9ff;
  --text: #24113f;
  --muted: #756784;
  --accent: #7c3aed;
  --accent-2: #5b5ef7;
  --line: #e5d9fb;
  --danger: #dc2626;
  --success: #0f766e;
  --warning: #b7791f;
}

html {
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(124, 58, 237, 0.42), transparent 34%),
    linear-gradient(135deg, #12081d, #1d0b2e 48%, #0c0616);
  font-family: Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
}

.hidden {
  display: none !important;
}

.admin-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 18px;
}

.admin-login {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
}

.login-card,
.admin-panel,
.metrics-grid > article {
  background: linear-gradient(180deg, #ffffff, #fbf9ff);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 24px 70px rgba(12, 6, 22, 0.2);
}

.login-card {
  width: min(440px, calc(100vw - 36px));
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 28px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-row img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 16px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
}

.brand-row.compact img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.brand-row p,
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-row h1,
.panel-head h2 {
  margin: 2px 0 0;
  font-family: Manrope, Inter, sans-serif;
  line-height: 1.05;
  text-wrap: balance;
}

.login-copy {
  margin: 18px 0;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.login-card label,
.admin-search {
  display: grid;
  gap: 7px;
  color: #645573;
  font-size: 13px;
  font-weight: 800;
}

.login-card input,
.admin-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #d9c9f7;
  border-radius: 14px;
  outline: none;
  transition-property: border-color, box-shadow;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.login-card input:focus,
.admin-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

.admin-button {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
  transition-property: transform, background-color, border-color, color, box-shadow;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.admin-button:active {
  transform: scale(0.96);
}

.admin-button.primary {
  width: 100%;
  margin-top: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.28);
}

.admin-button.ghost {
  color: #efe8ff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-button.danger {
  color: #ffffff;
  background: rgba(220, 38, 38, 0.9);
}

.admin-button.soft-danger {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.admin-button.soft {
  color: var(--accent);
  background: #f3edff;
  border-color: #ded0fb;
}

.admin-button.ghost-light {
  color: #5e4e72;
  background: #ffffff;
  border-color: #e5d9fb;
}

.admin-button.active-filter {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.2);
}

.editor-link {
  min-height: 40px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.status-text {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #ffffff;
}

.admin-topbar .brand-row h1 {
  color: #ffffff;
  font-size: 22px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-badge {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  color: #eee7ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  font-weight: 900;
}

.metrics-grid {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.metrics-grid > article {
  min-height: 118px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  border-radius: 22px;
}

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

.metrics-grid strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

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

.admin-nav {
  padding: 10px;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
}

.admin-nav button {
  min-height: 46px;
  padding: 0 14px;
  cursor: pointer;
  color: #efe8ff;
  background: transparent;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  text-align: left;
  transition-property: transform, background-color, color;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.admin-nav button:hover,
.admin-nav button.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.admin-nav button:active {
  transform: scale(0.96);
}

.admin-panel {
  min-width: 0;
  padding: 18px;
  border-radius: 26px;
}

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

.admin-search {
  width: min(320px, 100%);
}

.admin-table-wrap {
  overflow-x: auto;
}

.user-filter-bar {
  min-width: 760px;
  margin: 8px 0 10px;
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: #f8f4ff;
  border: 1px solid #e5d9fb;
  border-radius: 18px;
}

.user-filter-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-filter-copy span,
.user-filter-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-filter-copy strong {
  overflow-wrap: anywhere;
}

.user-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.user-filter-actions .admin-button {
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 12px;
  font-size: 13px;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.admin-table th {
  padding: 0 12px 4px;
  color: #786987;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.admin-table td {
  padding: 14px 12px;
  background: #ffffff;
  border-top: 1px solid #eadffd;
  border-bottom: 1px solid #eadffd;
  vertical-align: middle;
}

.admin-table td:first-child {
  border-left: 1px solid #eadffd;
  border-radius: 16px 0 0 16px;
}

.admin-table td:last-child {
  border-right: 1px solid #eadffd;
  border-radius: 0 16px 16px 0;
}

.main-cell {
  display: grid;
  gap: 4px;
}

.main-cell strong {
  color: var(--text);
}

.main-cell span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.user-filter-link {
  width: 100%;
  min-height: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.user-filter-link:hover strong {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.url-link {
  color: var(--accent);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.badge {
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  background: #f3edff;
  border: 1px solid #ded0fb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.danger {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions .admin-button {
  min-height: 40px;
  padding-inline: 12px;
  border-radius: 12px;
  font-size: 13px;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #d9c9f7;
  border-radius: 20px;
}

.contact-message {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.45;
  text-wrap: pretty;
}

@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-shell {
    padding: 12px;
  }

  .admin-topbar,
  .panel-head,
  .user-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-filter-bar {
    min-width: 0;
  }

  .user-filter-actions {
    justify-content: flex-start;
  }

  .metrics-grid,
  .admin-nav {
    grid-template-columns: 1fr;
  }
}
