.admin-shell {
  position: relative;
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.admin-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.admin-hero h1 {
  color: #140f05;
  background: linear-gradient(135deg, #ff8a1d, #ffd66a);
  padding: 8px 14px 12px;
  border-radius: 8px;
  font-family: Comfortaa, Inter, sans-serif;
  font-size: clamp(34px, 6vw, 72px);
}

.admin-link {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #1b1205;
  text-decoration: none;
  background: linear-gradient(135deg, var(--honey), var(--gold));
  font-weight: 900;
}

.admin-link-button {
  cursor: pointer;
  font: inherit;
}

.admin-top-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.terminal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.terminal-head {
  display: flex;
  gap: 7px;
  padding: 12px 14px 0;
}

.terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(245, 189, 88, .35);
}

.terminal-head span:nth-child(2) {
  background: var(--moss);
}

.terminal-head span:nth-child(3) {
  background: var(--honey);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  padding: 16px;
}

.hint {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(380px, 500px) minmax(760px, 1fr);
  gap: 18px;
  align-items: start;
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  padding: 16px;
}

.activity-refresh {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  padding: 0 16px 14px;
  align-items: center;
}

.toggle-line,
.refresh-select {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(5, 24, 10, .44);
  font-size: 12px;
  font-weight: 900;
}

.toggle-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-line span {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border: 1px solid rgba(255, 231, 158, .35);
  border-radius: 999px;
  background: rgba(5, 24, 10, .8);
}

.toggle-line span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 231, 158, .65);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.toggle-line input:checked + span {
  border-color: rgba(104, 255, 125, .55);
  background: rgba(36, 104, 49, .45);
}

.toggle-line input:checked + span::after {
  transform: translateX(18px);
  background: #67ff75;
  box-shadow: 0 0 14px rgba(103, 255, 117, .75);
}

.refresh-select {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.refresh-select span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.refresh-select select {
  min-height: 24px;
  padding: 0;
  border: 0;
  color: var(--gold);
  background: transparent;
  font-weight: 1000;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px 14px;
}

.stat-strip div,
.admin-metrics article {
  padding: 12px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  background: rgba(5, 24, 10, .44);
}

.stat-strip strong {
  display: block;
  color: var(--gold);
  font-size: 28px;
}

.stat-strip span,
.admin-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.users-list {
  max-height: 68vh;
  overflow: auto;
  padding: 0 16px 16px;
}

.user-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 231, 158, .22);
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 24, 10, .44);
  box-shadow: none;
  text-align: left;
}

.user-row.active {
  border-color: rgba(245, 189, 88, .78);
  background: rgba(245, 189, 88, .14);
}

.user-row strong,
.user-row small {
  display: block;
}

.user-row small {
  color: var(--muted);
  margin-top: 4px;
}

.row-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.row-traffic,
.row-online {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 231, 158, .2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(5, 24, 10, .48);
  font-size: 11px;
  font-weight: 900;
}

.row-online i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 231, 158, .45);
}

.row-online.online {
  color: #cfffbd;
  border-color: rgba(104, 255, 125, .38);
  background: rgba(36, 104, 49, .28);
}

.row-online.online i {
  background: #67ff75;
  box-shadow: 0 0 12px rgba(103, 255, 117, .8);
}

.row-status,
.pill {
  align-self: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(245, 189, 88, .12);
  font-size: 11px;
  font-weight: 900;
}

.row-status.disabled,
.pill.disabled {
  color: var(--red);
  background: rgba(255, 116, 109, .14);
}

.editor-panel {
  min-height: 620px;
}

.editor-empty {
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
}

#editor {
  padding: 20px;
}

.editor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

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

.admin-metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.editor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(5, 24, 10, .94);
  outline: none;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.password-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}

.password-view button {
  min-height: 48px;
  padding: 0;
  font-size: 20px;
}

.id-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tiny-copy {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
}

.danger {
  color: #fff;
  border-color: rgba(255, 116, 109, .65);
  background: linear-gradient(135deg, #c22d2d, #ff746d);
}

.admin-message {
  min-height: 28px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.admin-message.error {
  color: var(--red);
}

@media (max-width: 980px) {
  .admin-grid,
  .admin-metrics,
  .editor-form,
  .admin-actions,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .editor-top {
    align-items: flex-start;
    flex-direction: column;
  }
}
