:root {
  --navy-950: #030a13;
  --navy-925: #050e1a;
  --navy-900: #07162b;
  --navy-850: #0a1b33;
  --navy-800: #0e2543;
  --navy-700: #17375f;
  --panel: #0a1728;
  --panel-raised: #0d1d31;
  --panel-soft: #071321;
  --gold: #f6be2c;
  --gold-strong: #ffca3d;
  --gold-dark: #c48a12;
  --gold-soft: rgba(246, 190, 44, 0.12);
  --white: #f8fafc;
  --text: #edf2f8;
  --muted: #91a1b6;
  --muted-strong: #bcc7d4;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --green: #4fd18b;
  --green-soft: rgba(79, 209, 139, 0.12);
  --warning: #f0ad3d;
  --warning-soft: rgba(240, 173, 61, 0.12);
  --danger: #d86565;
  --shadow-soft: 0 18px 55px rgba(0, 0, 0, 0.28);
  --shadow-deep: 0 32px 90px rgba(0, 0, 0, 0.4);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 292px;
  color: var(--text);
  background: var(--navy-950);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--navy-950);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 86% -8%, rgba(246, 190, 44, 0.08), transparent 29rem),
    radial-gradient(circle at 8% 105%, rgba(23, 55, 95, 0.3), transparent 38rem),
    var(--navy-950);
}

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

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

button {
  color: inherit;
}

img {
  max-width: 100%;
}

.portal-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 22px 18px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(8, 24, 44, 0.98), rgba(4, 13, 24, 0.99)),
    var(--navy-925);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 16px;
}

.portal-brand-badge {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28));
}

.portal-brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-brand-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.1;
}

.portal-brand-copy small {
  color: var(--gold);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portal-security-label {
  margin: 0 6px 12px;
  padding: 9px 10px;
  border: 1px solid rgba(246, 190, 44, 0.16);
  border-radius: 10px;
  color: #c9b47e;
  background: rgba(246, 190, 44, 0.045);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.65rem;
  font-weight: 750;
}

.portal-security-label span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(79, 209, 139, 0.55);
}

.sidebar-nav {
  overflow-y: auto;
  padding: 2px 3px 18px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.nav-group-label {
  margin: 20px 11px 8px;
  color: #687a91;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-item {
  min-height: 44px;
  margin: 2px 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #aebacc;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.86rem;
  font-weight: 670;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.035);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--white);
  border-color: rgba(246, 190, 44, 0.24);
  background: linear-gradient(90deg, rgba(246, 190, 44, 0.14), rgba(246, 190, 44, 0.035));
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  width: 24px;
  text-align: center;
  color: var(--gold);
  font-size: 1rem;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 7px 0;
  border-top: 1px solid var(--line);
}

.sidebar-footer-actions {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-footer-actions form {
  margin: 0;
}

.sidebar-text-link {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
}

.sidebar-text-link:hover {
  color: var(--gold);
}

.sidebar-signout {
  color: #d0a2a2;
}

/* User identity */
.user-badge {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-raised);
}

.user-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-weight: 850;
}

.user-badge-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-badge-copy strong,
.user-badge-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge-copy strong {
  color: var(--white);
  font-size: 0.8rem;
}

.user-badge-copy span {
  color: var(--muted);
  font-size: 0.66rem;
}

/* Main application shell */
.main-shell {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  min-height: 76px;
  padding: 13px clamp(20px, 3.6vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 10, 19, 0.86);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 30;
}

.topbar-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.topbar-copy strong {
  color: var(--white);
  font-size: 1rem;
}

.eyebrow {
  color: #74879e;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-state,
.module-badge,
.access-chip,
.request-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.68rem;
  font-weight: 780;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(79, 209, 139, 0.72);
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  min-width: 214px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}

.user-menu-toggle:hover,
.user-menu.open .user-menu-toggle {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.user-menu-toggle .user-badge {
  flex: 1;
}

.user-menu-chevron {
  color: var(--muted);
  transition: transform 150ms ease;
}

.user-menu.open .user-menu-chevron {
  transform: rotate(180deg);
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 270px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(8, 20, 35, 0.99);
  box-shadow: var(--shadow-deep);
  display: none;
  z-index: 60;
}

.user-menu.open .user-menu-panel {
  display: block;
}

.user-menu-summary {
  padding: 10px 9px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.user-menu-panel > a,
.user-menu-panel form button {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted-strong);
  background: transparent;
  display: flex;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
}

.user-menu-panel > a:hover,
.user-menu-panel form button:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.045);
}

.user-menu-panel form {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 6px;
}

.user-menu-panel form button {
  color: #e3aaaa;
}

.content-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 34px clamp(20px, 3.6vw, 48px) 54px;
  flex: 1;
}

.portal-footer {
  padding: 18px clamp(20px, 3.6vw, 48px) 24px;
  border-top: 1px solid var(--line);
  color: #6e7f95;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.68rem;
}

/* Shared panels */
.panel,
.metric-card,
.notice,
.profile-hero,
.command-overview,
.dashboard-hero {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(13, 29, 49, 0.97), rgba(6, 17, 30, 0.98));
  box-shadow: var(--shadow-soft);
}

.dashboard-hero {
  min-height: 240px;
  padding: clamp(28px, 4vw, 46px);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 22, 43, 0.2), rgba(7, 22, 43, 0.86) 75%),
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(255, 255, 255, 0.018) 89px 90px);
  pointer-events: none;
}

.dashboard-hero-copy {
  max-width: 820px;
  position: relative;
  z-index: 2;
}

.dashboard-hero h1,
.page-heading h1,
.profile-heading h1,
.module-preview h2,
.login-card h1,
.login-panel h2,
.simple-error-card h1 {
  margin: 8px 0 0;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.dashboard-hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 4rem);
}

.dashboard-hero p,
.page-heading p,
.module-preview > p,
.login-lead,
.login-panel p,
.simple-error-card p {
  color: var(--muted-strong);
  line-height: 1.68;
}

.dashboard-hero p {
  margin: 13px 0 24px;
  font-size: 0.98rem;
}

.dashboard-hero-badge {
  position: absolute;
  right: clamp(22px, 5vw, 84px);
  top: 50%;
  width: min(270px, 28vw);
  max-height: 300px;
  object-fit: contain;
  transform: translateY(-50%) rotate(5deg);
  opacity: 0.12;
  filter: saturate(0.8);
  pointer-events: none;
}

.hero-actions,
.page-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 43px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 820;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

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

.button-primary {
  color: #101722;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  box-shadow: 0 14px 34px rgba(246, 190, 44, 0.18);
}

.button-primary:hover {
  box-shadow: 0 18px 40px rgba(246, 190, 44, 0.24);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--white);
  background: rgba(255, 255, 255, 0.045);
}

.button-ghost {
  border-color: var(--line);
  color: var(--muted-strong);
  background: transparent;
}

.button-full {
  width: 100%;
}

.metric-grid {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 142px;
  padding: 20px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.metric-card > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.metric-card strong {
  margin: auto 0 5px;
  color: var(--white);
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  letter-spacing: -0.045em;
}

.metric-card small {
  color: #71849b;
  line-height: 1.4;
}

.metric-primary {
  border-color: rgba(246, 190, 44, 0.25);
  background: linear-gradient(145deg, rgba(246, 190, 44, 0.11), rgba(6, 17, 30, 0.98));
}

.metric-success {
  border-color: rgba(79, 209, 139, 0.2);
}

.metric-warning {
  border-color: rgba(240, 173, 61, 0.24);
}

.command-overview {
  margin: 18px 0;
  padding: 24px;
  border-radius: var(--radius);
  border-color: rgba(246, 190, 44, 0.16);
}

.section-title-row,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-title-row {
  margin-bottom: 18px;
}

.section-title-row h2,
.panel-heading h2 {
  margin: 6px 0 0;
  color: var(--white);
  font-size: 1.16rem;
  letter-spacing: -0.025em;
}

.command-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.command-metric {
  min-height: 132px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  transition: 150ms ease;
}

.command-metric:hover {
  border-color: rgba(246, 190, 44, 0.28);
  background: rgba(246, 190, 44, 0.045);
  transform: translateY(-2px);
}

.command-metric strong {
  color: var(--gold);
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.command-metric span {
  margin-top: auto;
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 760;
}

.command-metric small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.dashboard-grid,
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.72fr);
  gap: 18px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius);
}

.panel-heading {
  margin-bottom: 20px;
}

.panel-link {
  color: #d9ba6b;
  font-size: 0.72rem;
  font-weight: 760;
}

.panel-link:hover {
  color: var(--gold);
}

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

.action-card {
  min-height: 136px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  transition: 150ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(246, 190, 44, 0.28);
  background: rgba(246, 190, 44, 0.045);
}

.action-card-command {
  border-color: rgba(246, 190, 44, 0.2);
  background: rgba(246, 190, 44, 0.035);
}

.action-icon {
  color: var(--gold);
  font-size: 1.3rem;
}

.action-card strong {
  margin-top: auto;
  color: var(--white);
  font-size: 0.9rem;
}

.action-card small,
.preview-card span,
.identity-list span,
.request-row small,
.request-row span,
.login-footnote {
  color: var(--muted);
  line-height: 1.5;
}

.assignment-panel {
  position: relative;
  overflow: hidden;
}

.assignment-panel::after {
  content: "MHP";
  position: absolute;
  right: -10px;
  top: 24px;
  color: rgba(246, 190, 44, 0.045);
  font-size: 5.5rem;
  font-weight: 950;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.assignment-rank {
  margin: -5px 0 18px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
}

.identity-list {
  display: grid;
  gap: 2px;
}

.identity-list > div {
  min-height: 62px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.identity-list > div:last-child {
  border-bottom: 0;
}

.identity-list span {
  font-size: 0.7rem;
}

.identity-list strong {
  color: var(--white);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.recent-activity-panel {
  margin-top: 18px;
}

.activity-list {
  display: grid;
}

.activity-row {
  min-height: 70px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: var(--gold-soft);
}

.activity-request {
  color: #aebed0;
  background: rgba(255, 255, 255, 0.035);
}

.activity-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-copy strong {
  color: var(--white);
  font-size: 0.84rem;
}

.activity-copy span,
.activity-time {
  color: var(--muted);
  font-size: 0.72rem;
}

.activity-time {
  white-space: nowrap;
}

.activity-empty {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
}

.activity-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.activity-empty div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-empty strong {
  color: var(--white);
  font-size: 0.85rem;
}

.activity-empty span {
  font-size: 0.73rem;
}

.notice {
  margin: 18px 0;
  padding: 15px 17px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notice strong {
  color: var(--white);
  font-size: 0.83rem;
}

.notice span {
  color: var(--muted-strong);
  line-height: 1.55;
  font-size: 0.8rem;
}

.notice-warning {
  border-color: rgba(240, 173, 61, 0.24);
  background: var(--warning-soft);
  box-shadow: none;
}

/* Inner pages */
.page-heading {
  margin: 0 0 25px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
}

.page-heading h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.page-heading p {
  margin: 10px 0 0;
  max-width: 780px;
}

.module-badge,
.access-chip {
  border-color: rgba(246, 190, 44, 0.23);
  color: #e8c76e;
  background: var(--gold-soft);
}

.profile-hero {
  margin-bottom: 18px;
  padding: 26px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  width: 82px;
  height: 82px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  object-fit: cover;
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--panel-raised);
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 850;
}

.profile-heading h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.profile-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-grid {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
}

.detail-grid > div {
  min-height: 102px;
  padding: 19px;
  background: var(--panel-soft);
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.7rem;
}

.detail-grid dd {
  margin: 18px 0 0;
  color: var(--white);
  font-size: 1.04rem;
  font-weight: 760;
}

.request-list {
  display: grid;
}

.request-row {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(130px, 0.45fr) minmax(260px, 1.5fr);
  gap: 20px;
  align-items: center;
}

.request-row:last-child {
  border-bottom: 0;
}

.request-row > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.request-status {
  border-color: rgba(246, 190, 44, 0.2);
  color: #e5c46c;
  background: var(--gold-soft);
}

.empty-state {
  min-height: 290px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state h3 {
  margin: 10px 0 4px;
  color: var(--white);
}

.empty-state p {
  max-width: 480px;
  color: var(--muted);
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  font-size: 1.25rem;
}

.module-preview {
  min-height: 520px;
  padding: clamp(28px, 5vw, 54px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.module-preview-mark {
  padding: 8px 11px;
  border: 1px solid rgba(246, 190, 44, 0.22);
  border-radius: 999px;
  color: #e7c873;
  background: var(--gold-soft);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.module-preview h2 {
  max-width: 780px;
  margin-top: 20px;
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.module-preview > p {
  max-width: 820px;
}

.preview-card-grid {
  width: 100%;
  margin: 25px 0 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.preview-card {
  min-height: 134px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.preview-card strong {
  color: var(--white);
  font-size: 0.9rem;
}

/* Login and error screens */
.mobile-menu-button,
.mobile-backdrop {
  display: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
}

.login-body {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 78% 14%, rgba(246, 190, 44, 0.11), transparent 24rem),
    radial-gradient(circle at 14% 92%, rgba(23, 55, 95, 0.38), transparent 34rem),
    var(--navy-950);
}

.login-stage {
  width: min(1160px, 100%);
  min-height: 690px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  overflow: hidden;
  background: rgba(6, 17, 30, 0.97);
  box-shadow: var(--shadow-deep);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.login-card,
.login-panel {
  padding: clamp(34px, 5.5vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand {
  margin-bottom: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
}

.login-badge {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.login-brand > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-brand strong {
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.login-brand small {
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-copy h1 {
  max-width: 520px;
  font-size: clamp(2.1rem, 4.6vw, 3.65rem);
}

.login-lead {
  margin: 20px 0 28px;
  max-width: 570px;
}

.button-large {
  min-height: 55px;
  border-radius: 13px;
}

.button-discord {
  color: white;
  background: linear-gradient(135deg, #5865f2, #4654da);
  box-shadow: 0 16px 34px rgba(88, 101, 242, 0.22);
}

.button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.button-symbol {
  font-size: 1.08rem;
}

.login-alert {
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid rgba(240, 173, 61, 0.24);
  border-radius: 11px;
  color: #ead3a1;
  background: var(--warning-soft);
  line-height: 1.5;
  font-size: 0.78rem;
}

.login-security {
  margin-top: 21px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.login-security span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.66rem;
}

.login-footnote {
  margin: 13px 0 0;
  font-size: 0.7rem;
}

.login-panel {
  position: relative;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(10, 31, 56, 0.9), rgba(5, 17, 31, 0.98)),
    var(--navy-900);
  overflow: hidden;
}

.login-panel::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -230px;
  bottom: -230px;
  border-radius: 50%;
  border: 1px solid rgba(246, 190, 44, 0.14);
  box-shadow: 0 0 0 62px rgba(246, 190, 44, 0.025), 0 0 0 124px rgba(246, 190, 44, 0.018);
}

.login-panel-badge-wrap {
  width: 118px;
  height: 118px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.login-panel-badge {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.35));
}

.login-panel h2 {
  max-width: 600px;
  font-size: clamp(2.15rem, 5vw, 4.1rem);
  position: relative;
  z-index: 1;
}

.login-panel p,
.feature-stack,
.login-community-note {
  position: relative;
  z-index: 1;
}

.feature-stack {
  margin-top: 25px;
  display: grid;
  gap: 10px;
}

.feature-stack > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.feature-stack strong {
  color: var(--white);
}

.feature-stack span {
  color: var(--muted);
  line-height: 1.5;
}

.login-community-note {
  margin-top: 24px;
  color: #708198;
  font-size: 0.68rem;
}

.simple-error-card {
  width: min(620px, calc(100% - 36px));
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-deep);
  text-align: center;
}

.error-code {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

/* Responsive */
@media (max-width: 1180px) {
  .command-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .dashboard-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .portal-layout {
    display: block;
  }

  .main-shell {
    display: flex;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.48);
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 35;
  }

  .sidebar-open .mobile-backdrop {
    display: block;
  }

  .mobile-menu-button {
    display: inline-grid;
    place-items: center;
  }

  .portal-state {
    display: none;
  }

  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 680px) {
  .content-shell {
    padding-top: 22px;
  }

  .topbar {
    min-height: 68px;
    padding-inline: 15px;
  }

  .topbar-copy .eyebrow {
    display: none;
  }

  .user-menu-toggle {
    min-width: auto;
    padding: 5px;
  }

  .user-menu-toggle .user-badge-copy,
  .user-menu-chevron {
    display: none;
  }

  .user-menu-panel {
    right: -4px;
    width: min(270px, calc(100vw - 28px));
  }

  .dashboard-hero,
  .page-heading,
  .profile-hero {
    align-items: stretch;
  }

  .dashboard-hero {
    min-height: 0;
    padding: 28px 23px;
  }

  .dashboard-hero-badge {
    right: -40px;
    width: 220px;
    opacity: 0.07;
  }

  .page-heading {
    flex-direction: column;
  }

  .hero-actions,
  .hero-actions .button,
  .page-actions {
    width: 100%;
  }

  .metric-grid,
  .command-metric-grid,
  .action-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    grid-template-columns: auto 1fr;
  }

  .profile-hero .access-chip {
    grid-column: 1 / -1;
  }

  .request-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .activity-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .activity-time {
    grid-column: 2;
  }

  .portal-footer {
    flex-direction: column;
    gap: 6px;
  }

  .login-body {
    padding: 13px;
  }

  .login-stage {
    min-height: auto;
    border-radius: 19px;
  }

  .login-card,
  .login-panel {
    padding: 30px 23px;
  }

  .login-brand {
    margin-bottom: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
