:root {
  --bg-top: #07111b;
  --bg-bottom: #05111c;
  --surface: rgba(8, 20, 31, 0.78);
  --surface-strong: rgba(10, 24, 38, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --text: #f3f6fb;
  --muted: #9eb0c4;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #72f0a0;
  --accent-strong: #28c9c9;
  --accent-soft: rgba(114, 240, 160, 0.16);
  --cool: #59a8ff;
  --cool-soft: rgba(89, 168, 255, 0.16);
  --danger: #ff6b7d;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.22);
  --font-display: "Sora", var(--brand-font-display, sans-serif);
  --font-body: "IBM Plex Sans", var(--brand-font-body, sans-serif);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(89, 168, 255, 0.24), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(114, 240, 160, 0.18), transparent 24%),
    radial-gradient(circle at 55% 100%, rgba(40, 201, 201, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

body::before {
  top: -8rem;
  right: -8rem;
  background: rgba(89, 168, 255, 0.24);
}

body::after {
  bottom: -10rem;
  left: -8rem;
  background: rgba(114, 240, 160, 0.2);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 100%;
}

.brand-lockup__image {
  display: block;
  width: auto;
  max-width: min(260px, 100%);
  max-height: var(--brand-logo-height);
  object-fit: contain;
}

.brand-lockup__text {
  display: inline-block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.login-view,
.portal-view {
  position: relative;
  z-index: 1;
}

.login-view {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 420px);
  gap: 28px;
  align-items: center;
}

.eyebrow,
.card-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

h1,
h2,
strong {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

h1,
h2,
p {
  margin: 0;
}

.lead {
  margin-top: 16px;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.65;
  color: #dbe6f3;
  max-width: 48rem;
}

.muted,
.hero-meta,
.detail-value,
.list-item span,
.action-card p,
.stat-card small {
  color: var(--muted);
}

.login-copy {
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(89, 168, 255, 0.08), rgba(114, 240, 160, 0.04) 42%, transparent 68%),
    linear-gradient(180deg, rgba(8, 17, 28, 0.72) 0%, rgba(6, 13, 22, 0.42) 100%);
  box-shadow: var(--shadow);
  animation: riseIn 480ms ease;
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
}

.login-copy h1,
.hero h1 {
  margin-top: 14px;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.98;
}

.login-copy h1 {
  margin-top: 0;
  width: 100%;
}

.login-copy h1[data-brand-hero-lockup="true"] {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-hero-lockup {
  display: inline-grid;
  justify-items: center;
  gap: 1.2rem;
  width: min(520px, 100%);
}

.brand-hero-image {
  display: block;
  width: min(440px, 100%);
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 14px 34px rgba(89, 168, 255, 0.22));
}

.brand-hero-text {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #f7fbff;
}

.login-copy h1[data-brand-has-logo="true"] .brand-lockup {
  width: 100%;
  justify-content: center;
  flex-direction: row-reverse;
  gap: 1rem;
}

.login-copy h1[data-brand-has-logo="true"] .brand-lockup__image {
  max-height: clamp(54px, 6vw, 76px);
}

.login-copy h1[data-brand-has-logo="true"] .brand-lockup__text {
  display: inline-flex;
  align-items: center;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.highlight-card,
.stat-card,
.panel,
.login-card,
.integrity-banner,
.action-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.highlight-card {
  padding: 18px;
  border-radius: 22px;
  min-height: 136px;
  display: grid;
  align-content: space-between;
}

.highlight-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.highlight-card strong {
  font-size: 1.2rem;
}

.login-card {
  padding: 30px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(89, 168, 255, 0.08), rgba(114, 240, 160, 0.06) 40%, transparent 78%),
    linear-gradient(180deg, rgba(12, 24, 39, 0.94) 0%, rgba(9, 17, 26, 0.88) 100%);
  animation: riseIn 600ms ease;
  display: grid;
  align-content: center;
}

.card-head,
.button-row,
.badge-group,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.76rem;
  font-weight: 700;
  color: #f9fbff;
}

.status-pill--accent {
  background: linear-gradient(135deg, rgba(114, 240, 160, 0.22), rgba(89, 168, 255, 0.24));
  border-color: rgba(114, 240, 160, 0.24);
}

.status-pill--warning {
  background: linear-gradient(135deg, rgba(255, 107, 125, 0.2), rgba(255, 190, 92, 0.18));
  border-color: rgba(255, 107, 125, 0.26);
  color: #fff1f3;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  color: #e9edf3;
}

input {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

select {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 8rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(114, 240, 160, 0.48);
  box-shadow: 0 0 0 4px rgba(89, 168, 255, 0.12);
}

.primary-button,
.ghost-button,
.secondary-button {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.92rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease,
    background 160ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.secondary-button:hover,
.action-card:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--cool) 100%);
  color: #051620;
  box-shadow: 0 18px 38px rgba(52, 176, 210, 0.24);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(89, 168, 255, 0.14);
  color: #eef4ff;
}

.secondary-button {
  background: linear-gradient(135deg, rgba(89, 168, 255, 0.12), rgba(114, 240, 160, 0.1));
  border-color: rgba(89, 168, 255, 0.2);
  color: #cde8ff;
}

.form-feedback {
  min-height: 1.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-feedback.is-error {
  color: #ffb1bc;
}

.form-feedback.is-success {
  color: #96f2d7;
}

.demo-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.portal-view {
  display: grid;
  gap: 22px;
  animation: riseIn 420ms ease;
}

.portal-tab-view {
  display: grid;
  gap: 22px;
}

.view-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: #eef4ff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab-button:hover,
.tab-button.is-active {
  transform: translateY(-1px);
  border-color: rgba(114, 240, 160, 0.24);
  background: linear-gradient(135deg, rgba(114, 240, 160, 0.18), rgba(89, 168, 255, 0.12));
}

.hero,
.section-block,
.content-grid {
  position: relative;
}

.hero {
  padding: 34px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(89, 168, 255, 0.14), rgba(114, 240, 160, 0.08) 42%, transparent 64%),
    linear-gradient(180deg, rgba(12, 22, 35, 0.92) 0%, rgba(9, 16, 25, 0.82) 100%);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 360px);
  gap: 22px;
}

.hero-actions {
  display: grid;
  gap: 14px;
  align-content: start;
  justify-items: end;
}

.stats-grid,
.action-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.content-grid--brand {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid--compact .stat-card {
  min-height: 138px;
}

.stat-card,
.panel,
.integrity-banner,
.action-card {
  padding: 22px;
  border-radius: 24px;
}

.panel--brand-main {
  min-height: 100%;
}

.brand-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.management-form {
  margin-top: 18px;
}

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

.management-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(160px, 0.7fr));
  gap: 14px;
  margin-bottom: 14px;
}

.management-filter-bar--accounts {
  grid-template-columns: minmax(240px, 1.6fr) minmax(180px, 0.75fr);
}

.management-filter-bar--audit {
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, 0.75fr));
}

.compact-filter {
  gap: 6px;
}

.management-filter-summary {
  margin: 0 0 16px;
}

.management-scope {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

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

.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.checkbox-option input {
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  padding: 0;
}

.checkbox-option span {
  display: grid;
  gap: 2px;
}

.checkbox-option strong {
  font-size: 0.98rem;
}

.checkbox-option small,
.checkbox-empty-state,
.inline-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.internal-user-list {
  display: grid;
  gap: 14px;
}

.audit-trail-list {
  display: grid;
  gap: 14px;
}

.audit-event-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(8, 14, 22, 0.82) 100%);
  display: grid;
  gap: 8px;
}

.audit-event-card--success {
  border-color: rgba(114, 240, 160, 0.2);
}

.audit-event-card--warning,
.audit-event-card--error {
  border-color: rgba(255, 107, 125, 0.22);
}

.audit-event-card--info {
  border-color: rgba(89, 168, 255, 0.2);
}

.internal-user-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(8, 14, 22, 0.76) 100%);
}

.internal-user-card.is-inactive {
  opacity: 0.86;
}

.internal-user-card__body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.internal-user-card__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.permissions-inline-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(89, 168, 255, 0.16);
  background: rgba(89, 168, 255, 0.08);
}

.permissions-inline-editor__head,
.permissions-inline-editor__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.permissions-inline-editor__head span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.permission-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.permission-chip input {
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  padding: 0;
}

.permission-chip span {
  display: grid;
  gap: 4px;
}

.permission-chip strong {
  font-size: 0.96rem;
}

.permission-chip small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.key-toggle-button {
  width: 3.4rem;
  min-width: 3.4rem;
  height: 3.4rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #dceaff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.key-toggle-button:hover {
  transform: translateY(-1px);
}

.key-toggle-button.is-active {
  background: linear-gradient(135deg, rgba(114, 240, 160, 0.22), rgba(89, 168, 255, 0.18));
  border-color: rgba(114, 240, 160, 0.28);
  color: #f5fff9;
}

.key-toggle-button.is-inactive {
  background: linear-gradient(135deg, rgba(255, 107, 125, 0.18), rgba(89, 168, 255, 0.1));
  border-color: rgba(255, 107, 125, 0.22);
  color: #ffd7dc;
}

.key-toggle-button svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

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

.brand-fieldset {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.brand-preview-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(135deg, rgba(114, 240, 160, 0.1), rgba(89, 168, 255, 0.08)),
    rgba(255, 255, 255, 0.03);
  margin-bottom: 18px;
}

.stat-card {
  min-height: 158px;
  display: grid;
  align-content: space-between;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  line-height: 1.05;
}

.integrity-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(114, 240, 160, 0.14), rgba(89, 168, 255, 0.12)),
    var(--surface-strong);
}

.action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-card {
  min-height: 220px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(8, 14, 22, 0.88) 100%);
}

.action-card strong {
  font-size: 1.32rem;
}

.action-tag {
  display: inline-flex;
  width: fit-content;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(114, 240, 160, 0.12), rgba(89, 168, 255, 0.12));
  border: 1px solid rgba(89, 168, 255, 0.16);
  color: #cef7ff;
  font-size: 0.76rem;
  font-weight: 700;
}

.action-card.is-disabled {
  opacity: 0.56;
  pointer-events: none;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-head h2,
.panel h2 {
  font-size: 1.45rem;
}

.section-head--tight {
  margin-bottom: 18px;
}

.detail-list,
.list-stack,
.mini-stats {
  display: grid;
  gap: 12px;
}

.detail-row,
.list-item,
.mini-stat {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--surface-soft);
}

.detail-row {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}

.detail-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.detail-value {
  color: #f4f7fb;
  font-weight: 600;
}

.mini-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stats--wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.mini-stat {
  padding: 18px;
  min-height: 126px;
  display: grid;
  align-content: end;
  gap: 6px;
}

.mini-stat strong {
  font-size: 2rem;
}

.list-stack--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list-item {
  padding: 16px 18px;
  display: grid;
  gap: 8px;
}

.list-item--account {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(8, 14, 22, 0.82) 100%);
}

.list-item--warning {
  border-color: rgba(255, 107, 125, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 125, 0.08);
}

.list-item--empty {
  min-height: 120px;
  align-content: center;
}

.list-item__header,
.list-item__actions,
.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.list-item strong {
  font-size: 1.08rem;
}

.list-item span {
  font-size: 0.94rem;
  line-height: 1.55;
}

.compact-button {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
}

.is-hidden {
  display: none !important;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .login-view,
  .hero,
  .content-grid,
  .content-grid--brand,
  .action-grid,
  .stats-grid,
  .list-stack--wide,
  .brand-form-grid,
  .management-grid,
  .checkbox-grid,
  .management-filter-bar,
  .internal-user-card__meta,
  .permissions-inline-grid {
    grid-template-columns: 1fr;
  }

  .internal-user-card {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 100%);
    padding: 14px 0 24px;
  }

  .login-copy,
  .login-card,
  .hero,
  .stat-card,
  .panel,
  .integrity-banner,
  .action-card {
    padding: 18px;
    border-radius: 22px;
  }

  .login-copy {
    min-height: auto;
  }

  .brand-hero-image {
    width: min(320px, 100%);
    max-height: 112px;
  }

  .brand-hero-lockup {
    gap: 0.9rem;
  }

  .brand-hero-text {
    font-size: clamp(1.55rem, 6.4vw, 2.2rem);
    letter-spacing: 0.24em;
  }

  .highlight-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .button-row,
  .badge-group,
  .section-head,
  .integrity-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}
