:root {
  --portal-yellow: #ffd31c;
  --portal-yellow-soft: #fff7d2;
  --portal-bg: #f4f4f4;
  --portal-ink: #000000;
  --portal-footer: #141414;
  --portal-success: #2ea450;
}

body {
  min-height: 100vh;
  font-family: "Montserrat", sans-serif;
  color: var(--portal-ink);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 28, 0.35), transparent 22%),
    linear-gradient(180deg, #fffdf4 0%, var(--portal-bg) 50%, #efece4 100%);
}

.portal-page {
  min-height: calc(100vh - 76px);
}

.portal-navbar {
  background: rgba(255, 247, 210, 0.92);
  backdrop-filter: blur(10px);
}

.portal-navbar .container {
  align-items: flex-start;
}

.portal-navbar .nav-link {
  color: rgba(0, 0, 0, 0.72);
  font-weight: 600;
}

.portal-navbar .nav-link.active,
.portal-navbar .nav-link:hover {
  color: var(--portal-ink);
}

.portal-brand-short {
  display: none;
}

.portal-brand-full {
  display: inline;
}

.portal-sidebar-user {
  margin-bottom: 28px;
}

.portal-top-user-badge {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1040;
  max-width: min(420px, calc(100vw - 32px));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.portal-sidebar-user .portal-user-icon {
  display: none;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-nav-link .tooltip-inner {
  font-weight: 600;
}

.portal-nav-icon {
  flex: 0 0 24px;
  font-size: 1.05rem;
  text-align: center;
}

.portal-nav-label {
  display: inline-block;
}

.portal-title,
.portal-subtitle {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
}

.hero-panel,
.portal-card,
.portal-metric {
  border-radius: 24px;
}

.hero-panel {
  background: linear-gradient(135deg, rgba(255, 211, 28, 0.96), rgba(255, 247, 210, 0.92));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.portal-card {
  background: rgba(255, 255, 255, 0.92);
}

.section-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.portal-section-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--portal-yellow-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.portal-note {
  background: rgba(255, 247, 210, 0.55);
}

.portal-footer {
  margin-top: 32px;
  background: var(--portal-footer);
  color: rgba(255, 255, 255, 0.88);
}

.portal-footer__title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.portal-footer__links a {
  color: #ffffff;
  text-decoration: none;
}

.portal-footer__links a:hover,
.portal-footer__links a:focus {
  text-decoration: underline;
}

.portal-metric {
  height: 100%;
  padding: 18px;
  background: #fff8d7;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.portal-metric__label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.62);
}

.portal-metric__value {
  margin-top: 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.1rem;
  word-break: break-word;
}

.portal-metric--highlight {
  padding: 28px;
  background: linear-gradient(135deg, rgba(255, 211, 28, 0.96), rgba(255, 247, 210, 0.92));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.portal-metric__hero {
  margin-top: 12px;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
}

.portal-metric__meta {
  margin-top: 10px;
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.72);
}

.inventory-list {
  display: grid;
  gap: 20px;
}

.inventory-table {
  min-width: 1180px;
}

.inventory-table-wrapper {
  max-height: 68vh;
  overflow: auto;
}

.inventory-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 16px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.58);
  white-space: nowrap;
  background: rgba(255, 247, 210, 0.55);
  border-bottom-width: 1px;
}

.inventory-table tbody td {
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  vertical-align: middle;
}

.inventory-table tbody tr:last-child td {
  border-bottom: 0;
}

.inventory-item {
  overflow: hidden;
}

.inventory-item__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.inventory-item__field {
  min-width: 0;
}

.inventory-item__label {
  margin-bottom: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.58);
}

.inventory-item__value {
  font-size: 1rem;
  font-weight: 600;
  word-break: break-word;
}

.portal-home-card {
  color: inherit;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.portal-home-card:hover,
.portal-home-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.portal-home-mini {
  height: 100%;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 247, 210, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-tabs .nav-link {
  color: rgba(0, 0, 0, 0.72);
  font-weight: 600;
}

.nav-tabs .nav-link.active {
  color: var(--portal-ink);
  background: rgba(255, 247, 210, 0.8);
  border-color: rgba(0, 0, 0, 0.12);
}

.portal-embed {
  display: block;
  width: 100%;
  min-height: 78vh;
  border: 0;
  background: #ffffff;
}

.portal-access-chart__grid {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 320px;
}

.portal-access-chart__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.portal-access-chart__bar-wrap {
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 220px;
  padding: 0 2px;
  background: rgba(255, 247, 210, 0.45);
  border-radius: 16px;
}

.portal-access-chart__bar {
  width: 100%;
  min-height: 6px;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, #ffd31c 0%, #e7bf19 100%);
}

.portal-access-chart__label,
.portal-access-chart__value {
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.68);
  text-align: center;
}

.portal-notices-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
}

.portal-notices-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}

.portal-notices-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 24px));
  margin: 6vh auto 0;
}

.portal-notice {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 247, 210, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.form-control,
.btn,
.alert {
  border-radius: 16px;
}

.btn-warning {
  background-color: var(--portal-yellow);
  border-color: var(--portal-yellow);
  color: var(--portal-ink);
}

.btn-warning:hover,
.btn-warning:focus {
  background-color: #e7bf19;
  border-color: #e7bf19;
  color: var(--portal-ink);
}

.portal-navbar .offcanvas {
  background: rgba(255, 247, 210, 0.98);
}

@media (min-width: 992px) {
  body.portal-with-sidebar {
    padding-left: 96px;
    transition: padding-left 180ms ease;
  }

  body.portal-with-sidebar .portal-navbar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: 96px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 180ms ease;
  }

  body.portal-with-sidebar .portal-navbar:hover {
    width: 280px;
  }

  body.portal-with-sidebar:has(.portal-navbar:hover) {
    padding-left: 280px;
  }

  body.portal-with-sidebar .portal-navbar .container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100%;
    overflow: hidden;
    padding: 46px 20px 28px;
  }

  body.portal-with-sidebar .portal-navbar .navbar-brand {
    display: block;
    margin-right: 0;
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.4;
    white-space: normal;
  }

  body.portal-with-sidebar .portal-navbar .navbar-toggler {
    display: none;
  }

  body.portal-with-sidebar .portal-navbar .navbar-collapse {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
  }

  body.portal-with-sidebar .portal-navbar .navbar-nav {
    flex-direction: column;
    width: 100%;
    gap: 8px !important;
    align-items: stretch !important;
  }

  body.portal-with-sidebar .portal-navbar .nav-item {
    width: 100%;
  }

  body.portal-with-sidebar .portal-navbar .nav-link {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: 14px;
    overflow: hidden;
  }

  body.portal-with-sidebar .portal-navbar .nav-link.active,
  body.portal-with-sidebar .portal-navbar .nav-link:hover {
    background: rgba(255, 211, 28, 0.45);
  }

  body.portal-with-sidebar .portal-navbar .nav-link .portal-nav-label,
  body.portal-with-sidebar .portal-navbar .navbar-brand .portal-brand-full,
  body.portal-with-sidebar .portal-sidebar-user .portal-user-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 120ms ease;
  }

  body.portal-with-sidebar .portal-navbar:hover .nav-link .portal-nav-label,
  body.portal-with-sidebar .portal-navbar:hover .navbar-brand .portal-brand-full,
  body.portal-with-sidebar .portal-navbar:hover .portal-sidebar-user .portal-user-text {
    opacity: 1;
    visibility: visible;
    width: auto;
  }

  body.portal-with-sidebar .portal-navbar:hover .nav-link .portal-nav-label,
  body.portal-with-sidebar .portal-navbar:hover .navbar-brand .portal-brand-full {
    white-space: normal;
    line-height: 1.35;
  }

  body.portal-with-sidebar .portal-navbar .navbar-brand .portal-brand-short {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
  }

  body.portal-with-sidebar .portal-navbar:hover .navbar-brand .portal-brand-short {
    display: none;
  }

  body.portal-with-sidebar .portal-navbar:hover .navbar-brand .portal-brand-full {
    display: inline;
  }

  body.portal-with-sidebar .portal-sidebar-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 44px;
    max-width: 44px;
    align-self: center;
    padding: 12px;
    overflow: hidden;
  }

  body.portal-with-sidebar .portal-sidebar-user .portal-user-icon {
    display: inline-flex;
    font-size: 1.2rem;
  }

  body.portal-with-sidebar .portal-navbar:hover .portal-sidebar-user {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    justify-content: flex-start;
  }

  body.portal-with-sidebar .portal-navbar .nav-link .portal-nav-icon {
    margin-right: 0;
  }

  body.portal-with-sidebar .portal-navbar .ms-lg-3 {
    margin-top: auto;
    margin-left: 0 !important;
    padding-top: 16px;
  }

  body.portal-with-sidebar .portal-navbar #logout {
    width: 100%;
  }
}

@media (max-width: 991px) {
  .portal-top-user-badge {
    top: 16px;
    right: 16px;
    font-size: 0.88rem;
  }

  .portal-page {
    min-height: auto;
  }

  .inventory-item__grid {
    grid-template-columns: 1fr;
  }

  .portal-footer__links {
    flex-direction: column;
    gap: 10px;
  }
}
