html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: #f5f7fa;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.card {
  border-radius: 0.75rem;
}

.navbar-brand {
  font-weight: 600;
}

.doctrine-fit-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
}

.fit-ring-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.slot-column h6 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 0.4rem;
}

.fit-slot {
  border: 1px solid #d8dee4;
  border-radius: 0.5rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
  min-height: 2.1rem;
  display: flex;
  align-items: center;
}

.fit-slot.filled {
  background: #f7fbff;
  border-color: #b7d0eb;
}

.fit-slot.empty {
  background: #f7f7f7;
  color: #8a8f94;
  border-style: dashed;
}

.ship-core {
  border: 1px solid #d8dee4;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #f2f6fb 0%, #eef2f6 100%);
  padding: 0.75rem;
  text-align: center;
}

.ship-core img {
  width: 132px;
  height: 132px;
  object-fit: contain;
}

.ship-placeholder {
  width: 132px;
  height: 132px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #a9b0b7;
  border-radius: 0.5rem;
  color: #6c757d;
}

.ship-core-name {
  margin-top: 0.5rem;
  font-weight: 600;
}

.ship-core-id {
  color: #6c757d;
  font-size: 0.8rem;
}

.bay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 991px) {
  .doctrine-fit-layout {
    grid-template-columns: 1fr;
  }

  .fit-ring-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ship-core {
    grid-column: span 2;
  }
}

.app-shell {
  margin-bottom: 0;
}

.app-shell.has-sidebar {
  --sidebar-collapsed-width: 76px;
  --sidebar-expanded-width: 288px;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-collapsed-width);
  height: 100vh;
  background: #111827;
  color: #e5e7eb;
  border-right: 1px solid #1f2937;
  overflow: visible;
  transition: width 160ms ease;
}

.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.75rem 0.75rem 0.9rem;
  border-bottom: 1px solid #1f2937;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #f9fafb;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: #f9fafb;
}

.sidebar-brand-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #04111f;
  border: 1px solid rgba(0, 188, 255, 0.38);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
}

.sidebar-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-brand-text {
  display: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-pin-btn {
  border: 1px solid #334155;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 0.4rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  display: none;
}

.sidebar-pin-btn:hover {
  border-color: #64748b;
  color: #e2e8f0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  padding: 0.65rem 0.4rem 1rem;
}

.sidebar-group {
  position: relative;
  margin-bottom: 0.4rem;
  border-radius: 0.55rem;
}

.sidebar-group.nav-section-hidden {
  display: none;
}

.sidebar-group-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
  font-weight: 600;
}

.sidebar-group-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 0.45rem;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: #d1d5db;
  font-size: 0.72rem;
}

.sidebar-group-label {
  display: none;
}

.sidebar-items {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.1rem 0.35rem 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 0.45rem;
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.35rem 0.45rem;
  font-size: 0.86rem;
}

.sidebar-link:hover {
  color: #f8fafc;
  background: #1e293b;
}

.sidebar-link.active {
  color: #ffffff;
  background: #1d4ed8;
}

.sidebar-link-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 0.4rem;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: #d1d5db;
  font-size: 0.72rem;
}

.sidebar-link.active .sidebar-link-icon {
  background: #1e40af;
  color: #ffffff;
}

.sidebar-link-text {
  display: none;
}

.sidebar-link-badge,
.sidebar-flyout-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #0ea5e9;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.sidebar-link-badge {
  margin-left: auto;
}

.sidebar-flyout {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  min-width: 220px;
  border-radius: 0.65rem;
  border: 1px solid #1f2937;
  background: #0f172a;
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.45);
  padding: 0.5rem;
  display: none;
}

.sidebar-flyout-title {
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem 0.35rem;
}

.sidebar-flyout-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #e2e8f0;
  text-decoration: none;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  font-size: 0.86rem;
}

.sidebar-flyout-link:hover {
  background: #1e293b;
  color: #f8fafc;
}

.sidebar-flyout-link.active {
  background: #1d4ed8;
  color: #ffffff;
}

.sidebar-group:hover .sidebar-flyout {
  display: block;
}

.sidebar-group.is-active > .sidebar-group-head {
  color: #dbeafe;
}

.sidebar-empty-state {
  margin: 0.45rem 0.35rem;
  padding: 0.7rem 0.65rem;
  border: 1px dashed #334155;
  border-radius: 0.55rem;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.35;
}

.app-main {
  margin-left: var(--sidebar-collapsed-width);
  min-height: 100vh;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  flex-wrap: wrap;
}

.topbar-brand {
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-brand:hover {
  color: #0f172a;
}

.topbar-menu-btn {
  display: none;
}

.portal-version-clock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
  white-space: nowrap;
}

.portal-live-clock {
  display: inline-block;
  min-width: 18.5ch;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.portal-section-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: min(900px, 64vw);
  padding: 0.25rem;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f1f5f9;
  overflow-x: auto;
  scrollbar-width: thin;
}

.portal-section-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  min-width: 4.2rem;
  padding: 0.48rem 0.72rem;
  white-space: nowrap;
}

.portal-section-button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.portal-section-button.active {
  background: linear-gradient(145deg, #0f172a, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.22);
}

.topbar-public-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.topbar-public-links a {
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.75rem;
  text-decoration: none;
}

.topbar-public-links a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.topbar-account .navbar-text {
  color: #1f2937 !important;
}

.topbar-account .btn-outline-light {
  color: #0f172a;
  border-color: #94a3b8;
}

.topbar-account .btn-outline-light:hover {
  color: #ffffff;
  background: #0f172a;
  border-color: #0f172a;
}

.app-content {
  padding-top: 1rem;
}

.footer {
  position: static;
  margin-top: 1rem;
  padding: 1rem 0 1.25rem;
  background: transparent;
}

.footer-content {
  display: grid;
  gap: 0.45rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.footer-disclaimer {
  max-width: 980px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.45;
}

.portal-entry {
  max-width: 1220px;
  margin: 0 auto;
}

.portal-entry-vanguard {
  color: #dbeafe;
}

.portal-entry-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 1.4rem;
  align-items: stretch;
  min-height: calc(100vh - 260px);
  padding: clamp(1.5rem, 4vw, 4rem);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 76% 18%, rgba(56, 189, 248, 0.22), transparent 26%),
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, 0.30), transparent 34%),
    linear-gradient(135deg, #061323 0%, #071d31 52%, #041713 100%);
  box-shadow: 0 30px 90px rgba(2, 8, 23, 0.34);
  overflow: hidden;
  position: relative;
}

.portal-entry-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(125, 211, 252, 0.04) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(120deg, black, transparent 76%);
  pointer-events: none;
}

.portal-entry-copy,
.portal-login-card {
  position: relative;
  z-index: 1;
}

.portal-entry-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-entry-logo {
  width: min(360px, 76vw);
  margin-bottom: clamp(2rem, 5vw, 4rem);
  filter: drop-shadow(0 18px 32px rgba(14, 165, 233, 0.28));
}

.portal-entry-copy h1 {
  color: #f8fafc;
  font-size: clamp(3rem, 8vw, 6.8rem);
  letter-spacing: -0.055em;
  line-height: 0.9;
  margin: 0 0 1rem;
}

.portal-entry-subtitle {
  color: #7dd3fc;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  margin-bottom: 1.2rem;
}

.portal-entry-description {
  color: #b6c7df;
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 720px;
}

.portal-entry-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 720px;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 1rem;
  background: rgba(8, 47, 73, 0.42);
}

.portal-entry-preview strong,
.portal-entry-preview span {
  display: block;
}

.portal-entry-preview span {
  color: #9fb3ca;
  font-size: 0.9rem;
}

.portal-entry-card {
  overflow: hidden;
}

.portal-login-card {
  align-self: center;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 38%),
    rgba(2, 8, 23, 0.72);
  box-shadow: 0 24px 70px rgba(2, 8, 23, 0.36);
  backdrop-filter: blur(18px);
}

.portal-login-card h2 {
  color: #f8fafc;
  font-size: 2rem;
}

.portal-login-card p,
.portal-login-card .form-check-label {
  color: #aabbd1;
}

.portal-login-card .form-label {
  color: #dbeafe;
}

.portal-login-card .form-control {
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.24);
  background: rgba(15, 23, 42, 0.86);
}

.portal-login-card .form-control:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.16);
}

.portal-login-card .btn-primary {
  border: 1px solid rgba(125, 211, 252, 0.58);
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 16px 34px rgba(14, 165, 233, 0.25);
}

.portal-entry-disclaimer {
  max-width: 1060px;
  margin: 1.2rem auto 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.55;
}

.portal-entry-footer-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.portal-entry-footer-links a {
  color: #0284c7;
  text-decoration: none;
}

.portal-entry-footer-links a:hover {
  color: #0ea5e9;
}

.entry-kicker {
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.entry-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.entry-feature-list span {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  font-size: 0.82rem;
  padding: 0.28rem 0.65rem;
  background: rgba(248, 250, 252, 0.85);
}

@media (max-width: 991px) {
  .portal-entry-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .portal-entry-logo {
    margin-bottom: 1.5rem;
  }
}

.sidebar-backdrop {
  display: none;
}

.app-shell.no-sidebar .app-main {
  margin-left: 0;
}

.app-shell.sidebar-pinned .app-sidebar {
  width: var(--sidebar-expanded-width);
}

.app-shell.sidebar-pinned .app-main {
  margin-left: var(--sidebar-expanded-width);
}

.app-shell.sidebar-pinned .sidebar-brand-text,
.app-shell.sidebar-pinned .sidebar-group-label,
.app-shell.sidebar-pinned .sidebar-link-text,
.app-shell.sidebar-pinned .sidebar-pin-btn {
  display: inline-flex;
}

.app-shell.sidebar-pinned .sidebar-items {
  display: block;
}

.app-shell.sidebar-pinned .sidebar-flyout {
  display: none !important;
}

.app-shell.has-sidebar:not(.sidebar-pinned):not(.sidebar-mobile-open) .app-sidebar:hover {
  width: var(--sidebar-expanded-width);
}

.app-shell.has-sidebar:not(.sidebar-pinned):not(.sidebar-mobile-open) .app-sidebar:hover .sidebar-brand-text,
.app-shell.has-sidebar:not(.sidebar-pinned):not(.sidebar-mobile-open) .app-sidebar:hover .sidebar-group-label,
.app-shell.has-sidebar:not(.sidebar-pinned):not(.sidebar-mobile-open) .app-sidebar:hover .sidebar-link-text,
.app-shell.has-sidebar:not(.sidebar-pinned):not(.sidebar-mobile-open) .app-sidebar:hover .sidebar-pin-btn {
  display: inline-flex;
}

.app-shell.has-sidebar:not(.sidebar-pinned):not(.sidebar-mobile-open) .app-sidebar:hover .sidebar-items {
  display: block;
}

.app-shell.has-sidebar:not(.sidebar-pinned):not(.sidebar-mobile-open) .app-sidebar:hover .sidebar-flyout {
  display: none !important;
}

@media (max-width: 991px) {
  .app-sidebar {
    width: var(--sidebar-expanded-width);
    transform: translateX(-100%);
    transition: transform 180ms ease-out;
  }

  .app-main,
  .app-shell.sidebar-pinned .app-main {
    margin-left: 0;
  }

  .topbar-menu-btn {
    display: inline-flex;
  }

  .portal-section-switch,
  .topbar-public-links {
    flex: 1 0 100%;
    order: 3;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .portal-section-switch {
    border-radius: 0.8rem;
  }

  .sidebar-brand-text,
  .sidebar-group-label,
  .sidebar-link-text,
  .sidebar-pin-btn {
    display: inline-flex;
  }

  .sidebar-items {
    display: block;
  }

  .sidebar-flyout {
    display: none !important;
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    border: 0;
    background: rgba(15, 23, 42, 0.45);
  }

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