/* Admin dashboard — control center layout */
body {
  margin: 0;
  background: #020617;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-root {
  min-height: 100vh;
  display: flex;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(56, 189, 248, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.06), transparent 50%), #020617;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.admin-gate-main {
  max-width: 560px;
  margin: 0 auto;
}

/* ——— Sidebar ——— */
.admin-sidebar {
  width: 268px;
  flex-shrink: 0;
  padding: 22px 16px 20px;
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.97) 0%, rgba(15, 23, 42, 0.88) 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.2);
}

.admin-sidebar-top {
  padding: 4px 8px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  margin-bottom: 16px;
}

.admin-home-btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 650;
  color: #dbeafe;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(125, 211, 252, 0.34);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-home-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.52);
  box-shadow: 0 8px 22px rgba(56, 189, 248, 0.2);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.admin-brand-mark {
  width: 10px;
  height: 28px;
  border-radius: 99px;
  background: linear-gradient(180deg, #38bdf8, #6366f1);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.admin-sidebar-tag {
  margin: 8px 0 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  font-weight: 600;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  padding: 0 4px;
}

.admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #64748b;
  padding: 0 10px 4px;
}

.admin-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.35);
  color: #cbd5e1;
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.admin-nav-item:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.28);
  color: #f1f5f9;
}

.admin-nav-item.is-active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(99, 102, 241, 0.14));
  border-color: rgba(56, 189, 248, 0.35);
  color: #f8fafc;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.08);
}

.admin-nav-icon {
  display: flex;
  color: #7dd3fc;
  opacity: 0.9;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(15, 23, 42, 0.5);
}

.admin-nav-item.is-active .admin-nav-icon {
  color: #bae6fd;
}

.admin-nav-text {
  flex: 1;
}

.admin-sidebar-foot {
  margin-top: auto;
  padding: 18px 4px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.admin-sidebar-foot-card {
  padding: 14px 14px 16px;
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(129, 140, 248, 0.18);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-sidebar-foot-app {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: #e0f2fe;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(125, 211, 252, 0.28);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-sidebar-foot-app:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.45);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.15);
}

.admin-sidebar-foot-app-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(125, 211, 252, 0.2);
}

.admin-sidebar-foot-divider {
  height: 1px;
  margin: 14px 0 12px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.25), transparent);
}

.admin-sidebar-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-sidebar-foot-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-sidebar-foot-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.admin-sidebar-foot-name {
  font-size: 0.94rem;
  font-weight: 750;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.admin-staff-chip--foot {
  margin-left: 0;
  flex-shrink: 0;
}

/* ——— Main ——— */
.admin-main {
  flex: 1;
  padding: 26px 28px 56px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.admin-page-head-text h1 {
  margin: 4px 0 6px;
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.admin-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #38bdf8;
}

.admin-main .admin-lead {
  margin: 0;
  color: #94a3b8;
  font-size: 0.94rem;
  max-width: 52ch;
  line-height: 1.55;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-panel.hidden {
  display: none !important;
}

/* Quick chips */
.admin-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.admin-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.admin-chip:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-1px);
}

.admin-chip--accent {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: #f0f9ff;
}

/* Stats */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.admin-stat-card {
  position: relative;
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  padding: 16px 18px 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.admin-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
  opacity: 0.85;
}

.admin-stat-card--users::before {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

.admin-stat-card--notes::before {
  background: linear-gradient(90deg, #34d399, #22d3ee);
}

.admin-stat-card--rem::before {
  background: linear-gradient(90deg, #a78bfa, #e879f9);
}

.admin-stat-card--prem::before {
  background: linear-gradient(90deg, #fbbf24, #f97316);
}

.admin-stat-card--live::before {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.admin-stat-card--today::before {
  background: linear-gradient(90deg, #818cf8, #c084fc);
}

.admin-stat-card-head .admin-stat-label {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.admin-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.admin-stat-value {
  font-size: 1.65rem;
  font-weight: 750;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* Dashboard grid */
.admin-dash-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1024px) {
  .admin-dash-grid {
    grid-template-columns: 1fr;
  }
}

.admin-card {
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  padding: 18px 20px 16px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
}

.admin-card--stretch {
  grid-row: span 2;
}

@media (max-width: 1024px) {
  .admin-card--stretch {
    grid-row: auto;
  }
}

.admin-card--wide {
  grid-column: 1 / -1;
}

.admin-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.admin-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.admin-card-hint {
  font-size: 0.78rem;
  color: #64748b;
}

.admin-linkish {
  border: none;
  background: none;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.admin-linkish:hover {
  text-decoration: underline;
}

.admin-muted {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
}

/* Bar chart */
.admin-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
}

@media (max-width: 520px) {
  .admin-bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.admin-bar-name {
  font-weight: 600;
  color: #cbd5e1;
  text-transform: capitalize;
  word-break: break-word;
}

.admin-bar-track {
  height: 10px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.admin-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.85), rgba(129, 140, 248, 0.75));
  transition: width 0.35s ease;
}

.admin-bar-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  text-align: right;
}

.admin-table-scroll {
  max-height: min(320px, 42vh);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.admin-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-mini-table th,
.admin-mini-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.admin-mini-table th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.98);
  color: #64748b;
  font-weight: 650;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  z-index: 1;
}

.admin-mini-table tr:last-child td {
  border-bottom: none;
}

.admin-mini-table td {
  color: #e2e8f0;
  vertical-align: top;
}

.admin-cell-muted {
  color: #94a3b8;
  font-size: 0.78rem;
}

.admin-cell-preview {
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  color: #cbd5e1;
}

.admin-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-pill--web {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.admin-pill--wa {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}

.admin-pill--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.admin-pill--pend {
  background: rgba(250, 204, 21, 0.12);
  color: #fde047;
}

.admin-pill--fail {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

/* Search */
.admin-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.admin-search-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
}

.admin-search-input {
  width: min(100%, 280px);
  padding: 10px 12px 10px 38px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.85);
  color: #f1f5f9;
  font-size: 0.88rem;
}

.admin-search-input::placeholder {
  color: #64748b;
}

.admin-search-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.admin-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.75);
}

.admin-table-wrap--users,
.admin-table-wrap--subs {
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.45), rgba(15, 23, 42, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 40px rgba(0, 0, 0, 0.2);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table--users {
  min-width: 1120px;
  table-layout: fixed;
}

.admin-table--subs {
  min-width: 860px;
  table-layout: fixed;
}

.admin-col-user {
  width: 12%;
}

.admin-col-email {
  width: 26%;
}

.admin-col-badge {
  width: 9%;
}

.admin-col-num {
  width: 7%;
}

.admin-col-date {
  width: 14%;
}

.admin-col-action {
  width: 76px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.admin-table th {
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table td {
  color: #e2e8f0;
  overflow-wrap: break-word;
  word-break: normal;
  vertical-align: middle;
}

.admin-table--users td:nth-child(3),
.admin-table--users td:nth-child(4),
.admin-table--users td:nth-child(5),
.admin-table--subs td:nth-child(3),
.admin-table--subs td:nth-child(4) {
  white-space: nowrap;
}

.admin-table--users .admin-num-cell,
.admin-table--subs .admin-num-cell {
  text-align: right;
  font-weight: 600;
}

.admin-user-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-user-row:hover {
  background: rgba(56, 189, 248, 0.06);
}

.admin-user-row:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.5);
  outline-offset: -2px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  max-width: 100%;
  box-sizing: border-box;
}

.admin-badge--yes {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.admin-badge--no {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.admin-badge--free {
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
}

.admin-badge--standard {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}

.admin-badge--premium {
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
}

.admin-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 6px;
  margin-bottom: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-btn:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #fff;
}

.admin-btn--ghost {
  background: rgba(15, 23, 42, 0.5);
}

.admin-btn--small {
  padding: 4px 8px;
  font-size: 0.72rem;
}

.admin-btn--danger {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.admin-btn--danger:hover {
  background: rgba(127, 29, 29, 0.25);
}

.admin-btn--premium {
  border-color: rgba(250, 204, 21, 0.4);
  color: #fde68a;
}

.admin-btn--premium:hover {
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(113, 63, 18, 0.25);
}

.admin-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-self-note {
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.admin-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
  z-index: 80;
  padding: 18px;
  box-sizing: border-box;
  overflow: hidden;
}

.admin-modal-card {
  width: min(720px, 96vw);
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.84), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: 20px;
}

.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
}

.admin-modal-close {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  cursor: pointer;
}

.admin-user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-user-detail-row {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-user-detail-row span {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-user-detail-row strong {
  font-size: 0.9rem;
  color: #e2e8f0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#adminDetailUserId {
  word-break: break-all;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.admin-role-editor {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.44);
  margin-bottom: 14px;
}

.admin-role-editor label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.admin-role-editor-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-select {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.86);
  color: #f1f5f9;
  padding: 8px 10px;
  min-width: 170px;
}

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

.admin-discord-form {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.admin-discord-form label {
  font-size: 0.8rem;
  font-weight: 650;
  color: #cbd5e1;
}

.admin-discord-input {
  max-width: 100%;
}

/* Discord form uses full-width text fields — not search boxes (avoid extra left gutter). */
.admin-discord-form .admin-discord-input {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 44px;
  padding: 11px 14px !important;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.9);
  color: #f1f5f9;
  font-size: 0.9rem;
}

.admin-discord-form .admin-discord-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.admin-discord-form .admin-discord-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.admin-discord-notice {
  margin: 0 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.2);
  color: #fcd34d;
}

.admin-discord-notice.hidden {
  display: none !important;
}

.admin-discord-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}

.admin-msg-body {
  max-width: 520px;
  white-space: pre-wrap;
  font-size: 0.86rem;
  line-height: 1.45;
}

.admin-banner {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.admin-banner--error {
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.admin-banner--warn {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.25);
  color: #fcd34d;
}

.admin-banner--info {
  background: rgba(30, 58, 138, 0.35);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #dbeafe;
}

.admin-banner--success {
  border-color: rgba(74, 222, 128, 0.42);
  background: rgba(22, 101, 52, 0.28);
  color: #dcfce7;
}

.admin-banner--pulse {
  animation: adminBannerPulse 520ms ease;
}

@keyframes adminBannerPulse {
  0% {
    transform: scale(0.98);
    opacity: 0.72;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.admin-sidebar-role-line {
  font-size: 0.8rem;
  color: #cbd5e1;
  display: block;
  margin-bottom: 6px;
}

.admin-staff-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 4px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(125, 211, 252, 0.35);
  color: #bae6fd;
}

.admin-staff-chip--support {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
  color: #86efac;
}

.admin-staff-chip--moderator {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.38);
  color: #fde68a;
}

.admin-staff-chip--admin {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.admin-badge--offline {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.admin-badge--muted {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
}

.admin-badge--staff-admin {
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

.admin-badge--staff-mod {
  background: rgba(250, 204, 21, 0.15);
  color: #fde047;
}

.admin-badge--staff-support {
  background: rgba(52, 211, 153, 0.14);
  color: #bbf7d0;
}

.admin-num-cell {
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
}

.admin-table-wrap--scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.admin-pagination-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-pagination-meta {
  font-size: 0.82rem;
  color: #94a3b8;
}

.admin-toolbar--wrap {
  flex-wrap: wrap;
  row-gap: 10px;
}

.admin-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.admin-filter-label-text {
  white-space: nowrap;
}

.admin-select--compact {
  min-width: 0;
  padding: 6px 8px;
}

.admin-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-analytics-stack {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .admin-analytics-stack {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.admin-analytics-body {
  font-size: 0.9rem;
  color: #e2e8f0;
}

.admin-analytics-muted {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 0.86rem;
}

.admin-analytics-status-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-analytics-status-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.1);
  text-transform: capitalize;
}

.admin-analytics-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #7dd3fc;
}

.admin-settings-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-card--pad {
  padding: 16px 18px;
}

.admin-card-lead {
  margin: 0;
  line-height: 1.55;
  color: #cbd5e1;
}

.admin-toolbar--inbox {
  margin-bottom: 12px;
}

.admin-user-detail-grid--wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-user-detail-row--span {
  grid-column: 1 / -1;
}

.admin-grant-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-hint-muted {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

.admin-role-editor--grant {
  border-style: dashed;
}

.admin-role-editor--gift {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.12);
}

.admin-modal--gift {
  z-index: 90;
}

.admin-gift-modal-card {
  width: min(460px, 94vw);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.22);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.admin-gift-recipient,
.admin-gift-balance-hint {
  margin: 0 0 10px;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.admin-gift-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-gift-field label {
  font-size: 0.78rem;
  color: #94a3b8;
}

.admin-gift-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.admin-role-editor--gift .admin-gift-preset-row {
  margin-bottom: 10px;
}

.admin-gift-preset-row .admin-btn--gift.admin-btn--small {
  min-width: 4.5rem;
  font-weight: 600;
}

.admin-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.admin-input:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14);
}

.admin-modal-actions--gift {
  justify-content: flex-end;
  gap: 10px;
}

.admin-btn--gift {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.92), rgba(180, 83, 9, 0.95));
  color: #fffbeb;
}

.admin-btn--gift:hover:not(:disabled) {
  filter: brightness(1.06);
}

.admin-btn--gift.is-busy {
  opacity: 0.72;
  cursor: wait;
}

.admin-gift-icon-btn {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.35);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  line-height: 1;
  margin-right: 6px;
  vertical-align: middle;
}

.admin-gift-icon-btn:hover {
  background: rgba(180, 83, 9, 0.45);
}

@media (max-width: 900px) {
  .admin-root:not(.admin-app-shell) {
    flex-direction: column;
  }

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

  .admin-role-editor-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-user-detail-grid--wide {
    grid-template-columns: 1fr;
  }

  .admin-table-wrap--scroll-x {
    max-width: 100%;
  }
}

/* ——— App shell: drawer + mobile header + bottom nav ——— */
.admin-app-shell {
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.admin-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(2, 6, 23, 0.55);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.admin-drawer-backdrop:not([hidden]) {
  display: block;
}

.admin-mobile-header {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-mh-btn,
.admin-mh-iconbtn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  cursor: pointer;
  text-decoration: none;
  font-size: 1.1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-mh-btn:hover,
.admin-mh-iconbtn:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.admin-mh-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-mh-brand {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
}

.admin-mh-section {
  font-size: 0.98rem;
  font-weight: 750;
  color: #f8fafc;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-mh-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.admin-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 42;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.98));
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.35);
  justify-content: space-between;
  gap: 4px;
}

.admin-bnav-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.62rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-bnav-btn:hover {
  color: #e2e8f0;
  background: rgba(56, 189, 248, 0.08);
}

.admin-bnav-btn.is-active {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
}

.admin-bnav-ico {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.9;
}

.admin-bnav-lbl {
  letter-spacing: 0.02em;
}

.admin-bnav-more {
  position: fixed;
  right: 12px;
  bottom: 62px;
  z-index: 43;
  min-width: 180px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.admin-bnav-more-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.admin-bnav-more-item:hover {
  background: rgba(56, 189, 248, 0.1);
}

.admin-dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.admin-dash-title {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.admin-dash-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: #94a3b8;
  max-width: 44ch;
  line-height: 1.5;
}

.admin-dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-section-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 750;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.admin-analytics-overview {
  margin-bottom: 24px;
}

.admin-analytics-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.admin-chart-card {
  padding: 16px 18px 18px;
}

.admin-chart-card-title {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.admin-chart-card--wide {
  grid-column: 1 / -1;
}

@media (min-width: 960px) {
  .admin-analytics-overview-grid .admin-chart-card:not(.admin-chart-card--wide) {
    grid-column: span 1;
  }
}

.admin-chart-slot {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-donut-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  flex-direction: column;
}

.admin-standard-split {
  width: 100%;
  max-width: 280px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.admin-standard-split-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 10px;
}

.admin-standard-split-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-standard-split-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.admin-standard-split-list li strong {
  font-variant-numeric: tabular-nums;
  color: #f1f5f9;
  font-weight: 750;
}

.admin-standard-split-hint {
  margin: 10px 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #64748b;
}

.admin-donut {
  width: min(132px, 36vw);
  height: min(132px, 36vw);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.admin-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
}

.admin-donut-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
}

.admin-donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  flex-shrink: 0;
}

.admin-mini-gauges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-around;
  align-items: flex-start;
}

.admin-ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 92px;
}

.admin-ring-svg {
  display: block;
}

.admin-ring-val {
  font-size: 1.08rem;
  font-weight: 780;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.admin-ring-lbl {
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  text-align: center;
  line-height: 1.25;
}

.admin-sparkline-wrap {
  width: 100%;
  min-height: 120px;
}

.admin-sparkline {
  width: 100%;
  height: auto;
  display: block;
}

.admin-sparkline-cta {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
}

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

.admin-dash-cards {
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-user-cards,
.admin-subs-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-user-card,
.admin-subs-card,
.admin-dash-user-card,
.admin-dash-note-card,
.admin-dash-rem-card {
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.admin-dash-user-card-top,
.admin-subs-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-dash-user-name {
  font-weight: 750;
  color: #f1f5f9;
  font-size: 0.95rem;
  word-break: break-word;
}

.admin-dash-user-email {
  font-size: 0.78rem;
  color: #94a3b8;
  word-break: break-all;
}

.admin-dash-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 12px;
}

.admin-dash-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-card-ghost-btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.admin-card-ghost-btn:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.admin-card-ghost-btn--primary {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.admin-dash-note-title {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.9rem;
  margin-bottom: 6px;
  line-height: 1.35;
}

.admin-dash-note-preview,
.admin-dash-rem-text {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.admin-dash-note-meta,
.admin-dash-rem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-size: 0.72rem;
  color: #64748b;
}

.admin-dash-rem-time {
  font-weight: 650;
  color: #cbd5e1;
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.admin-stat-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-stat-ico {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(125, 211, 252, 0.16);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .admin-app-shell .admin-mobile-header {
    display: flex;
  }

  .admin-app-shell .admin-bottom-nav {
    display: flex;
  }

  .admin-app-shell .admin-main {
    padding: 16px 16px 88px;
    max-width: none;
    overflow-x: hidden;
  }

  .admin-app-shell .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    max-width: 100%;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    border-bottom: none;
    box-shadow: 16px 0 48px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .admin-app-shell .admin-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-app-shell .admin-sidebar-top {
    flex: 0 0 auto;
    min-width: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    margin-bottom: 12px;
    padding-bottom: 16px;
  }

  .admin-app-shell .admin-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    gap: 16px;
    overflow-y: auto;
  }

  .admin-app-shell .admin-nav-group {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
  }

  .admin-app-shell .admin-nav-group-label {
    width: auto;
    padding-bottom: 4px;
  }

  .admin-app-shell .admin-nav-item {
    width: 100%;
    min-width: 0;
  }

  .admin-app-shell .admin-sidebar-foot {
    width: 100%;
    margin-top: auto;
    padding-top: 16px;
    flex-shrink: 0;
  }

  .admin-app-shell .admin-bar-fill {
    transition: none;
  }

  .admin-app-shell .admin-dash-cards,
  .admin-app-shell .admin-user-cards,
  .admin-app-shell .admin-subs-cards {
    display: flex;
  }

  .admin-app-shell .admin-dash-table-desktop {
    display: none !important;
  }

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

@media (max-width: 360px) {
  .admin-app-shell .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) {
  .admin-app-shell .admin-mobile-header {
    display: none;
  }

  .admin-app-shell .admin-bottom-nav,
  .admin-app-shell .admin-bnav-more {
    display: none !important;
  }

  .admin-app-shell .admin-drawer-backdrop {
    display: none !important;
  }

  .admin-app-shell .admin-sidebar {
    position: relative;
    transform: none !important;
    height: auto;
  }

  .admin-app-shell .admin-main {
    padding-bottom: 56px;
  }

  .admin-app-shell .admin-dash-cards,
  .admin-app-shell .admin-user-cards,
  .admin-app-shell .admin-subs-cards {
    display: none !important;
  }

  .admin-app-shell .admin-dash-table-desktop {
    display: block !important;
  }
}

/* Performance: lighter paint on phones / narrow admin shell */
@media (max-width: 900px) {
  .admin-root {
    background: #020617;
  }

  .admin-drawer-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(2, 6, 23, 0.82);
  }

  .admin-stat-card,
  .admin-card,
  .admin-user-card,
  .admin-subs-card,
  .admin-dash-user-card,
  .admin-modal-content {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  }

  .admin-stat-card::before,
  .admin-card::before {
    opacity: 0.35;
  }

  .admin-donut {
    filter: none;
  }

  .admin-user-card,
  .admin-subs-card,
  .admin-dash-user-card {
    content-visibility: auto;
    contain-intrinsic-size: 120px;
  }

  .admin-table-wrap--scroll-x {
    content-visibility: auto;
  }

  .admin-stat-card,
  .admin-card,
  .admin-user-card,
  .admin-subs-card,
  .admin-dash-user-card,
  .admin-dash-note-card {
    transition: border-color 0.15s ease, opacity 0.15s ease !important;
  }

  .admin-banner--pulse {
    animation: none !important;
  }

  .admin-donut,
  .admin-ring-svg circle {
    filter: none !important;
  }

  .admin-modal {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .admin-modal-card,
  .admin-modal-card--user,
  .admin-gift-modal-card {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    height: auto;
    flex: 1 1 auto;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin: 0;
    padding:
      calc(12px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      calc(16px + env(safe-area-inset-bottom, 0px))
      calc(14px + env(safe-area-inset-left, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 12px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 70%, rgba(15, 23, 42, 0));
  }

  .admin-user-detail-grid,
  .admin-user-detail-grid--wide {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .admin-user-detail-row,
  .admin-role-editor {
    min-width: 0;
  }

  .admin-select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .admin-role-editor-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-role-editor-controls .admin-btn {
    width: 100%;
    margin-right: 0;
  }

  .admin-grant-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-grant-row .admin-btn {
    width: 100%;
    min-width: 0;
    margin-right: 0;
    margin-bottom: 0;
    white-space: normal;
    text-align: center;
  }

  .admin-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-modal-actions .admin-btn {
    width: 100%;
    margin-right: 0;
  }
}
