@font-face {
  font-family: Manrope;
  src: url("/brand/fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/brand/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/brand/fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: var(--wsg-font-body);
  color: var(--wsg-ink);
  background: var(--wsg-background);
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.5;
  --primary: var(--wsg-primary);
  --muted: var(--wsg-body);
  --border: #dce0f0;
  --tint: #eef0fd;
  --success: #166a50;
  --success-bg: #e8f7f3;
  --danger: #b42318;
  --danger-bg: #fff3f1;
  --surface: rgba(255, 255, 255, 0.92);
  --shadow: 0 16px 40px rgba(20, 26, 51, 0.08);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--wsg-font-display);
  color: var(--wsg-ink);
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 24px;
  text-align: center;
  color: var(--muted);
}
.brand-symbol {
  font-size: 48px;
  color: var(--primary);
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #f5f7ff;
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
@media (min-width: 751px) {
  .sidebar > .brand,
  .sidebar > .side-bottom {
    flex-shrink: 0;
  }
  .sidebar > nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
@supports (backdrop-filter: blur(18px)) {
  .sidebar,
  .topbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(var(--wsg-glass-blur));
  }
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 16px 24px;
  color: var(--wsg-ink);
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 100px;
  height: auto;
  display: block;
}
.brand strong {
  font-family: var(--wsg-font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.brand small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.nav-label {
  font-family: var(--wsg-font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 16px 12px 8px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 12px;
  margin: 4px 0;
  text-align: left;
  border-radius: var(--wsg-radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.nav-btn:hover {
  background: var(--tint);
  color: var(--wsg-ink);
}
.nav-btn.active {
  color: var(--primary);
  background: #e9ecfd;
  box-shadow: inset 3px 0 var(--primary);
  font-weight: 600;
}
.side-bottom {
  margin-top: auto;
}
.local-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 12px 16px;
  font-size: 12px;
  color: var(--muted);
}
.dot {
  width: 6px;
  height: 6px;
  background: var(--wsg-mint);
  border-radius: 50%;
  display: inline-block;
}
.profile {
  border-top: 1px solid var(--border);
  padding: 16px 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.profile-copy {
  min-width: 0;
  flex: 1;
}
.profile-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-copy small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.profile button {
  background: transparent;
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  min-width: 36px;
  min-height: 36px;
}
.profile button:hover {
  background: var(--tint);
  color: var(--primary);
}
.mobile-menu {
  display: none;
}
.main {
  min-width: 0;
}
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: #f5f7ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 16px;
}
.breadcrumbs {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumbs b {
  color: var(--wsg-ink);
  font-weight: 500;
}
.breadcrumbs span {
  padding: 0 12px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.company-switch {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 8px 28px 8px 12px;
  max-width: 240px;
  color: var(--wsg-ink);
  font-size: 12px;
}
.top-date {
  color: var(--muted);
  font-family: var(--wsg-font-mono);
  font-size: 11px;
}
.content {
  padding: 24px 32px 48px;
  width: 100%;
  max-width: 1800px;
  margin: auto;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.eyebrow {
  font-family: var(--wsg-font-mono);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.page-head h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.25;
}
.page-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 40px;
  border-radius: var(--wsg-radius-control);
  font-size: 12px;
  font-weight: 600;
  background: white;
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.btn:hover {
  background: var(--tint);
  color: var(--primary);
}
.btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 91, 213, 0.14);
}
.btn.primary:hover {
  background: #414cb8;
}
.btn.danger {
  color: var(--danger);
  border-color: #edc8c2;
  background: var(--danger-bg);
}
.btn.sm {
  padding: 6px 12px;
  min-height: 32px;
  font-size: 12px;
}
.icon-btn {
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
}
.icon-btn:hover {
  background: var(--tint);
  color: var(--primary);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--wsg-radius-panel);
  padding: 16px;
  min-width: 0;
}
.stat:first-child {
  background: #eef0fd;
  border-color: #d8ddfc;
}
.stat-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  gap: 8px;
}
.stat-label svg {
  color: var(--primary);
}
.stat-value {
  font-family: var(--wsg-font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.8px;
  color: var(--wsg-ink);
  margin: 12px 0 8px;
  font-variant-numeric: tabular-nums;
}
.stat:first-child .stat-value {
  color: var(--primary);
}
.stat-sub {
  font-size: 11px;
  color: var(--muted);
}
.stat-chip {
  display: inline-block;
  color: var(--primary);
  font-size: 10px;
  background: #e1e5fc;
  border-radius: 4px;
  padding: 2px 4px;
  margin-right: 4px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 24px;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--wsg-radius-panel);
  min-width: 0;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
}
.panel h2 {
  font-size: 15px;
  font-weight: 700;
}
.panel-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.subtle-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  padding: 4px;
  min-height: 32px;
}
.subtle-link:hover {
  text-decoration: underline;
}
.category-chart {
  padding: 0 24px 24px;
}
.category-row {
  display: grid;
  grid-template-columns: minmax(100px, 176px) minmax(24px, 1fr) 24px;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}
.bar-track {
  height: 8px;
  background: var(--tint);
  border-radius: 4px;
  overflow: hidden;
}
.bar-track progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  display: block;
  color: var(--primary);
}
.bar-track progress::-webkit-progress-bar {
  background: var(--tint);
}
.bar-track progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}
.bar-track progress::-moz-progress-bar {
  background: var(--primary);
}
.category-row b {
  text-align: right;
  color: var(--wsg-ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.flow-note {
  padding: 16px 24px;
  background: #f7f8ff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.flow-note svg {
  flex: none;
  color: var(--primary);
}
.activity {
  padding: 0 24px 16px;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.activity-item:first-child {
  border-top: 0;
}
.activity-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--primary);
  flex: none;
}
.activity-icon svg {
  width: 16px;
}
.activity-item p {
  font-size: 12px;
  color: var(--wsg-ink);
}
.activity-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.wide {
  grid-column: 1/-1;
}
.table-wrap {
  width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
  background: white;
}
th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  background: #f7f8ff;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 8px 16px;
  height: 48px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: white;
}
tr:last-child td {
  border-bottom: 0;
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover td {
  background: #f7f8ff;
}
.clickable-row:focus-visible {
  outline-offset: -3px;
}
.product-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 420px;
  min-width: 300px;
}
.product-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}
.product-icon.service {
  background: #e8f7f3;
  color: var(--success);
}
.product-cell strong {
  display: block;
  white-space: normal;
  line-height: 1.4;
  color: var(--wsg-ink);
  font-size: 13px;
  font-weight: 500;
}
.product-cell small {
  display: block;
  color: var(--muted);
  font-family: var(--wsg-font-mono);
  font-size: 10px;
  margin-top: 2px;
}
.money,
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.money {
  font-weight: 500;
  color: var(--wsg-ink);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--tint);
}
.tag.goods {
  color: var(--primary);
  background: var(--tint);
}
.tag.service {
  color: var(--success);
  background: var(--success-bg);
}
.tag.archived {
  color: var(--muted);
  background: #edf0f6;
}
.tag.active {
  color: var(--success);
  background: var(--success-bg);
}
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: white;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}
.search-box svg {
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--muted);
  width: 16px;
}
.search-box input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  min-height: 40px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--wsg-ink);
  background: white;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.toolbar select {
  padding: 10px 24px 10px 12px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--wsg-ink);
  background: white;
  font-size: 12px;
  max-width: 220px;
}
.table-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: white;
}
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-icon {
  margin-bottom: 16px;
  color: var(--primary);
}
.empty h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.empty p {
  font-size: 13px;
  line-height: 1.5;
}
.empty .btn {
  margin-top: 16px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.company-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.company-mark {
  width: 32px;
  height: 32px;
  background: var(--tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.company-card h2 {
  font-size: 18px;
}
.company-card small {
  color: var(--muted);
  font-size: 12px;
}
.company-details {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}
.company-details b {
  display: block;
  margin-top: 4px;
  color: var(--wsg-ink);
  font-weight: 500;
}
.company-card .card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.code {
  font-family: var(--wsg-font-mono);
  font-size: 11px;
  color: var(--muted);
}
.log-action {
  color: var(--wsg-ink);
  font-weight: 500;
}
.audit-before {
  background: #f7f8ff;
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-family: var(--wsg-font-mono);
  font-size: 12px;
  max-height: 400px;
  overflow: auto;
}
.notice {
  background: #eef0fd;
  color: var(--muted);
  padding: 16px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.error-panel {
  padding: 32px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #edc8c2;
  border-radius: 16px;
}
.error-panel h2 {
  color: var(--danger);
}
.error-panel p {
  margin-top: 12px;
  line-height: 1.5;
}
.error-panel button {
  margin-top: 24px;
}
dialog {
  border: 1px solid var(--border);
  border-radius: var(--wsg-radius-panel);
  padding: 0;
  max-height: calc(100dvh - 32px);
  max-width: 720px;
  width: calc(100% - 32px);
  color: var(--wsg-ink);
  background: white;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(20, 26, 51, 0.35);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
.dialog-head h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.dialog-head .eyebrow {
  margin-bottom: 4px;
}
.dialog-body {
  padding: 24px;
  max-height: 64dvh;
  overflow: auto;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.field {
  min-width: 0;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--wsg-ink);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 12px;
  color: var(--wsg-ink);
  font-size: 13px;
}
.field textarea {
  height: 96px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
}
.field small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.field .field-error {
  color: var(--danger);
}
.form-error {
  color: var(--danger);
  background: var(--danger-bg);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}
.form-error:empty {
  display: none;
}
.dialog-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f7f8ff;
}
.dialog-foot .actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.dialog-foot small,
.version-note {
  color: var(--muted);
  font-size: 11px;
}
.version-note {
  font-family: var(--wsg-font-mono);
  margin-bottom: 16px;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.check-field input {
  accent-color: var(--primary);
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--wsg-ink);
  color: white;
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 16px 24px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 420px;
  z-index: 200;
}
.toast.error {
  background: var(--danger);
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) 1.2fr;
}
.login-art {
  background: linear-gradient(145deg, #eef0fd, #f7f8ff 65%, #e8f7f3);
  color: var(--wsg-ink);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
}
.login-art .brand {
  padding: 16px;
}
.login-title {
  position: relative;
}
.login-title h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -1.2px;
  font-weight: 800;
  max-width: 420px;
}
.login-title p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 24px;
  max-width: 360px;
}
.login-art footer {
  color: var(--muted);
  font-family: var(--wsg-font-mono);
  font-size: 12px;
}
.login-main {
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  width: 100%;
  max-width: 440px;
}
.login-box h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.login-box > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  margin-bottom: 24px;
}
.profile-choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}
.profile-choice:hover {
  border-color: var(--primary);
  background: #f7f8ff;
}
.profile-choice strong {
  display: block;
  color: var(--wsg-ink);
  font-size: 13px;
  font-weight: 600;
}
.profile-choice small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.profile-choice .arrow {
  margin-left: auto;
  color: var(--primary);
}
.login-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.page-loading {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }
  .top-date {
    display: none;
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 16px 12px;
  }
  .stat-chip {
    display: none;
  }
  .login-art,
  .login-main {
    padding: 32px;
  }
}
@media (max-width: 750px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 8px 16px;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    flex-direction: row;
    align-items: center;
    padding: 12px 0;
    gap: 16px;
  }
  .brand img {
    width: 88px;
    height: auto;
  }
  .brand strong {
    font-size: 20px;
  }
  .brand small,
  .nav-label,
  .side-bottom {
    display: none;
  }
  .mobile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    color: var(--primary);
  }
  .sidebar nav {
    display: none;
    width: 100%;
  }
  .sidebar.menu-open nav,
  .sidebar.menu-open .side-bottom {
    display: block;
    width: 100%;
  }
  .sidebar.menu-open .local-badge {
    display: none;
  }
  .sidebar.menu-open .profile {
    padding: 12px 0;
  }
  .nav-btn {
    min-height: 44px;
  }
  .topbar {
    min-height: 60px;
    height: auto;
    padding: 8px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .breadcrumbs {
    font-size: 11px;
  }
  .breadcrumbs span {
    padding: 0 8px;
  }
  .company-switch {
    max-width: 100%;
    min-height: 44px;
    font-size: 12px;
  }
  .content {
    padding: 24px 16px;
  }
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
  }
  .page-head h1 {
    font-size: 26px;
  }
  .page-head p {
    font-size: 12px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .stat {
    padding: 16px 12px;
  }
  .stat-label {
    font-size: 11px;
  }
  .stat-value {
    font-size: 32px;
  }
  .stat-sub {
    font-size: 11px;
  }
  .dashboard-grid {
    gap: 24px;
  }
  .wide {
    grid-column: auto;
  }
  .panel-head {
    padding: 16px;
    flex-wrap: wrap;
  }
  .panel h2 {
    font-size: 14px;
  }
  .panel-sub {
    font-size: 11px;
  }
  .category-chart {
    padding: 0 16px 24px;
  }
  .category-row {
    grid-template-columns: minmax(90px, 140px) minmax(24px, 1fr) 20px;
    gap: 8px;
    font-size: 11px;
  }
  .activity {
    padding: 0 16px 16px;
  }
  .flow-note {
    padding: 16px;
    font-size: 11px;
  }
  .toolbar {
    padding: 16px;
    gap: 8px;
  }
  .search-box {
    min-width: 100%;
    max-width: none;
  }
  .toolbar select {
    min-width: 100%;
    max-width: none;
    flex: 1;
  }
  .search-box input,
  .toolbar select {
    min-height: 44px;
  }
  .btn,
  .btn.sm,
  .icon-btn,
  .subtle-link,
  .profile button {
    min-height: 44px;
    min-width: 44px;
  }
  .table-bottom {
    padding: 16px;
    flex-wrap: wrap;
  }
  .product-cell {
    min-width: 240px;
    max-width: 320px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .dialog-head,
  .dialog-body {
    padding: 16px;
  }
  .dialog-foot {
    padding: 16px;
    flex-wrap: wrap;
  }
  .dialog-foot small {
    display: none;
  }
  .dialog-foot .actions {
    margin-left: 0;
    flex: 1;
    justify-content: flex-end;
  }
  .dialog-foot .btn {
    padding: 8px;
    font-size: 11px;
  }
  .login {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-art {
    padding: 16px;
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .login-art .brand {
    padding: 16px;
  }
  .login-title {
    padding: 16px;
  }
  .login-title h1 {
    font-size: 28px;
  }
  .login-title p,
  .login-art footer {
    display: none;
  }
  .login-main {
    padding: 24px 16px;
    align-items: start;
  }
  .login-box h2 {
    font-size: 26px;
  }
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
    padding: 16px;
  }
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* WSG shared operational registers and document editors. */
.stat-button {
  text-align: left;
  width: 100%;
}
.stat-button:hover {
  border-color: var(--primary);
}
.stat-button .stat-value,
.stat-button .stat-sub {
  display: block;
}
.stat-money {
  font-size: clamp(20px, 1.7vw, 28px);
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}
.operational-stats .stat {
  min-height: 160px;
}
.module-actions,
.secondary-actions,
.detail-meta,
.detail-actions,
.detail-links,
.import-counts {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.module-actions {
  justify-content: space-between;
  margin-bottom: 16px;
}
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #eef0fd;
  border-radius: 12px;
}
.segmented .btn {
  border-color: transparent;
  background: transparent;
}
.segmented .btn.selected {
  background: white;
  color: var(--primary);
  border-color: var(--border);
}
.data-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 16px 0;
}
.wrap-cell {
  white-space: normal;
  min-width: 200px;
  max-width: 420px;
}
.wide-dialog {
  max-width: 1120px;
}
.wide-dialog .dialog-body {
  max-height: 68dvh;
}
.detail-meta {
  margin-bottom: 12px;
}
.detail-actions {
  gap: 8px;
  flex: 1;
}
.document-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  color: var(--muted);
}
.document-total strong {
  color: var(--wsg-ink);
  font-family: var(--wsg-font-display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.form-section-title {
  font-size: 15px;
  margin: 24px 0 16px;
}
.editor-lines {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.editor-line {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 100px 140px 36px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: end;
}
.editor-line .line-reason {
  grid-column: 1 / 4;
  grid-row: 2;
}
.editor-line .remove-line {
  grid-column: 4;
  grid-row: 1;
  margin-bottom: 4px;
}
.editor-line .field label {
  font-size: 11px;
}
.editor-line select,
.editor-line input {
  min-width: 0;
  width: 100%;
}
.quantity-lines {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
.quantity-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.quantity-line small,
.reservation-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.quantity-line input {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--wsg-ink);
  background: white;
  text-align: right;
}
.consent {
  margin: 24px 0;
  align-items: flex-start;
}
.consent input {
  margin-top: 4px;
}
.json-input {
  font-family: var(--wsg-font-mono);
  height: 360px !important;
  font-size: 12px !important;
}
.import-counts {
  margin: 16px 0;
}
.row-error {
  color: var(--danger);
  white-space: normal;
  max-width: 320px;
  font-size: 12px;
  margin-top: 8px;
}
.permissions {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 24px;
  padding: 16px;
}
.permissions legend {
  font-family: var(--wsg-font-display);
  font-weight: 700;
  font-size: 14px;
  padding: 0 8px;
}
.permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.block {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.manufacturing-input-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(100px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 12px 0;
}
.manufacturing-input-row label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}
.manufacturing-input-row input,
.manufacturing-input-row select {
  width: 100%;
  min-width: 0;
}
.manufacturing-route {
  padding-left: 28px;
}
.manufacturing-route li {
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  margin: 8px 0;
}
.manufacturing-route small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.manufacturing-route .current {
  border-color: var(--primary);
  background: var(--tint);
}
.manufacturing-route .done {
  border-color: var(--success);
}
.manufacturing-quality {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.order-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.order-summary > strong {
  flex-basis: 100%;
}
.purchase-receive-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.purchase-receive-line label {
  display: grid;
  gap: 8px;
  font-size: 12px;
}
.purchase-receive-line input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  text-align: right;
}
.purchase-history {
  display: grid;
  gap: 12px;
}
.purchase-history > div {
  padding: 12px 16px;
  border-left: 3px solid var(--border);
}
@media (max-width: 750px) {
  .purchase-receive-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .purchase-receive-line > div {
    grid-column: 1 / -1;
  }
  .manufacturing-input-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .manufacturing-input-row .btn {
    justify-self: start;
  }
  .dialog-foot .actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 1100px) {
  .operational-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-money {
    font-size: 26px;
  }
}
@media (max-width: 750px) {
  .editor-line {
    grid-template-columns: minmax(0, 1fr) 44px;
    padding: 12px;
  }
  .editor-line .line-product {
    grid-column: 1;
  }
  .editor-line .field:not(.line-product) {
    grid-column: 1 / -1;
  }
  .editor-line .line-reason {
    grid-row: auto;
  }
  .editor-line .remove-line {
    grid-column: 2;
  }
  .module-actions {
    align-items: flex-start;
  }
  .secondary-actions {
    gap: 8px;
  }
  .quantity-line {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 12px;
    padding: 12px;
  }
  .document-total {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .document-total strong {
    font-size: 20px;
  }
  .detail-actions {
    gap: 8px;
  }
  .permission-grid {
    grid-template-columns: 1fr;
  }
  .operational-stats .stat {
    min-height: 176px;
  }
}
