:root {
  color-scheme: dark;
  --bg: #090b11;
  --panel: rgba(20, 22, 31, .9);
  --border: rgba(255, 255, 255, .09);
  --text: #f6f7fb;
  --muted: #9da1b2;
  --green: #00e68a;
  --red: #ff5d73;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, sans-serif;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 230, 138, .09), transparent 30rem),
    radial-gradient(circle at 90% 90%, rgba(46, 126, 255, .08), transparent 32rem);
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

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

.admin-logo { width: 155px; height: auto; margin-bottom: 18px; }
.admin-title-row { display: flex; align-items: center; gap: 12px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.7rem, 4vw, 2.45rem); }
.admin-description, .panel-heading p { margin-bottom: 0; color: var(--muted); }
.admin-header__actions { display: flex; gap: 9px; }

.button {
  display: inline-flex;
  min-height: 40px;
  padding: 9px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover, .button:focus-visible { background: rgba(255, 255, 255, .11); }
.button--ghost { color: #ffd1d8; }
.button--success { border: 0; background: var(--green); color: #06100b; }
.button--danger { border-color: rgba(255, 93, 115, .35); color: #ffb4c0; }
.button--danger:hover { background: rgba(255, 93, 115, .18); }

.notification-bell {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  cursor: pointer;
}

.notification-bell svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-bell span {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
}

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

.summary-card, .admin-panel {
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.summary-card { padding: 20px; }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: .74rem; }
.summary-card strong { display: block; margin: 7px 0 3px; font-size: 1.85rem; }
.summary-card--online strong { color: var(--green); }

.profile-name { display: flex; align-items: center; gap: 6px; }
.profile-online-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(0, 230, 138, .55);
}
.profile-online-label { color: var(--green); font-size: .62rem; font-weight: 600; }

.admin-panel { padding: clamp(18px, 4vw, 28px); }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-heading h2 { margin-bottom: 4px; }
.panel-heading p { font-size: .82rem; }

.search-field { display: block; width: min(100%, 440px); margin-bottom: 16px; }
.search-field span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.search-field input {
  width: 100%;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: inherit;
}
.search-field input:focus { border-color: rgba(0, 230, 138, .6); }
.results-count { color: var(--muted); font-size: .75rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: .76rem; }
th { color: var(--muted); font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.role-badge { display: inline-flex; padding: 4px 8px; border-radius: 99px; background: rgba(255,255,255,.07); font-size: .68rem; }
.empty-row { padding: 34px 12px; color: var(--muted); text-align: center; }

.message-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 20px;
  place-items: center;
  background: rgba(0, 0, 0, .72);
}
.message-modal.is-visible { display: grid; }
.message-box {
  width: min(100%, 410px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: #171922;
  text-align: center;
}
.message-box p { color: var(--muted); }
.message-icon { margin-bottom: 8px; color: var(--red); font-size: 2rem; font-weight: 800; }
.confirm-buttons { display: flex; justify-content: center; gap: 10px; }

.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #1a1d27;
  opacity: 0;
  transform: translateY(15px);
  transition: .2s;
  pointer-events: none;
}
.admin-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 700px) {
  .admin-header { flex-direction: column; }
  .admin-header__actions { width: 100%; }
  .admin-header__actions .button { flex: 1; }
  .summary-grid { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; }
}
