/* Superadmin shell */
.sa-shell {
  display: flex;
  min-height: 100vh;
}
.sa-side {
  width: 248px;
  flex-shrink: 0;
  background: rgba(5, 10, 18, 0.95);
  border-right: 1px solid var(--ps-border);
  padding: 1.25rem 0.9rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sa-side .brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.65rem 1.25rem;
  text-decoration: none;
}
.sa-side .brand .mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, #1d8cf8, #075e54);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
}
.sa-side .brand small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sa-side .nav-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.85rem 0.75rem 0.35rem;
  font-weight: 600;
  font-family: var(--font-display);
}
.sa-side a.nav-item {
  color: #94a3b8;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sa-side a.nav-item:hover {
  background: rgba(29, 140, 248, 0.1);
  color: #fff;
}
.sa-side a.nav-item.active {
  background: rgba(29, 140, 248, 0.16);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--alfa-blue);
}
.sa-side a.nav-item i { font-size: 1.05rem; opacity: 0.9; width: 1.15rem; text-align: center; }
.sa-main {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 1.75rem 3rem;
}
.sa-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.sa-page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 0.25rem;
}
.sa-page-head p {
  margin: 0;
  color: var(--ps-muted);
  font-size: 0.92rem;
  max-width: 36rem;
}

.sa-stat {
  background: linear-gradient(165deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--ps-border);
  border-radius: 1rem;
  padding: 1.15rem 1.25rem;
  height: 100%;
  text-decoration: none !important;
  display: block;
  transition: border-color 0.15s, transform 0.15s;
  color: inherit !important;
}
.sa-stat:hover {
  border-color: rgba(29, 140, 248, 0.45);
  transform: translateY(-2px);
}
.sa-stat .n {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.sa-stat .l {
  font-size: 0.82rem;
  color: var(--ps-muted);
  margin-top: 0.25rem;
}
.sa-stat .ico {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--alfa-blue-dim);
  color: #7dd3fc;
  margin-bottom: 0.75rem;
}

.sa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  align-items: center;
}
.sa-search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  position: relative;
}
.sa-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.9rem;
}
.sa-search input {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 2.35rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(6, 13, 24, 0.65);
  color: #f1f5f9;
  font-size: 0.9rem;
}
.sa-search input:focus {
  outline: none;
  border-color: rgba(29, 140, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(29, 140, 248, 0.12);
}

.sa-table-wrap {
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--ps-border);
  border-radius: 1rem;
  overflow: hidden;
}
.sa-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}
.sa-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 600;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--ps-border);
  background: rgba(0,0,0,0.2);
  font-family: var(--font-display);
}
.sa-table td {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
  color: #e2e8f0;
  font-size: 0.9rem;
}
.sa-table tr:last-child td { border-bottom: 0; }
.sa-table tr:hover td { background: rgba(255,255,255,0.025); }

.sa-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, rgba(29,140,248,0.35), rgba(37,211,102,0.25));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.sa-user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sa-user-cell .name { color: #fff; font-weight: 600; font-size: 0.92rem; }
.sa-user-cell .sub { color: var(--ps-muted); font-size: 0.8rem; }

.sa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-display);
}
.sa-badge.ok { background: rgba(37,211,102,0.15); color: #86efac; border: 1px solid rgba(37,211,102,0.3); }
.sa-badge.no { background: rgba(148,163,184,0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); }
.sa-badge.warn { background: rgba(251,191,36,0.12); color: #fcd34d; border: 1px solid rgba(251,191,36,0.3); }
.sa-badge.info { background: rgba(29,140,248,0.14); color: #93c5fd; border: 1px solid rgba(29,140,248,0.3); }
.sa-badge.danger { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }

.sa-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ps-border);
  border-radius: 1rem;
  padding: 1.25rem 1.35rem;
}
.sa-card h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.sa-card .lead {
  color: var(--ps-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.sa-field { margin-bottom: 0.85rem; }
.sa-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}
.sa-field .hint { color: #64748b; font-weight: 400; font-size: 0.72rem; }
.sa-input, .sa-select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(6, 13, 24, 0.7) !important;
  color: #f1f5f9 !important;
  font-size: 0.9rem;
}
.sa-input:focus, .sa-select:focus {
  outline: none;
  border-color: rgba(29, 140, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(29, 140, 248, 0.12);
}
.sa-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
}
.sa-features label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin: 0;
  cursor: pointer;
}
.sa-sub-row {
  border: 1px solid var(--ps-border);
  border-radius: 0.9rem;
  padding: 1rem 1.15rem;
  background: rgba(255,255,255,0.03);
  margin-bottom: 0.75rem;
}
.sa-sub-row .phone {
  font-weight: 600;
  color: #fff;
  font-family: var(--font-display);
}
.sa-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ps-muted);
}

.sa-impersonate-bar {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: linear-gradient(90deg, #b45309, #ca8a04);
  color: #1c1917;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  font-family: var(--font-body);
}

@media (max-width: 900px) {
  .sa-shell { flex-direction: column; }
  .sa-side {
    width: 100%;
    height: auto;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid var(--ps-border);
  }
  .sa-side .nav-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.25rem;
  }
  .sa-side .nav-label { display: none; }
  .sa-side a.nav-item { white-space: nowrap; }
}

/* Pagination on dark */
.sa-main .pagination { margin-bottom: 0; }
.sa-main .page-link {
  background: rgba(255,255,255,0.04);
  border-color: var(--ps-border);
  color: #cbd5e1;
}
.sa-main .page-item.active .page-link {
  background: var(--alfa-blue);
  border-color: var(--alfa-blue);
}
.sa-main .page-link:hover {
  background: rgba(29,140,248,0.15);
  color: #fff;
}
