.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--canvas);
}

.login-entry {
  --canvas: #101715;
  --surface: #18211f;
  --surface-subtle: #1d2825;
  --input-bg: #131b19;
  --ink: #edf2f0;
  --ink-strong: #ffffff;
  --muted: #9eaca7;
  --muted-strong: #c5cfcb;
  --line: #33423d;
  --line-strong: #485a54;
  --primary: #59ad9e;
  --primary-strong: #70c1b2;
  --primary-soft: #1c3530;
  grid-template-columns: minmax(520px, 3fr) minmax(480px, 2fr);
}

.login-entry .login-form-area {
  padding: clamp(32px, 3.4vw, 52px);
}

.login-context {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(34px, 4.2vw, 64px);
  background: var(--sidebar);
  color: var(--sidebar-ink);
}

.login-context::before {
  content: "";
  position: absolute;
  right: -150px;
  bottom: -220px;
  width: 480px;
  height: 480px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 50%;
}

.login-context::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 92px;
  background: var(--brand);
  transform: translateY(-50%);
}

.login-context-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-context-logo {
  display: grid;
  place-items: center;
  width: 64px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #fff;
}

.login-context-logo img {
  width: 56px;
  height: auto;
}

.login-context-brand strong,
.login-context-brand span {
  display: block;
}

.login-context-brand strong {
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.login-context-brand span {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.login-context-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.login-context-copy h1 {
  max-width: 560px;
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 4.2vw, 62px);
  font-weight: 720;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.login-context-kicker {
  display: block;
  margin-bottom: 18px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-context-copy p {
  max-width: 470px;
  margin: 22px 0 0;
  color: var(--sidebar-muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-top: 34px;
}

.login-flow span {
  color: #d9e0dd;
  font-size: 12px;
  font-weight: 600;
}

.login-flow i {
  width: 26px;
  height: 1px;
  background: rgb(255 255 255 / 20%);
}

.login-motion {
  position: absolute;
  right: clamp(42px, 6vw, 90px);
  bottom: clamp(64px, 11vh, 120px);
  width: 126px;
  height: 126px;
  opacity: 0.68;
}

.login-motion span {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 2px solid var(--brand);
  transform: rotate(45deg);
  animation: login-mark-drift 6s ease-in-out infinite;
}

.login-motion span:nth-child(1) {
  top: 35px;
  left: 4px;
}

.login-motion span:nth-child(2) {
  top: 35px;
  left: 40px;
  animation-delay: -2s;
}

.login-motion span:nth-child(3) {
  top: 35px;
  left: 76px;
  animation-delay: -4s;
}

.login-form-area {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(32px, 7vw, 96px);
  background: var(--canvas);
}

.login-card {
  width: min(420px, 100%);
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--surface);
  animation: enter var(--duration-standard) var(--ease-standard);
}

.login-access {
  width: min(440px, 100%);
  padding: clamp(28px, 4vw, 40px);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 30px 90px rgb(0 0 0 / 22%);
  animation: login-card-enter 420ms var(--ease-standard) both;
}

.login-mobile-brand {
  display: none;
}

.login-title {
  margin-bottom: var(--space-8);
}

.login-access .login-title {
  margin-bottom: 30px;
}

.login-title h1 {
  margin-bottom: var(--space-2);
  font-size: 30px;
}

.login-access .login-title h1 {
  margin-bottom: 7px;
  font-size: clamp(28px, 2.7vw, 36px);
  letter-spacing: -0.035em;
}

.login-access .login-title > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.login-title .eyebrow {
  margin-bottom: var(--space-3);
}

@keyframes login-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-mark-drift {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }
  50% {
    transform: translateY(-7px) rotate(45deg);
  }
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 66px;
  height: 44px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #fff;
}

.brand-mark img {
  display: block;
  width: 58px;
  height: auto;
}

.brand-mark-login {
  width: 82px;
  height: 56px;
  margin-bottom: var(--space-6);
  border: 1px solid var(--line);
}

.brand-mark-login img {
  width: 70px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--sidebar-line);
  background: var(--sidebar);
  color: var(--sidebar-ink);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 79px;
  padding: var(--space-4) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--sidebar-line);
  background: transparent;
  color: var(--sidebar-ink);
  text-align: left;
}

.brand-lockup:hover {
  background: rgb(255 255 255 / 3%);
}

.brand-lockup strong,
.brand-lockup small,
.user-chip strong,
.user-chip small {
  display: block;
}

.brand-lockup strong {
  font-size: 14px;
}

.brand-lockup small {
  margin-top: 1px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.sidebar-label {
  margin: var(--space-6) var(--space-4) var(--space-2);
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topnav {
  display: grid;
  gap: 2px;
  padding: 0 var(--space-2);
}

.topnav button {
  position: relative;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition:
    background var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.topnav button::before {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 5px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}

.topnav button:hover {
  background: rgb(255 255 255 / 4%);
  color: var(--sidebar-ink);
}

.topnav button.active {
  border-color: rgb(255 255 255 / 5%);
  background: var(--sidebar-active);
  color: #fff;
}

.topnav button.active::before {
  background: var(--brand);
}

.sidebar-foot {
  display: grid;
  gap: var(--space-3);
  margin-top: auto;
  padding: var(--space-4);
  border-top: 1px solid var(--sidebar-line);
}

.user-chip {
  min-width: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--sidebar-line);
}

.user-chip strong {
  overflow: hidden;
  color: var(--sidebar-ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 0 clamp(18px, 2.5vw, 36px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.topbar-context strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-context span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-context span::before {
  content: "/";
  margin-right: var(--space-3);
  color: var(--line-strong);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.theme-toggle {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.content {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: clamp(22px, 3vw, 42px) clamp(18px, 3vw, 42px) 56px;
}

.page-head,
.section-title,
.status-strip,
.focus-topline,
.drawer-head {
  display: flex;
  align-items: center;
}

.page-head {
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.page-head p {
  margin-bottom: var(--space-1);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-head h1 {
  margin-bottom: var(--space-1);
}

.page-head span,
.section-title span {
  color: var(--muted);
}

.section-title {
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-title h2,
.section-title h3 {
  margin: 0;
}

.section-title span {
  font-size: 12px;
}

.hero-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-8);
  align-items: end;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 760px;
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.hero-status {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
  max-width: 380px;
  text-align: right;
}

.summary-ribbon,
.purchase-stats,
.queue-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  margin-bottom: var(--space-8);
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.requester-hero + .summary-ribbon,
.queue-board {
  grid-template-columns: repeat(4, minmax(100px, 1fr));
}

.main-board-grid {
  display: grid;
  grid-template-columns: 292px minmax(420px, 1fr) 280px;
  gap: var(--space-5);
  align-items: start;
}

.single-board {
  max-width: 1120px;
}

.board-list,
.board-context {
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-5));
}

.board-context {
  display: grid;
  gap: var(--space-4);
}

.board-focus {
  min-width: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: var(--space-5);
  align-items: start;
}

.wizard {
  width: 100%;
  max-width: 1100px;
  display: grid;
}

.two-cols,
.three-cols,
.four-cols {
  display: grid;
  gap: var(--space-4);
}

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

.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inline-form {
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) auto;
  align-items: end;
}

@media (max-width: 1260px) {
  .main-board-grid {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .board-context {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-ribbon,
  .purchase-stats,
  .queue-board {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 206px;
  }

  .main-board-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .board-list,
  .board-context {
    position: static;
  }

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

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

@media (max-width: 760px) {
  .login-page {
    display: grid;
  }

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

  .login-context {
    min-height: 176px;
    padding: 22px;
  }

  .login-context::before {
    right: -210px;
    bottom: -300px;
  }

  .login-context::after {
    top: auto;
    bottom: 0;
    width: 5px;
    height: 58px;
    transform: none;
  }

  .login-context-brand {
    align-items: center;
  }

  .login-context-logo {
    width: 57px;
    height: 39px;
  }

  .login-context-logo img {
    width: 50px;
  }

  .login-context-copy {
    margin-top: 28px;
  }

  .login-context-copy h1 {
    max-width: 340px;
    font-size: 28px;
    letter-spacing: -0.035em;
  }

  .login-context-copy > p,
  .login-flow {
    display: none;
  }

  .login-motion {
    right: 22px;
    bottom: 5px;
    transform: scale(0.58);
    transform-origin: right bottom;
  }

  .login-form-area,
  .login-entry .login-form-area {
    min-height: calc(100vh - 176px);
    place-items: start center;
    padding: 32px 18px 40px;
  }

  .login-access {
    padding: 26px 22px;
  }

  .brand-mark-login {
    display: grid;
  }

  .app-frame {
    display: block;
  }

  .sidebar {
    position: sticky;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-line);
  }

  .brand-lockup {
    min-height: 58px;
    padding: 8px 14px;
  }

  .brand-mark {
    width: 54px;
    height: 36px;
  }

  .brand-mark img {
    width: 48px;
  }

  .sidebar-label,
  .sidebar-foot {
    display: none;
  }

  .topnav {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding: 6px 10px 9px;
    scrollbar-width: none;
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .topnav button {
    width: auto;
    min-width: max-content;
    min-height: 34px;
    padding: 6px 10px;
    text-align: center;
  }

  .topnav button::before {
    top: auto;
    right: 10px;
    bottom: 1px;
    left: 10px;
    width: auto;
    height: 2px;
  }

  .topbar {
    position: static;
    min-height: 48px;
    padding: 7px 14px;
  }

  .topbar-context span {
    display: none;
  }

  .content {
    padding: 24px 14px 42px;
  }

  .page-head,
  .hero-workspace {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .page-head {
    display: grid;
    margin-bottom: var(--space-6);
  }

  .hero-workspace {
    gap: var(--space-5);
  }

  .hero-status {
    justify-items: start;
    text-align: left;
  }

  .summary-ribbon,
  .purchase-stats,
  .queue-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .requester-hero + .summary-ribbon,
  .queue-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-context,
  .two-cols,
  .three-cols,
  .four-cols,
  .inline-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .topbar-context {
    display: none;
  }

  .topbar {
    justify-content: flex-end;
  }
}
