.portal-body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    #0f1418;
  background-size: 52px 52px;
}

.portal-shell {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  padding: 34px 0 70px;
}

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

.portal-header h1 {
  margin: 0;
  color: rgba(245, 247, 244, 0.9);
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.92;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-link,
.portal-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f5f7f4;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 800;
  cursor: pointer;
}

.portal-button.primary {
  color: #081016;
  border-color: transparent;
  background: linear-gradient(135deg, #2fd0ff, #8fdcff);
}

.danger-button {
  border-color: rgba(255, 114, 114, 0.34);
  color: #ffd1d1;
}

.portal-card,
.portal-panel {
  border: 1px solid rgba(232, 239, 228, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)),
    #1b2732;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.portal-card {
  width: min(100%, 460px);
  margin: 72px auto;
  padding: 24px;
}

.portal-panel {
  padding: 22px;
  margin-bottom: 16px;
}

.portal-panel h2,
.portal-card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.portal-muted {
  margin: 0 0 18px;
  color: #b4c3d4;
  line-height: 1.55;
}

.portal-form {
  display: grid;
  gap: 14px;
}

.portal-form label {
  display: grid;
  gap: 7px;
  color: #e8eef5;
  font-weight: 800;
}

.portal-form input,
.portal-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f5f7f4;
  background: rgba(3, 8, 12, 0.55);
}

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

.portal-checkboxes label,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-weight: 700;
  color: #dbe7f2;
}

.portal-alert {
  display: none;
  padding: 12px;
  border: 1px solid rgba(255, 114, 114, 0.28);
  border-radius: 8px;
  color: #ffd4d4;
  background: rgba(100, 24, 24, 0.22);
}

.portal-alert.is-visible {
  display: block;
}

.portal-success {
  border-color: rgba(47, 208, 255, 0.28);
  color: #d8f7ff;
  background: rgba(47, 208, 255, 0.12);
}

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

.permission-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.permission-card strong {
  display: block;
  margin-bottom: 8px;
}

.user-table-wrap {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

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

.user-table th {
  color: #b4c3d4;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(47, 208, 255, 0.26);
  border-radius: 999px;
  color: #cff4ff;
  background: rgba(47, 208, 255, 0.1);
  font-size: 0.78rem;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .portal-header,
  .permission-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-checkboxes {
    grid-template-columns: 1fr;
  }
}
