:root {
  color-scheme: dark;
  --color-bg: #070707;
  --color-bg-soft: #0f0f0f;
  --color-panel: rgba(255, 255, 255, 0.04);
  --color-panel-strong: rgba(255, 255, 255, 0.06);
  --color-text: #f5efe5;
  --color-muted: #bbaea0;
  --color-line: rgba(255, 204, 92, 0.14);
  --color-line-strong: rgba(255, 204, 92, 0.24);
  --color-orange: #f26a21;
  --color-orange-soft: #ff8b38;
  --color-yellow: #ffc74d;
  --color-yellow-soft: #ffe5a3;
  --color-success: #46c797;
  --color-danger: #ff8668;
  --shadow-soft: 0 20px 54px rgba(0, 0, 0, 0.26);
  --shadow-panel: 0 12px 32px rgba(0, 0, 0, 0.18);
  --radius-xl: 12px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--color-text);
  background: linear-gradient(180deg, #050505 0%, #0b0b0b 46%, #120e08 100%);
}

body.page-landing {
  background: linear-gradient(180deg, #050505 0%, #0d0d0d 48%, #130d06 100%);
}

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

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

img {
  display: block;
  max-width: 100%;
}

.shell,
.auth-wrap {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.shell-app {
  width: min(calc(100% - 1.5rem), 1360px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 7, 7, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 199, 77, 0.08);
}

.topbar-inner,
.top-actions,
.footer,
.footer-actions,
.hero-landing-actions,
.cta-actions,
.nav,
.product-switcher,
.account-nav,
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.topbar-inner,
.footer,
.top-actions {
  justify-content: space-between;
}

.topbar-inner {
  padding: 0.85rem 0;
}

.nav {
  flex: 1 1 42rem;
  justify-content: flex-end;
  gap: 0.7rem 1rem;
}

.product-switcher {
  flex: 1 1 24rem;
  justify-content: flex-end;
  gap: 0.45rem;
}

.product-switcher .pill {
  min-height: 2.35rem;
  padding: 0.55rem 0.72rem;
  font-size: 0.84rem;
}

.account-nav {
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-left: 0.8rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.account-nav .pill,
.account-nav .button-danger {
  min-height: 2.35rem;
  padding: 0.55rem 0.72rem;
  font-size: 0.84rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  min-width: 0;
}

.brand-mark {
  width: 2.8rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--color-yellow);
  color: #101010;
  box-shadow: 0 16px 34px rgba(242, 106, 33, 0.28);
  font-size: 0.9rem;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.brand-copy small {
  color: var(--color-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.session-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(20rem, 100%);
  padding: 0.5rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-text);
  line-height: 1.2;
}

.session-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.session-card small {
  flex: 0 0 auto;
  color: var(--color-yellow-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav a:not(.button):not(.button-secondary):not(.button-danger):hover {
  color: var(--color-yellow-soft);
}

.pill,
.button,
.button-secondary,
.button-danger,
.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.68rem 0.95rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
  cursor: pointer;
}

.pill,
.button-secondary,
.filter-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-text);
}

.button {
  background: var(--color-yellow);
  color: #111111;
  box-shadow: 0 10px 24px rgba(255, 199, 77, 0.14);
}

.button-danger {
  border-color: rgba(255, 134, 104, 0.28);
  background: rgba(255, 134, 104, 0.08);
  color: #ffd5ca;
}

.pill:hover,
.button:hover,
.button-secondary:hover,
.button-danger:hover,
.filter-button:hover {
  transform: translateY(-1px);
}

.page {
  padding: 1.5rem 0 3.25rem;
}

.page-stack,
.stack,
.flow,
.grid,
.card-grid,
.feature-grid,
.portal-card-grid,
.info-grid,
.stats-grid,
.form-grid,
.panel-grid,
.auth-layout,
.portal-hero,
.dashboard-hero,
.role-picker,
.table-role-list,
.form-block {
  display: grid;
  gap: 1.1rem;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.hero,
.card,
.surface,
.auth-panel,
.auth-side,
.cta {
  padding: 1.55rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow-soft);
}

.auth-panel,
.auth-side,
.card,
.hero {
  backdrop-filter: blur(10px);
}

.eyebrow,
.role-badge,
.section-tag,
.tag,
.section-kicker {
  display: block;
  width: fit-content;
  min-height: 0;
  margin: 0 0 0.75rem;
  padding: 0 0 0.38rem;
  border: 0;
  border-bottom: 2px solid rgba(255, 199, 77, 0.7);
  background: transparent;
  color: #dbc69a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.eyebrow::before,
.role-badge::before,
.section-tag::before,
.section-kicker::before {
  content: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(2.25rem, 4.2vw, 4rem);
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.55rem, 2.1vw, 2.35rem);
}

h3 {
  font-size: 1.24rem;
  line-height: 1.18;
}

p,
li,
small,
.muted,
.table-meta,
.route-note,
.section-copy,
.helper span,
.message span,
.alert span {
  color: var(--color-muted);
  line-height: 1.68;
}

.lead {
  margin-top: 0.95rem;
  max-width: 62ch;
  color: #ece2d3;
  font-size: 1.03rem;
  line-height: 1.62;
}

.metric-panel,
.mini-panel,
.route-card,
.feature-card,
.stat-card,
.detail-card,
.helper,
.message,
.alert,
.role-option,
.table-shell {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.028);
  box-shadow: var(--shadow-panel);
}

.metric-panel,
.mini-panel,
.route-card,
.feature-card,
.stat-card,
.detail-card,
.helper,
.message,
.alert,
.role-option {
  padding: 1.1rem;
  min-width: 0;
}

.feature-card,
.stat-card,
.detail-card,
.route-card,
.metric-panel,
.mini-panel {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.feature-card strong,
.detail-card strong,
.route-card strong,
.metric-panel strong,
.mini-panel strong,
.stat-card strong {
  overflow-wrap: anywhere;
  line-height: 1.22;
}

.feature-card p,
.detail-card p,
.route-card p,
.metric-panel p,
.mini-panel p,
.stat-card span {
  margin: 0;
  overflow-wrap: anywhere;
}

.stat-card strong,
.metric-panel strong,
.route-card strong,
.helper strong,
.message strong,
.alert strong {
  display: block;
  margin-bottom: 0.35rem;
}

.stat-card strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
  color: var(--color-yellow-soft);
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  color: #efe7db;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
select,
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 199, 77, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #9e9385;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 199, 77, 0.34);
  box-shadow: 0 0 0 3px rgba(255, 199, 77, 0.08);
}

.is-error {
  background: rgba(255, 134, 104, 0.08);
  border-color: rgba(255, 134, 104, 0.22);
  color: #ffd0c5;
}

.is-success {
  background: rgba(70, 199, 151, 0.08);
  border-color: rgba(70, 199, 151, 0.22);
  color: #c2f3df;
}

.table-shell {
  overflow: auto;
  max-width: 100%;
}

.users-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
}

.users-table th,
.users-table td {
  padding: 0.82rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 199, 77, 0.08);
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
}

.users-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #18120b;
  color: #dbc69a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.74rem;
  line-height: 1.25;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.72rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid transparent;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.status-pill.is-active {
  background: rgba(70, 199, 151, 0.08);
  border-color: rgba(70, 199, 151, 0.2);
  color: #bdf0db;
}

.status-pill.is-inactive {
  background: rgba(255, 134, 104, 0.08);
  border-color: rgba(255, 134, 104, 0.18);
  color: #ffd2c7;
}

.role-option,
.table-check,
.toggle-row {
  display: flex;
  gap: 0.7rem;
  align-items: start;
  margin: 0;
}

.role-option strong {
  display: block;
  margin-bottom: 0.18rem;
}

.compact-form,
.inline-user-form {
  display: contents;
}

.route-card code {
  display: inline-block;
  margin: 0.25rem 0 0.65rem;
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 199, 77, 0.08);
  color: var(--color-yellow-soft);
  border: 1px solid rgba(255, 199, 77, 0.14);
}

.auth-wrap {
  padding: 2rem 0 3rem;
}

.top-actions {
  margin-bottom: 1rem;
}

.footer-note {
  padding-top: 0.4rem;
  color: #958977;
  font-size: 0.92rem;
}

.dashboard-hero,
.portal-hero,
.auth-layout,
.panel-grid {
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}

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

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

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .dashboard-hero,
  .portal-hero,
  .auth-layout,
  .panel-grid,
  .stats-grid,
  .portal-card-grid,
  .feature-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell,
  .auth-wrap,
  .shell-app {
    width: min(calc(100% - 1.2rem), var(--container));
  }

  .topbar-inner,
  .top-actions,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav,
  .product-switcher,
  .account-nav,
  .table-actions,
  .hero-landing-actions,
  .cta-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .account-nav {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.7rem;
  }

  .nav a,
  .nav .pill,
  .nav .button,
  .nav .button-secondary,
  .nav .button-danger,
  .nav .session-card,
  .table-actions > a,
  .table-actions > button {
    width: 100%;
  }

  .hero,
  .card,
  .surface,
  .auth-panel,
  .auth-side,
  .cta {
    padding: 1.2rem;
  }

  h1 {
    font-size: clamp(1.85rem, 8vw, 2.8rem);
    max-width: 100%;
  }

  h2 {
    font-size: clamp(1.35rem, 6vw, 2rem);
  }

  .users-table {
    min-width: 760px;
  }
}
