:root {
  --bg: #070816;
  --panel: rgba(18, 20, 44, .88);
  --panel-2: rgba(25, 28, 60, .92);
  --line: rgba(255,255,255,.12);
  --text: #f7f8ff;
  --muted: #b9bdd8;
  --accent: #8f5cff;
  --cyan: #00e5ff;
  --danger: #ff3b6a;
  --success: #39f29a;
  --radius: 22px;
  --shadow: 0 22px 70px rgba(0,0,0,.44);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(143,92,255,.28), transparent 36%),
    radial-gradient(circle at 100% 20%, rgba(0,229,255,.17), transparent 32%),
    #070816;
}

button,
input {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.admin-shell {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 45px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: -.06em;
}

h2 {
  font-size: 22px;
  letter-spacing: -.03em;
  margin-bottom: 12px;
}

p,
small,
.muted {
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.panel,
.stat-card,
.mini-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
}

.login-panel {
  width: min(520px, 100%);
  margin: 45px auto 0;
}

.login-form,
.inline-form,
.stack-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.inline-form {
  grid-template-columns: 1fr auto;
  margin-top: 0;
}

input {
  width: 100%;
  min-height: 44px;
  color: var(--text);
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
}

input:focus {
  border-color: rgba(143,92,255,.8);
  box-shadow: 0 0 0 4px rgba(143,92,255,.15);
}

button,
.ghost-link {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 0 14px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: inline-grid;
  place-items: center;
}

.ghost-btn,
.ghost-link,
table button {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.13);
}

.danger,
button.danger {
  background: linear-gradient(135deg, #ff3b6a, #ff7a3d) !important;
  border: 0 !important;
}

.error-text {
  color: #ff89a5;
  min-height: 22px;
  margin-top: 10px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

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

.stat-card {
  border-radius: 18px;
  padding: 16px;
}

.stat-card strong {
  display: block;
  font-size: 31px;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.broadcast-panel,
.panel-title,
.card-top,
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: 18px;
  align-items: start;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

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

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 4px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0,229,255,.16);
  color: var(--cyan);
  font-weight: 900;
  font-size: 12px;
}

.cards-list {
  display: grid;
  gap: 10px;
  max-height: 640px;
  overflow: auto;
  padding-right: 4px;
}

.mini-card {
  border-radius: 17px;
  padding: 14px;
  background: rgba(0,0,0,.2);
}

.mini-card.report.open {
  border-color: rgba(255,59,106,.45);
}

.mini-card p {
  margin-top: 8px;
  line-height: 1.45;
}

.mini-card small {
  display: block;
  margin-top: 8px;
}

.card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.card-actions button {
  min-height: 36px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  z-index: 80;
  max-width: min(680px, calc(100% - 28px));
  padding: 13px 16px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(16,17,40,.94);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

code {
  color: var(--cyan);
  background: rgba(0,229,255,.08);
  padding: 2px 6px;
  border-radius: 8px;
}

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

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    width: min(100%, calc(100% - 18px));
    padding-top: 12px;
  }

  .admin-header,
  .broadcast-panel,
  .inline-form {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    align-items: stretch;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}
