:root {
  color-scheme: light;
  --cds-background: #f4f4f4;
  --cds-layer-01: #ffffff;
  --cds-layer-02: #f4f4f4;
  --cds-layer-hover: #e8e8e8;
  --cds-text-primary: #161616;
  --cds-text-secondary: #525252;
  --cds-text-placeholder: #8d8d8d;
  --cds-border-subtle: #e0e0e0;
  --cds-border-strong: #8d8d8d;
  --cds-interactive: #0f62fe;
  --cds-interactive-hover: #0353e9;
  --cds-focus: #0f62fe;
  --cds-inverse: #161616;
  --cds-inverse-hover: #353535;
  --cds-success: #198038;
  --cds-success-bg: #defbe6;
  --cds-warning: #f1c21b;
  --cds-danger: #da1e28;
  --cds-danger-hover: #b81921;
  --brand: #24a148;
  --brand-soft: #e6f6ee;
  --header-height: 48px;
  --rail-width: 56px;
  --side-width: 256px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cds-background);
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--cds-background);
  color: var(--cds-text-primary);
  font: 14px/1.45 "IBM Plex Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--cds-interactive);
  text-decoration: none;
}

a:hover {
  color: var(--cds-interactive-hover);
  text-decoration: underline;
}

.shell {
  min-height: 100vh;
}

.icon-sprite {
  display: none;
}

.global-header {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  left: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: var(--cds-inverse);
  color: #ffffff;
}

.global-brand {
  width: var(--side-width);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid #393939;
  color: #ffffff;
  padding: 0 16px;
}

.global-brand:hover {
  color: #ffffff;
  text-decoration: none;
  background: #262626;
}

.brand-mark {
  flex: 0 0 auto;
  width: 12px;
  height: 28px;
  display: inline-block;
  background: var(--brand);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-brand span:last-child,
.brand-copy {
  display: grid;
  gap: 0;
  min-width: 0;
}

.global-brand strong,
.brand-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-brand small,
.brand-copy small {
  color: #c6c6c6;
  font-size: 12px;
  line-height: 16px;
}

.global-context {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: #c6c6c6;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
}

.global-tenant,
.global-page {
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-tenant {
  flex: 0 2 auto;
}

.global-separator {
  color: #6f6f6f;
}

.global-page {
  flex: 0 1 auto;
  color: #ffffff;
  font-weight: 600;
}

.global-actions {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1px;
}

.user-chip,
.tenant-switch a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 16px;
  font-weight: 400;
}

.tenant-switch {
  display: flex;
  height: 100%;
}

.tenant-switch a:hover,
.tenant-switch a.active {
  background: var(--cds-inverse-hover);
  color: #ffffff;
  text-decoration: none;
}

.header-button {
  height: var(--header-height);
  min-height: var(--header-height);
  border: 0;
  background: transparent;
  color: #ffffff;
  padding: 0 16px;
}

.header-button:hover {
  background: var(--cds-inverse-hover);
  color: #ffffff;
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 20;
  width: var(--rail-width);
  overflow-y: auto;
  background: var(--cds-layer-01);
  border-right: 1px solid var(--cds-border-subtle);
  padding: 8px 0 24px;
  scrollbar-color: #8d8d8d transparent;
  scrollbar-width: thin;
  transition: width 160ms ease, box-shadow 160ms ease;
}

.sidebar:hover,
.sidebar:focus-within,
.shell.sidebar-pinned .sidebar {
  width: var(--side-width);
  box-shadow: 10px 0 20px rgba(0, 0, 0, .08);
}

.sidebar:hover ~ .main,
.sidebar:focus-within ~ .main,
.shell.sidebar-pinned .main {
  width: calc(100% - var(--side-width));
  margin-left: var(--side-width);
}

.nav {
  display: grid;
}

.sidebar-pin {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: var(--cds-text-primary);
  cursor: pointer;
  padding: 0 16px 0 14px;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-pin {
  background: var(--cds-layer-01);
}

.sidebar-pin:hover,
.sidebar-pin[aria-pressed="true"] {
  background: var(--cds-layer-hover);
}

.nav-section {
  height: 28px;
  display: flex;
  align-items: flex-end;
  margin: 10px 16px 4px;
  color: var(--cds-text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-transform: uppercase;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 120ms ease;
}

.sidebar:hover .nav-section,
.sidebar:focus-within .nav-section,
.shell.sidebar-pinned .nav-section {
  opacity: 1;
}

.nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid transparent;
  color: var(--cds-text-primary);
  padding: 0 16px 0 14px;
  font-weight: 400;
  overflow: hidden;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--cds-layer-hover);
  color: var(--cds-text-primary);
  text-decoration: none;
}

.nav a.active {
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--cds-text-primary);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--cds-text-secondary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav a:hover .nav-icon,
.nav a.active .nav-icon {
  color: var(--cds-text-primary);
}

.nav-label {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.sidebar:hover .nav-label,
.sidebar:focus-within .nav-label,
.shell.sidebar-pinned .nav-label {
  opacity: 1;
  transform: translateX(0);
}

.main {
  width: calc(100% - var(--rail-width));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--rail-width);
  padding-top: var(--header-height);
  transition: margin-left 160ms ease, width 160ms ease;
}

.auth-shell {
  display: block;
}

.auth-shell .main {
  width: 100%;
  margin-left: 0;
  padding-top: 0;
}

.eyebrow {
  color: var(--cds-text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-transform: uppercase;
}

.messages {
  display: grid;
  gap: 8px;
  margin: 16px 32px 0;
}

.message {
  border-left: 4px solid var(--brand);
  background: var(--cds-layer-01);
  padding: 12px 16px;
}

.message.error {
  border-left-color: var(--cds-danger);
  background: #fff1f1;
}

.info-banner,
.warning-banner {
  display: grid;
  gap: 8px;
  border-left: 4px solid var(--cds-interactive);
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  padding: 14px 16px;
}

.warning-banner {
  border-left-color: #f1c21b;
}

.cutoff-grid,
.branch-quantity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.button,
button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cds-border-strong);
  border-radius: 0;
  background: var(--cds-layer-01);
  color: var(--cds-text-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 0 16px;
  white-space: nowrap;
}

.button:hover,
button:hover {
  border-color: var(--cds-text-primary);
  color: var(--cds-text-primary);
  text-decoration: none;
}

.button:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cds-focus);
  outline-offset: -2px;
}

.button.primary {
  border-color: var(--cds-interactive);
  background: var(--cds-interactive);
  color: #ffffff;
}

.button.primary:hover {
  border-color: var(--cds-interactive-hover);
  background: var(--cds-interactive-hover);
  color: #ffffff;
}

.button.danger {
  border-color: var(--cds-danger);
  background: var(--cds-danger);
  color: #ffffff;
}

.button.danger:hover {
  border-color: var(--cds-danger-hover);
  background: var(--cds-danger-hover);
  color: #ffffff;
}

.button.ghost {
  background: transparent;
}

.button:disabled,
button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 32px 0;
}

.stat,
.panel {
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle);
  border-radius: 0;
  box-shadow: none;
}

.stat {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.stat span {
  color: var(--cds-text-secondary);
  font-weight: 500;
}

.stat strong {
  color: var(--cds-text-primary);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
}

.panel {
  margin: 24px 32px 0;
  padding: 0;
  min-width: 0;
}

.panel > *,
.form > *,
.operation-grid > *,
.form-grid > *,
.line-row > * {
  min-width: 0;
}

.panel.narrow {
  max-width: 840px;
}

.list-panel,
.detail-panel,
.form-panel {
  display: grid;
  gap: 16px;
}

.form-panel {
  padding: 24px;
}

.panel-header,
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 16px 0;
}

.panel-header.compact {
  padding: 0;
}

.muted {
  margin: 4px 0 0;
  color: var(--cds-text-secondary);
  font-size: 13px;
}

.panel h2,
.detail-head h2 {
  margin: 0;
  color: var(--cds-text-primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: end;
  margin: 0 16px;
}

.quick-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 16px;
}

.quick-filter {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  padding: 0 12px;
  font-weight: 500;
}

.quick-filter:hover {
  border-color: var(--cds-interactive);
  color: var(--cds-interactive);
  text-decoration: none;
}

.quick-filter.active {
  border-color: var(--cds-interactive);
  background: #edf5ff;
  box-shadow: inset 0 -2px 0 var(--cds-interactive);
}

.quick-filter strong {
  min-width: 28px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  background: var(--cds-layer-01);
  color: var(--cds-text-primary);
  font-size: 13px;
  font-weight: 600;
}

.filter-warning {
  margin: -4px 16px 0;
  border-left: 3px solid var(--cds-warning);
  background: #fcf4d6;
  color: var(--cds-text-primary);
  padding: 10px 12px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
}

.list-panel > .table-wrap,
.detail-panel > .table-wrap,
.detail-panel > .count-task-edit-form,
.detail-panel > .detail-action-bar,
.detail-panel > .sub-panel,
.detail-panel > .subsection,
.detail-panel > .approval-box,
.detail-panel > .detail-note,
.detail-panel > .summary {
  margin: 0 16px 16px;
}

.subsection .table-wrap {
  border: 1px solid var(--cds-border-subtle);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid var(--cds-border-subtle);
  padding: 11px 16px;
  vertical-align: middle;
}

.data-table th {
  height: 40px;
  background: var(--cds-layer-02);
  color: var(--cds-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.data-table td {
  min-height: 48px;
  background: var(--cds-layer-01);
}

.data-table tbody tr:hover td {
  background: #f4f4f4;
}

.confirm-dialog {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
  color: var(--cds-text-primary);
  padding: 0;
}

.confirm-dialog::backdrop {
  background: rgba(22, 22, 22, .48);
}

.confirm-dialog-box {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.confirm-dialog h3,
.confirm-dialog p {
  margin: 0;
}

.confirm-dialog h3 {
  font-size: 20px;
  font-weight: 600;
}

.confirm-dialog.wide-dialog {
  width: min(1040px, calc(100vw - 32px));
}

.wide-dialog .confirm-dialog-box,
.calendar-dialog-box {
  max-height: min(82vh, 820px);
  overflow: auto;
}

.selection-summary {
  border-left: 4px solid var(--cds-interactive);
  background: var(--cds-layer-02);
  color: var(--cds-text-secondary);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
}

.compact-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.calendar-dialog {
  width: min(1120px, calc(100vw - 24px));
}

.calendar-header,
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calendar-toolbar {
  padding: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--cds-border-subtle);
  border-left: 1px solid var(--cds-border-subtle);
}

.calendar-weekday,
.calendar-day {
  border-right: 1px solid var(--cds-border-subtle);
  border-bottom: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
}

.calendar-weekday {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--cds-text-secondary);
  background: var(--cds-layer-02);
  font-size: 12px;
  font-weight: 600;
}

.calendar-day {
  min-height: 116px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calendar-day strong {
  color: var(--cds-text-primary);
  font-size: 14px;
}

.muted-day {
  background: var(--cds-layer-02);
}

.calendar-event {
  display: block;
  border-left: 4px solid var(--cds-interactive);
  background: #f4f4f4;
  color: var(--cds-text-primary);
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
}

.calendar-event:hover {
  background: #e8e8e8;
  color: var(--cds-link-primary);
}

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

.data-table input,
.data-table select,
.data-table textarea {
  min-width: 132px;
}

.table-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cds-border-subtle);
  background: transparent;
  color: var(--cds-interactive);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.table-action:hover {
  border-color: var(--cds-interactive);
  background: #edf5ff;
  color: var(--cds-interactive);
  text-decoration: none;
}

.table-action.danger-link,
.danger-link {
  border-color: #ffd7d9;
  color: var(--cds-danger);
}

.table-action.danger-link:hover,
.danger-link:hover {
  border-color: var(--cds-danger);
  background: #fff1f1;
  color: var(--cds-danger-hover);
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.table-actions form,
.inline-action-form {
  margin: 0;
}

.stacked-action-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-width: 360px;
}

.stacked-action-form .button {
  grid-column: 1 / -1;
  justify-self: start;
}

.data-table .stacked-action-form input {
  min-width: 0;
  width: 100%;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--cds-border-subtle);
}

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  color: var(--cds-text-secondary);
  font-weight: 600;
}

.tab:hover,
.tab.active {
  color: var(--cds-text-primary);
  border-bottom-color: var(--cds-interactive);
  background: var(--cds-layer-accent);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--cds-border-subtle);
  margin: -16px 16px 16px;
  padding: 12px 0 0;
}

.pagination-summary {
  color: var(--cds-text-secondary);
  font-size: 13px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-actions .button {
  min-height: 32px;
  padding: 0 12px;
}

.pagination-current {
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cds-inverse);
  color: #ffffff;
  font-weight: 600;
}

.button.disabled {
  opacity: .45;
  pointer-events: none;
}

.empty-row td {
  padding: 32px 16px;
  color: var(--cds-text-secondary);
  text-align: center;
  background: var(--cds-layer-02);
}

.status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  background: #e0e0e0;
  color: #393939;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  padding: 2px 10px;
}

.status-approved,
.status-auto_approved,
.status-completed,
.status-current,
.status-paid,
.status-posted,
.status-processed,
.status-selected {
  background: var(--cds-success-bg);
  color: #0e6027;
}

.status-basket_pending,
.status-cfo_waiting,
.status-collecting,
.status-discrepancy_waiting,
.status-dispatched,
.status-finance_waiting,
.status-goods_receipt_waiting,
.status-in_progress,
.status-insufficient_payment,
.status-open,
.status-payment_waiting,
.status-pending,
.status-quotes_received,
.status-receipt_waiting,
.status-received,
.status-sas_created,
.status-sent,
.status-submitted,
.status-waiting {
  background: #edf5ff;
  color: #0043ce;
}

.status-candidate,
.status-draft,
.status-invited,
.status-planned {
  background: #f4f4f4;
  color: #525252;
}

.status-archived,
.status-closed {
  background: #e0e0e0;
  color: #525252;
}

.status-cancelled,
.status-error,
.status-expired,
.status-failed,
.status-missed,
.status-passive,
.status-rejected,
.status-unavailable {
  background: #fff1f1;
  color: #a2191f;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 132px;
}

.meta-text {
  display: inline-block;
  margin-left: 8px;
  color: var(--cds-text-secondary);
  font-size: 12px;
}

.table-actions-wide {
  min-width: 600px;
}

.inline-decision-form {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
  max-width: 560px;
}

.inline-decision-form select,
.inline-decision-form textarea {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.inline-decision-form textarea {
  height: 40px;
  resize: vertical;
}

.button.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--cds-border-subtle);
  margin-bottom: 24px;
}

.tab-strip a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  color: var(--cds-text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.tab-strip a:hover,
.tab-strip a:focus {
  color: var(--cds-text-primary);
  border-bottom-color: var(--cds-link-primary);
}

.body-text {
  max-width: 860px;
  color: var(--cds-text-secondary);
}

.row-details summary {
  color: var(--cds-link-primary);
  cursor: pointer;
  font-weight: 600;
}

.row-details pre {
  max-width: 420px;
  white-space: pre-wrap;
  background: var(--cds-layer-02);
  padding: 12px;
  margin: 8px 0 0;
}

.form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

label {
  display: grid;
  gap: 8px;
  align-self: start;
  color: var(--cds-text-primary);
  font-weight: 500;
}

.choice-field {
  display: grid;
  gap: 8px;
  align-self: start;
  color: var(--cds-text-primary);
  font-weight: 500;
}

.field-label {
  display: block;
}

.choice-field > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  min-height: 40px;
  align-items: center;
  padding: 8px 0;
}

.choice-field label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}

.choice-field input[type="radio"],
.choice-field input[type="checkbox"] {
  width: auto;
  min-height: 0;
}

small,
.helptext {
  color: var(--cds-text-secondary);
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--cds-border-strong);
  border-radius: 0;
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  font: inherit;
  padding: 0 16px;
}

textarea {
  min-height: 96px;
  height: 112px;
  padding: 12px 16px;
  resize: vertical;
}

.compact-textarea {
  min-height: 72px;
  height: 80px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.email-rows {
  display: grid;
  gap: 8px;
}

.compact-button {
  width: fit-content;
  min-height: 36px;
  padding-inline: 12px;
}

select[multiple] {
  min-height: 128px;
  padding-block: 8px;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--cds-interactive);
}

input[type="file"] {
  padding: 8px 12px;
}

input[type="file"]::file-selector-button {
  min-height: 32px;
  border: 1px solid var(--cds-border-strong);
  background: var(--cds-layer-01);
  color: var(--cds-text-primary);
  font: inherit;
  margin-right: 12px;
  padding: 0 12px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.form h2 {
  margin: 0;
  color: var(--cds-text-primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.form-grid label:has(textarea),
.form-grid .field-address,
.form-grid .field-branches,
.form-grid .field-delivery-days,
.form-grid .field-description,
.form-grid .field-note,
.form-grid .field-supplier_options {
  grid-column: span 2;
}

.field-delivery-days > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-delivery-days > div > div,
.field-delivery-days label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.line-list {
  display: grid;
  gap: 12px;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(140px, .7fr) minmax(260px, 1.3fr) auto;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-02);
  padding: 16px;
}

.purchase-tender-line-row {
  grid-template-columns: minmax(260px, 1.4fr) minmax(160px, .7fr) minmax(240px, 1fr) auto;
}

.return-line-row {
  grid-template-columns: minmax(210px, 1.2fr) minmax(130px, .55fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.recipe-line-row {
  grid-template-columns: minmax(220px, 1.4fr) minmax(120px, .6fr) minmax(140px, .7fr) minmax(120px, .6fr) auto;
}

.order-line-row {
  grid-template-columns: minmax(220px, 1.3fr) minmax(120px, .55fr) minmax(220px, 1fr) minmax(100px, .45fr) minmax(100px, .45fr) minmax(120px, .55fr) auto;
}

.line-row .field {
  min-width: 0;
}

.field-DELETE {
  display: none;
}

.line-row textarea {
  min-height: 72px;
  height: 80px;
}

.line-row-actions {
  align-self: end;
  display: flex;
  justify-content: flex-end;
}

.line-row-actions .button {
  min-height: 40px;
  padding: 0 12px;
}

.product-picker {
  display: grid;
  gap: 16px;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-02);
  padding: 16px;
}

.product-picker .toolbar {
  margin: 0;
  grid-template-columns: minmax(220px, .6fr) minmax(320px, 1.4fr);
}

.segmented-control {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
  padding: 2px;
}

.segmented-control button {
  min-height: 36px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--cds-text-secondary);
  font: inherit;
  padding: 0 12px;
}

.segmented-control button.active {
  background: var(--cds-layer-selected);
  color: var(--cds-text-primary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.product-card {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 210px;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
  padding: 14px;
}

.product-thumb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  font-weight: 600;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card[hidden] {
  display: none;
}

.product-card h3 {
  margin: 0;
  color: var(--cds-text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.product-card p {
  margin: 6px 0 0;
  color: var(--cds-text-secondary);
}

.product-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--cds-border-subtle);
  border: 1px solid var(--cds-border-subtle);
}

.product-card dl div {
  min-width: 0;
  background: var(--cds-layer-02);
  padding: 8px;
}

.product-card dt {
  color: var(--cds-text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.product-card dd {
  margin: 2px 0 0;
  color: var(--cds-text-primary);
  font-weight: 600;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin: 0;
  background: transparent;
}

.summary div {
  flex: 1 1 240px;
  background: var(--cds-layer-02);
  border: 1px solid var(--cds-border-subtle);
  padding: 12px 16px;
}

.summary dt {
  color: var(--cds-text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.summary dd {
  margin: 4px 0 0;
  color: var(--cds-text-primary);
  font-weight: 600;
}

.approval-box {
  display: grid;
  gap: 16px;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-02);
  padding: 16px;
}

.detail-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--cds-border-subtle);
  border-bottom: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-02);
  padding: 12px 16px;
}

.count-task-edit-form {
  display: grid;
  gap: 16px;
}

.note-box {
  min-height: 48px;
  margin: 0;
  background: var(--cds-layer-02);
  border: 1px solid var(--cds-border-subtle);
  color: var(--cds-text-primary);
  padding: 12px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--cds-text-primary);
}

.table-inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.table-inline-form input {
  width: 108px;
  min-height: 32px;
  padding-inline: 8px;
}

.table-inline-form input[type="text"] {
  width: 150px;
}

.subsection {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--cds-border-subtle);
  padding-top: 16px;
}

.evidence-preview {
  display: block;
  width: min(420px, 100%);
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
}

.subsection h3 {
  margin: 0;
  color: var(--cds-text-primary);
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.detail-note {
  margin: 0;
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  padding: 16px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 16px 16px;
  background: var(--cds-border-subtle);
  border: 1px solid var(--cds-border-subtle);
}

.quick-link {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  padding: 16px;
}

.quick-link:hover {
  background: #edf5ff;
  color: var(--cds-text-primary);
  text-decoration: none;
}

.quick-link strong {
  color: var(--cds-interactive);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.quick-link span {
  color: var(--cds-text-secondary);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--cds-background);
}

.auth-panel {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
  padding: 32px;
}

.auth-brand {
  margin-bottom: 24px;
  color: var(--cds-text-primary);
  font-weight: 500;
}

.auth-panel h1 {
  margin: 0 0 24px;
  color: var(--cds-text-primary);
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.sub-panel {
  border: 1px solid var(--cds-border-subtle);
  background: var(--cds-layer-01);
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

.sub-panel h3 {
  margin: 0 0 16px;
  color: var(--cds-text-primary);
  font-size: 18px;
  font-weight: 600;
}

.sub-panel .table-wrap {
  min-width: 0;
  max-width: 100%;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.bulk-route-panel {
  margin: 0 16px;
}

@media (max-width: 1180px) {
  .stats,
  .quick-grid,
  .operation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .global-header {
    position: sticky;
  }

  .global-brand {
    width: 48px;
    min-width: 48px;
    justify-content: center;
    padding: 0;
  }

  .global-brand span:last-child {
    display: none;
  }

  .global-context {
    display: flex;
    min-width: 0;
    padding: 0 12px;
  }

  .global-tenant,
  .global-separator {
    display: none;
  }

  .global-actions {
    margin-left: auto;
  }

  .user-chip {
    display: none;
  }

  .tenant-switch {
    display: none;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-width: 100vw;
    height: auto;
    overflow-x: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--cds-border-subtle);
    padding: 0;
    box-shadow: none;
    transition: none;
  }

  .sidebar:hover,
  .sidebar:focus-within,
  .shell.sidebar-pinned .sidebar {
    width: 100%;
    box-shadow: none;
  }

  .sidebar-pin {
    display: none;
  }

  .nav {
    display: flex;
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    contain: inline-size;
  }

  .nav-section {
    display: none;
  }

  .nav a {
    min-height: 48px;
    flex: 0 0 auto;
    gap: 8px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    padding: 0 14px;
  }

  .nav a.active {
    border-bottom-color: var(--brand);
    background: var(--cds-layer-02);
  }

  .nav-label {
    opacity: 1;
    transform: none;
  }

  .main {
    width: 100%;
    margin-left: 0;
    padding-top: 0;
  }

  .sidebar:hover ~ .main,
  .sidebar:focus-within ~ .main,
  .shell.sidebar-pinned .main {
    width: 100%;
    margin-left: 0;
  }

  .messages,
  .stats,
  .panel {
    margin-right: 16px;
    margin-left: 16px;
  }

  .stats,
  .summary,
  .form-grid,
  .line-row,
  .operation-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .product-picker .toolbar {
    grid-template-columns: 1fr;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-actions {
    flex-wrap: wrap;
  }

  .panel-header,
  .detail-head {
    display: grid;
  }

  .form-grid label:has(textarea),
  .form-grid .field-address,
  .form-grid .field-branches,
  .form-grid .field-delivery-days,
  .form-grid .field-description,
  .form-grid .field-note,
  .form-grid .field-supplier_options {
    grid-column: auto;
  }

  .line-row-actions {
    justify-content: flex-start;
  }
}
