/* Proc-Plat — lab workshop theme */
:root {
  --ink: #14212b;
  --ink-muted: #5b6b76;
  --paper: #f3f5f7;
  --surface: #ffffff;
  --line: #d8dee4;
  --line-strong: #b8c2cc;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-soft: #ccfbf1;
  --accent-ink: #115e59;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --ok: #047857;
  --ok-soft: #d1fae5;
  --sidebar-w: 14.5rem;
  --header-h: 3.25rem;
  --radius: 0.625rem;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body.app-shell {
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.font-heading {
  font-family: var(--font-display);
}

/* Shell */
.shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.shell-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.shell-brand {
  flex-shrink: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  gap: 0.65rem;
}

.shell-brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
  background: linear-gradient(145deg, var(--accent) 0%, #134e4a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.shell-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.shell-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.shell-nav-label {
  margin: 0.65rem 0.5rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.shell-nav-label:first-child {
  margin-top: 0.15rem;
}

.year-switcher {
  margin: 0 0.35rem 0.5rem;
}

.year-select {
  width: 100%;
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6b76' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 1.75rem;
}

.year-select:hover,
.year-select:focus {
  border-color: var(--accent);
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.nav-link:hover {
  background: var(--paper);
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.nav-link.is-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.shell-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}

.shell-top {
  flex-shrink: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.shell-top h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(20, 33, 43, 0.14);
  animation: toast-in 180ms ease-out;
}

.toast.is-leaving {
  animation: toast-out 200ms ease-in forwards;
}

.toast-ok {
  background: var(--ok-soft);
  border-color: #a7f3d0;
  color: var(--ok);
}
.toast-fail {
  background: var(--danger-soft);
  border-color: #fecaca;
  color: var(--danger);
}
.toast-info {
  background: var(--warn-soft);
  border-color: #fde68a;
  color: var(--warn);
}

.toast-dismiss {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
}

.toast-dismiss:hover {
  opacity: 1;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-0.4rem) translateX(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-0.25rem) translateX(0.5rem);
  }
}

.shell-pane {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.shell-pane-inner {
  padding: 1rem 1.1rem 1.5rem;
  max-width: 72rem;
}

.shell-pane-inner.is-wide {
  max-width: none;
}

.shell-pane-inner.is-split {
  max-width: none;
  height: 100%;
  padding: 0;
  display: flex;
  min-height: 0;
}

.shell-pane:has(.is-split) {
  overflow: hidden;
}

.workspace-split {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.workspace-split.is-ratio-2-1 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
}

.workspace-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.1rem 5rem;
}

.detail-sidenav {
  width: min(22rem, 100%);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  min-height: 0;
}

.workspace-split.is-ratio-2-1 .detail-sidenav {
  width: auto;
}

.detail-sidenav-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.detail-sidenav-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
}

.detail-sidenav-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.detail-sidenav-empty {
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 0.25rem 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr));
  gap: 0.75rem;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 7.5rem;
}

.panel-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 14px rgba(20, 33, 43, 0.06);
}

.panel-card.is-selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 48%);
  box-shadow: 0 0 0 1px var(--accent);
}

.panel-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.panel-card-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.4;
  flex: 1;
}

.lot-card {
  gap: 0.55rem;
  min-height: 0;
}

.lot-card-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.8rem;
  line-height: 1.35;
}

.lot-card-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.lot-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 0.1rem;
}

.lot-card-value {
  color: var(--ink);
  font-weight: 500;
}

.lot-card-budget {
  font-weight: 700;
  color: var(--accent-ink);
}

.workspace-main-relative {
  position: relative;
}

.fab {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
  transition: background 140ms ease, transform 140ms ease;
}

.fab:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Child screens: on narrow viewports, show master OR detail — not stacked panes */
.child-screen-back,
.child-screen-open {
  display: none;
}

.desktop-only-close {
  display: inline-flex;
}

@media (max-width: 900px) {
  .workspace-split:not(.is-child-screens) {
    flex-direction: column;
  }
  .workspace-split.is-ratio-2-1:not(.is-child-screens) {
    display: flex;
    flex-direction: column;
  }
  .workspace-split:not(.is-child-screens) > .detail-sidenav {
    width: 100%;
    max-height: 45%;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .workspace-split.is-ratio-2-1:not(.is-child-screens) .detail-sidenav {
    width: 100%;
  }

  .workspace-split.is-child-screens {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    min-height: 0;
  }
  .workspace-split.is-child-screens > .workspace-main,
  .workspace-split.is-child-screens > .detail-sidenav {
    width: 100%;
    max-height: none;
    flex: 1;
    min-height: 0;
    border-left: none;
    border-top: none;
  }
  .workspace-split.is-child-screens:not(.is-detail-open) > .detail-sidenav {
    display: none;
  }
  .workspace-split.is-child-screens.is-detail-open > .workspace-main {
    display: none;
  }
  .workspace-split.is-child-screens.is-detail-open > .detail-sidenav {
    display: flex;
  }

  .child-screen-back,
  .child-screen-open {
    display: inline-flex;
  }
  .desktop-only-close {
    display: none !important;
  }
}

/* Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 650;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-secondary:hover {
  background: var(--paper);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: #fecaca;
  color: var(--danger);
}
.btn-danger:hover {
  background: #fecaca;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
}
.btn-ghost:hover {
  background: var(--paper);
  color: var(--ink);
}

.btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.preview-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-dl > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.preview-dl dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.preview-dl dd {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word;
}

.detail-sidenav-body.is-pdf-preview {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.field {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  font-family: var(--font-body);
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-pending {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.status-switch-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 140ms ease;
}

.status-switch:has(.status-switch-input:not(:checked)) .status-switch-label.is-pending,
.status-switch:has(.status-switch-input:checked) .status-switch-label.is-confirmed {
  color: var(--ink);
}

.status-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.status-switch-track {
  position: relative;
  width: 2.35rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  transition: background 140ms ease, border-color 140ms ease;
  flex-shrink: 0;
}

.status-switch-track::after {
  content: "";
  position: absolute;
  top: 0.1rem;
  left: 0.1rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(20, 33, 43, 0.25);
  transition: transform 140ms ease;
}

.status-switch-input:checked + .status-switch-track {
  background: var(--ok-soft);
  border-color: #a7f3d0;
}

.status-switch-input:checked + .status-switch-track::after {
  transform: translateX(1.05rem);
}

.status-switch-input:focus-visible + .status-switch-track {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--paper);
  text-align: left;
}
.data-table th.is-center,
.data-table td.is-center {
  text-align: center;
}
.data-table tbody tr {
  background: var(--surface);
  transition: background 140ms ease;
}
.data-table tbody tr:hover {
  background: var(--accent-soft);
}
.data-table tbody tr.is-selected-row {
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 70%);
  box-shadow: inset 3px 0 0 var(--accent);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tab {
  padding: 0.55rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  flex-shrink: 0;
}
.tab.is-active {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}

/* Tables: scroll pane + sticky lead column on narrow screens */
.table-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table-scroll .data-table th:first-child,
.table-scroll .data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
.table-scroll .data-table thead th:first-child {
  z-index: 2;
  background: var(--paper);
}
.table-scroll .data-table tbody tr:hover td:first-child {
  background: var(--accent-soft);
}
.table-scroll .data-table tbody tr.is-selected-row td:first-child {
  background: #f0fdfa;
}

/* Mobile card lists (replace wide tables on small screens) */
.mobile-card-list {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
}

.mobile-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
}

.mobile-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 48%);
}

.mobile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.mobile-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-width: 0;
}

.mobile-card-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.mobile-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  font-size: 0.8rem;
}

.mobile-card-row strong {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

/* Compact inline stats strip */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-strip-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.15rem 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.stat-strip-item + .stat-strip-item {
  border-left: 1px solid var(--line);
}

.stat-strip-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}

.stat-strip-item.is-ok .stat-strip-value { color: var(--ok); }
.stat-strip-item.is-pending .stat-strip-value { color: var(--warn); }
.stat-strip-item.is-danger .stat-strip-value { color: var(--danger); }

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.hide-desktop {
  display: none !important;
}

@media (max-width: 700px) {
  .hide-mobile {
    display: none !important;
  }
  .hide-desktop {
    display: revert !important;
  }
  .mobile-card-list {
    display: flex !important;
  }
  .shell-pane-inner {
    padding: 0.85rem 0.85rem 1.25rem;
  }
  .shell-top {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }
  .shell-top h1 {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .toolbar {
    gap: 0.45rem 0.65rem;
    padding: 0.55rem 0.7rem;
  }
  .data-table th,
  .data-table td {
    padding: 0.65rem 0.75rem;
  }
  .toast-stack {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
  .btn-row-mobile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .btn-row-mobile .btn {
    width: 100%;
  }
}

/* Login landing */
.login-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  overflow: hidden;
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  color: #ecfeff;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(45, 212, 191, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(15, 118, 110, 0.5), transparent 50%),
    linear-gradient(160deg, #0f3d3a 0%, #14212b 45%, #0b1c24 100%);
  overflow: hidden;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
  animation: gridDrift 28s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to { background-position: 48px 48px; }
}

.login-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.login-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 1rem;
}

.login-lede {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(204, 251, 241, 0.88);
  max-width: 24rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--paper);
}

.login-card {
  width: 100%;
  max-width: 22rem;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.login-card p {
  margin: 0 0 1.4rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.mobile-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .login-stage {
    grid-template-columns: 1fr;
  }
  .login-hero {
    min-height: 38vh;
    padding: 2rem 1.5rem;
  }
  .shell-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: 8px 0 24px rgba(20, 33, 43, 0.12);
  }
  .shell-sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 33, 43, 0.4);
    z-index: 30;
  }
  .mobile-toggle {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-hero::before {
    animation: none;
  }
  .nav-link,
  .btn {
    transition: none;
  }
}
