:root {
  --shell-green: #204436;
  --shell-paper: #fffaf0;
  --shell-mint: #5fba89;
  --shell-brass: #b49355;
  --portal-header-height: 68px;
  --portal-dock-height: 60px;
}

.portal-icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  flex: none;
  vertical-align: middle;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.shell {
  display: block;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: var(--portal-header-height);
  justify-content: flex-start;
  gap: clamp(8px, 1.5vw, 23px);
  padding: 9px clamp(15px, 2.8vw, 42px);
  color: var(--shell-paper);
  border-bottom: 1px solid #ffffff24;
  background: var(--forest);
  box-shadow: 0 3px 14px #132b2214;
}

.topbar-brand {
  display: inline-flex;
  flex: none;
  width: clamp(128px, 11.5vw, 168px);
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--shell-paper);
}

.portal-nav {
  display: flex;
  order: 1;
  align-items: center;
  gap: 3px;
}

.portal-nav .nav-link {
  position: relative;
  justify-content: center;
  min-height: 43px;
  padding: 7px clamp(6px, 0.8vw, 12px);
  gap: 6px;
  border-radius: 6px;
  color: #dde7dc;
  font-size: clamp(.77rem, 1.16vw, .88rem);
  font-weight: 570;
}

.portal-nav .nav-link .portal-icon {
  width: 17px;
  height: 17px;
  color: #b4c9b8;
}

.portal-nav .nav-link:hover {
  color: var(--shell-paper);
  border-color: #b7d4bf40;
  background: #ffffff0d;
}

.portal-nav .nav-link[aria-current] {
  color: var(--shell-paper);
  font-weight: 680;
  border-color: #92bc9c55;
  background: var(--shell-green);
}

.portal-nav .nav-link[aria-current]::after {
  position: absolute;
  content: "";
  inset: auto calc(50% - 7px) 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--shell-mint);
}

.portal-nav .nav-link[aria-current] .portal-icon {
  color: #a6d7b8;
}

.topbar :focus-visible,
.login-intro :focus-visible {
  outline: 2px solid #a6d7b8;
  outline-offset: 2px;
}

.skip-link:focus {
  z-index: 10;
}

.dashboard-page :is(#main, #overview, #chart-title, #products, #replenishment, .management-product) {
  scroll-margin-top: calc(var(--portal-header-height) + 12px);
}

.topbar-actions {
  order: 3;
  flex: none;
  flex-wrap: nowrap;
  gap: clamp(7px, 1vw, 13px);
  margin-left: auto;
}

.portal-search {
  position: relative;
  display: flex;
  order: 2;
  flex: 1 1 270px;
  align-items: center;
  max-width: 310px;
  min-width: 0;
  margin: 0 0 0 auto;
}

.portal-search ~ .topbar-actions {
  margin-left: 0;
}

.portal-search input {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 11px 0 42px;
  border: 1px solid #aaccb663;
  border-radius: 7px;
  color: var(--shell-paper);
  background: #ffffff0b;
  font: inherit;
  font-size: .84rem;
}

.portal-search input::placeholder {
  color: #c6d7ca;
  opacity: 1;
}

.portal-search input:focus {
  border-color: #b9dcc5;
}

.portal-search button,
.portal-signout {
  display: inline-grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  color: #d9e9db;
  background: transparent;
  cursor: pointer;
}

.portal-search button {
  position: absolute;
  left: 1px;
  width: 39px;
  height: 42px;
  border-radius: 6px;
}

.portal-search button:hover,
.portal-signout:hover {
  color: var(--shell-paper);
  background: #ffffff15;
}

.portal-search button .portal-icon,
.portal-signout .portal-icon {
  width: 17px;
  height: 17px;
}

.portal-account {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--shell-paper);
  font-size: .82rem;
  white-space: nowrap;
}

.portal-account strong {
  max-width: 13ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #a6d7b85c;
  border-radius: 50%;
  color: #153a29;
  background: #d5e9d5;
  font-size: .73rem;
  letter-spacing: -.02em;
}

.portal-signout {
  width: 44px;
  height: 44px;
  border: 1px solid #aaccb663;
  border-radius: 7px;
}

.login-page {
  color: var(--ink);
  background: var(--ivory);
}

.login-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.login-intro {
  min-height: min(600px, 100svh);
  justify-content: flex-end;
  gap: clamp(14px, 3.6vh, 40px);
  padding: clamp(34px, 5.2vw, 82px);
  background-color: var(--forest);
  background-image: linear-gradient(0deg, #10261ef7 0%, #10261ecf 23%, #112a226b 59%, #10261e15 100%),
    url("/assets/cc-storefront-arrival.webp");
  background-position: center, 48% 54%;
  background-size: cover;
}

.login-intro::after {
  content: none;
}

.login-intro .wordmark {
  width: clamp(175px, 22vw, 270px);
  padding: 10px 13px;
  margin-bottom: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--shell-paper);
  box-shadow: 0 8px 30px #10261e30;
}

.login-intro-copy {
  margin-top: 26px;
}

.login-intro-copy::before {
  display: block;
  content: "";
  width: 42px;
  height: 2px;
  margin-bottom: 13px;
  background: var(--shell-brass);
}

.login-intro .eyebrow {
  margin-bottom: 10px;
  color: #c6e4ce;
  font-size: .75rem;
  letter-spacing: .14em;
}

.login-intro h1 {
  max-width: 14ch;
  margin: 0;
  color: var(--shell-paper);
  font-family: var(--display-font, Georgia, Cambria, "Times New Roman", serif);
  font-size: clamp(2.85rem, 6vw, 6.25rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: .98;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.login-source-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e1ede2;
  font-size: .85rem;
}

.login-source-note .portal-icon {
  width: 16px;
  height: 16px;
  color: #b9dcc5;
}

.login-card {
  background: radial-gradient(ellipse at 100% 0%, #eae6d6, transparent 62%), var(--ivory);
}

.login-form-wrap {
  width: min(100%, 420px);
  padding: clamp(26px, 3.8vw, 48px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--shell-paper);
  box-shadow: 0 22px 60px -37px #2b36266b, 0 3px 12px -5px #2c342332;
}

.login-lock {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border: 1px solid #d0ddcd;
  border-radius: 8px;
  color: var(--shell-green);
  background: #edf2e8;
}

.login-lock .portal-icon {
  width: 21px;
  height: 21px;
}

.login-form-wrap h2 {
  color: var(--forest);
  font-family: var(--display-font, Georgia, Cambria, "Times New Roman", serif);
  font-size: clamp(2rem, 3.2vw, 3.15rem);
  font-weight: 600;
  letter-spacing: -.035em;
}

.login-form-wrap label {
  color: var(--ink);
  font-size: .87rem;
  font-weight: 650;
}

.login-form-wrap input {
  padding: 10px 12px;
  border: 1px solid #a7ac99;
  border-radius: 6px;
  color: var(--ink);
  background: #fffefa;
}

.login-form-wrap form {
  margin-top: 23px;
}

.login-form-wrap .button.primary {
  justify-content: space-between;
  padding: 11px 15px;
  border-radius: 6px;
  color: var(--shell-paper);
  background: var(--shell-green);
}

.login-form-wrap .button.primary:hover {
  background: var(--forest);
}

.login-form-wrap :focus-visible {
  outline: 2px solid #2e6c53;
  outline-offset: 2px;
}

@media (min-width: 961px) and (max-width: 1120px) {
  .portal-account strong {
    display: none;
  }
}

@media (max-width: 960px) {
  :root {
    --portal-header-height: 62px;
  }

  .main-shell {
    padding-bottom: calc(var(--portal-dock-height) + env(safe-area-inset-bottom, 0px));
  }

  .portal-nav {
    position: fixed;
    inset: auto 0 0;
    min-height: calc(var(--portal-dock-height) + env(safe-area-inset-bottom, 0px));
    justify-content: center;
    gap: 3px;
    padding: 4px max(7px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(7px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #b4c9b860;
    background: var(--forest);
    box-shadow: 0 -4px 18px #132b2224;
  }

  .portal-nav .nav-link {
    flex: 1 1 0;
    flex-direction: column;
    max-width: 132px;
    min-width: 0;
    min-height: 50px;
    gap: 3px;
    padding: 4px 2px 7px;
    line-height: 1.05;
    font-size: .71rem;
  }

  .topbar {
    padding: 8px clamp(10px, 3vw, 28px);
  }

  .topbar-brand {
    width: clamp(105px, 24vw, 150px);
    padding: 6px;
  }

  .portal-account strong {
    display: none;
  }
}

@media (max-width: 700px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .login-intro {
    min-height: 206px;
    gap: 10px;
    padding: 18px clamp(18px, 6vw, 42px);
    background-image: linear-gradient(0deg, #10261ef6 0%, #10261ed1 34%, #112a2257 78%, #10261e21 100%),
      url("/assets/cc-storefront-arrival-mobile.webp");
    background-position: center, 50% 56%;
  }

  .login-intro .wordmark {
    width: clamp(150px, 40vw, 190px);
    padding: 7px 9px;
  }

  .login-intro-copy {
    margin-top: 4px;
  }

  .login-intro-copy::before {
    width: 28px;
    margin-bottom: 8px;
  }

  .login-intro .eyebrow {
    margin-bottom: 5px;
    font-size: .66rem;
  }

  .login-intro h1 {
    font-size: clamp(2.1rem, 8vw, 3.65rem);
  }

  .login-source-note {
    font-size: .76rem;
  }

  .login-card {
    align-items: start;
    padding: 22px clamp(13px, 5vw, 32px);
  }

  .login-form-wrap {
    width: min(100%, 470px);
    padding: clamp(21px, 6vw, 33px);
  }

  .login-lock {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
  }
}

@media (max-width: 380px) {
  .topbar-brand {
    width: 96px;
  }

  .portal-account {
    display: none;
  }

  .portal-search input {
    padding-left: 36px;
  }

  .portal-search button {
    width: 33px;
  }
}
