:root {
  color-scheme: light;
  --bg: #f2f6ee;
  --surface: #ffffff;
  --surface-muted: #e9f3df;
  --line: #d4e3cc;
  --text: #09160f;
  --muted: #5f6e5e;
  --green: #0c482f;
  --green-strong: #052d20;
  --leaf: #86c947;
  --mint: #dcf4cd;
  --gold: #e6b33d;
  --rose: #b95a56;
  --blue: #4677a8;
  --shadow: 0 18px 45px rgba(11, 37, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100%;
  transition: grid-template-columns 0.18s ease;
}

.sidebar {
  background: #07150e;
  color: #f5fbf4;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 4px solid var(--leaf);
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
}

.sidebar-toggle {
  order: 4;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 30px;
  margin: 10px 8px 0;
  padding: 0 8px;
  border: 1px solid rgba(219, 232, 218, 0.08);
  border-radius: 7px;
  background: transparent;
  color: #8fa08d;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #dbe8da;
}

.sidebar-toggle-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(134, 201, 71, 0.08);
  color: #b8cfb2;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.brand {
  order: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.brand-logo {
  width: 78px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-footer {
  color: #aebcad;
  font-size: 13px;
}

.brand strong {
  line-height: 1.15;
}

@media (min-width: 721px) {
  .app-shell.sidebar-collapsed {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed .sidebar {
    padding: 18px 10px;
  }

  .app-shell.sidebar-collapsed .brand {
    justify-content: center;
  }

  .app-shell.sidebar-collapsed .brand div,
  .app-shell.sidebar-collapsed .sidebar-toggle span:last-child,
  .app-shell.sidebar-collapsed .nav-item span:last-child,
  .app-shell.sidebar-collapsed .sidebar-footer span:not(.status-dot) {
    display: none;
  }

  .app-shell.sidebar-collapsed .brand-logo {
    width: 50px;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle {
    width: 42px;
    min-height: 38px;
    margin-inline: auto;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle-icon {
    transform: rotate(180deg);
  }

  .app-shell.sidebar-collapsed .nav-list {
    margin-top: 18px;
    padding-right: 0;
  }

  .app-shell.sidebar-collapsed .nav-group {
    border-top: 0;
    padding-top: 0;
  }

  .app-shell.sidebar-collapsed .nav-group summary {
    justify-content: center;
    min-height: 38px;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .nav-group-label {
    justify-content: center;
  }

  .app-shell.sidebar-collapsed .nav-group-label > span:last-child {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-group-chevron {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .sidebar-footer {
    justify-content: center;
    padding: 10px 0;
  }
}

.nav-list {
  order: 2;
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  margin-top: 28px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(134, 201, 71, 0.55) transparent;
}

.nav-list-legacy {
  order: 3;
  display: none;
}

.sidebar-footer {
  order: 5;
}

.nav-group {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(219, 232, 218, 0.08);
  padding-top: 10px;
}

.nav-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  color: #9fb39e;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  text-transform: uppercase;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-group-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-group-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #bde5a0;
}

.nav-group-chevron {
  color: var(--leaf);
  transition: transform 0.18s ease;
}

.nav-group:not([open]) .nav-group-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: grid;
  gap: 4px;
}

.nav-group:not([open]) .nav-group-items {
  display: none;
}

.nav-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbe8da;
  text-align: left;
  padding: 0 12px;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item:hover,
.nav-item.active {
  background: #123420;
  color: #ffffff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--leaf);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(219, 232, 218, 0.14);
  border-radius: 6px;
  color: #bde5a0;
  font-size: 11px;
  font-weight: 800;
}

.nav-icon svg,
.nav-group-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-group-icon svg {
  width: 18px;
  height: 18px;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  border-color: rgba(134, 201, 71, 0.5);
  background: rgba(134, 201, 71, 0.12);
  color: #ffffff;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
}

.sidebar-user-footer {
  align-items: flex-start;
  border-top: 1px solid rgba(219, 232, 218, 0.12);
}

.sidebar-user-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-user-text small {
  color: #aebcad;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-user-text strong {
  color: #f5fbf4;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-pill {
  margin-left: auto;
  border: 1px solid rgba(134, 201, 71, 0.38);
  border-radius: 999px;
  padding: 2px 7px;
  color: #d9f3cc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.label-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.label-form-stack {
  align-content: start;
}

.label-facts {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbf4;
}

.label-facts span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  color: var(--muted);
}

.label-facts span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.label-facts strong {
  color: var(--ink);
}

.label-preview-shell {
  min-width: 0;
}

.label-preview-shell h3 {
  margin: 0 0 12px;
}

.label-preview-stage {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(12, 72, 47, 0.26);
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, #f7faf4, #f7faf4 10px, #f0f6ec 10px, #f0f6ec 20px);
  padding: 18px;
  overflow: auto;
}

.label-template {
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(7, 21, 14, 0.16);
}

.label-template * {
  box-sizing: border-box;
}

.label-source-hidden {
  display: none !important;
}

.label-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.compact-label-preview {
  min-height: 170px;
}

.label-abgabe {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
}

.label-abgabe-70x50 {
  width: min(100%, 490px);
  aspect-ratio: 70 / 50;
}

.label-abgabe-90x32 {
  width: min(100%, 650px);
  aspect-ratio: 90 / 32;
  gap: 4px;
  padding: 8px;
}

.label-deckel-30x15 {
  width: min(100%, 300px);
  aspect-ratio: 30 / 15;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
}

.label-deckel-30x15 strong {
  display: block;
  max-width: 100%;
  font-size: clamp(18px, 8vw, 34px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.label-meta-row,
.label-main-row,
.label-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.label-meta-row {
  border-bottom: 1px solid #000;
  padding-bottom: 3px;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.label-main-row {
  align-items: stretch;
}

.label-title-block {
  flex: 1;
  min-width: 0;
}

.label-title-block span,
.label-title-block strong,
.label-title-block b {
  display: block;
}

.label-title-block span {
  font-size: 13px;
  font-weight: 900;
}

.label-title-block strong {
  margin-top: 3px;
  font-size: 31px;
  line-height: 1.01;
}

.label-title-block b {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1;
}

.label-abgabe-90x32 .label-title-block span {
  font-size: 10px;
}

.label-abgabe-90x32 .label-title-block strong {
  font-size: 25px;
}

.label-abgabe-90x32 .label-title-block b {
  font-size: 12px;
}

.label-qr-wrap {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
}

.label-abgabe-90x32 .label-qr-wrap {
  width: 66px;
  height: 66px;
  flex-basis: 66px;
}

.label-qr-code {
  width: 100%;
  height: 100%;
  display: block;
  fill: #000;
  shape-rendering: crispEdges;
}

.label-data-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.02;
}

.label-abgabe-90x32 .label-data-row {
  font-size: 11px;
  padding: 2px 0;
}

.label-data-row span,
.label-data-row b {
  display: block;
}

.label-notice {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.08;
}

.label-notice span,
.label-notice em {
  display: block;
}

.label-notice em {
  margin-top: 2px;
  font-style: italic;
}

.label-abgabe-90x32 .label-notice {
  font-size: 10px;
  line-height: 1.04;
}

.label-abgabe-90x32 .label-notice em {
  margin-top: 1px;
}

.label-url {
  margin-top: auto;
  border-top: 1px solid #000;
  padding-top: 4px;
  font-size: 9px;
  font-weight: 900;
}

.label-plant-56x25 {
  width: min(100%, 500px);
  aspect-ratio: 56 / 25;
  display: grid;
  grid-template-columns: 54% 1fr;
  gap: 8px;
  padding: 9px;
}

.plant-label-main span,
.plant-label-main strong,
.plant-label-main b,
.plant-label-main small {
  display: block;
}

.plant-label-main span {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.plant-label-main strong {
  margin-top: 3px;
  font-size: 26px;
  line-height: 1;
}

.plant-label-main b {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1;
}

.plant-label-main small {
  margin-top: 4px;
  font-size: 13px;
}

.plant-label-barcode {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.label-barcode-code128 {
  width: 100%;
  height: 44px;
  fill: #000;
  shape-rendering: crispEdges;
}

.plant-label-barcode span {
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 4px rgba(134, 201, 71, 0.16);
}

.workspace {
  min-width: 0;
  max-width: 100%;
  padding: 28px clamp(18px, 3vw, 42px) 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05;
}

h2 {
  font-size: 19px;
  margin-bottom: 14px;
}

h3 {
  font-size: 15px;
  margin-bottom: 7px;
}

.top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(34vw, 360px);
  min-width: 190px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-wrap input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  text-decoration: none;
  transition: box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.primary-button {
  background: var(--green);
  color: #fff;
  font-weight: 750;
}

.secondary-button {
  background: var(--surface);
  color: var(--green-strong);
  border-color: var(--line);
  font-weight: 700;
}

.secondary-button.active {
  background: var(--green-strong);
  border-color: var(--green-strong);
  color: #fff;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.compact-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.danger-button {
  color: #8a1f1f;
  border-color: #e2b8b8;
}

.sort-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  text-align: left;
  text-transform: uppercase;
}

.inline-link {
  display: inline;
  border: 0;
  background: transparent;
  color: var(--green-strong);
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.inline-link:hover,
.inline-link:focus-visible {
  color: var(--green);
}

.icon-button {
  width: 42px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  box-shadow: 0 8px 22px rgba(8, 49, 31, 0.12);
  transform: translateY(-1px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 72px;
  height: 5px;
  background: var(--leaf);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 34px;
  line-height: 1;
}

.metric.clickable,
.clickable-row {
  cursor: pointer;
}

.metric.clickable:hover,
.clickable-row:hover {
  background: var(--surface-muted);
}

.centered-metric {
  text-align: center;
}

.centered-metric::after {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.hero-message {
  max-width: 780px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
}

.inline-select select {
  width: 100%;
  min-height: 36px;
  margin-top: 4px;
}

.compact-metrics .metric {
  min-height: 112px;
}

.compact-metrics .metric strong {
  font-size: 30px;
  line-height: 1.05;
}

.compact-metrics .metric strong.single-line {
  font-size: 24px;
  white-space: nowrap;
}

.compact-metrics .centered-metric {
  text-align: center;
}

.compact-metrics .centered-metric::after {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.metric p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
  min-width: 0;
  max-width: 100%;
}

.mobile-dashboard {
  display: none;
}

.propagation-wide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-shortcuts {
  margin-top: 16px;
}

.dashboard-focus-grid {
  align-items: start;
}

.dashboard-attention .panel-header .chip {
  flex: 0 0 auto;
}

.dashboard-alert-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1fr) auto;
  align-items: center;
}

.dashboard-alert-row strong {
  text-align: right;
}

.detail-row em.chip {
  font-style: normal;
  white-space: nowrap;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.shortcut-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-strong);
  padding: 8px 10px;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.shortcut-button:hover {
  border-color: var(--leaf);
  box-shadow: 0 10px 24px rgba(8, 49, 31, 0.1);
  transform: translateY(-1px);
}

.shortcut-button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--green);
  font-weight: 850;
}

.shortcut-button strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.15;
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header.no-margin {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
}

.toolbar.no-margin {
  margin-bottom: 0;
}

.toolbar .wide {
  flex: 1 1 260px;
}

.toolbar .wide input {
  width: 100%;
}

.toolbar .grow-field {
  flex: 1 1 260px;
}

.toolbar .grow-field input {
  width: 100%;
}

.table-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.table-tools input {
  min-height: 34px;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
}

.table-column-config {
  position: relative;
}

.table-column-config > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.table-column-config > summary::-webkit-details-marker {
  display: none;
}

.table-column-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  width: min(280px, 78vw);
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 38px rgba(0, 35, 18, 0.16);
}

.table-column-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
}

.table-column-menu input {
  min-width: auto;
  min-height: auto;
}

.table-column-menu input[type="checkbox"] {
  width: auto;
  padding: 0;
}

.table-column-hidden {
  display: none !important;
}

.table-configurable th {
  position: relative;
  padding-right: 24px;
}

.table-configurable.has-column-widths {
  table-layout: fixed;
  width: auto;
}

.table-configurable.has-column-widths th,
.table-configurable.has-column-widths td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-resizer {
  position: absolute;
  top: 6px;
  right: 0;
  bottom: 6px;
  z-index: 4;
  width: 14px;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  content: "";
  display: block;
  width: 3px;
  height: 100%;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(99, 199, 58, 0.82);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.column-resizer:hover::after,
body.table-resizing .column-resizer::after {
  width: 4px;
  background: var(--green-dark);
}

body.table-resizing {
  cursor: col-resize;
  user-select: none;
}

.table-input {
  width: min(180px, 100%);
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  font: inherit;
  font-weight: 700;
}

.positive-value {
  color: #0c6b3b;
  font-weight: 800;
}

.negative-value {
  color: #9d2f2f;
  font-weight: 800;
}

.table-wrap.is-collapsed {
  display: none;
}

.table-wrap th {
  cursor: pointer;
}

.transport-items {
  display: grid;
  gap: 10px;
}

.transport-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.45fr);
  gap: 10px;
}

.transport-settings-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.transport-settings-strip p {
  margin: 4px 0 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .transport-settings-strip {
    grid-template-columns: 1fr;
  }
}

.compact-table-wrap {
  max-height: 300px;
}

.compact-table {
  min-width: 760px;
}

.transport-document-preview {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8ede6;
  padding: 18px;
}

.transport-document {
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  color: #04140d;
  border: 1px solid #d7e6cf;
  padding: 18mm;
  font-size: 11.5pt;
  line-height: 1.4;
}

.transport-document-header {
  display: grid;
  grid-template-columns: 42mm minmax(0, 1fr);
  gap: 16mm;
  align-items: center;
  border-bottom: 2px solid #0a3b28;
  padding-bottom: 8mm;
  margin-bottom: 8mm;
}

.transport-document-header img {
  width: 38mm;
  height: auto;
  max-height: 28mm;
  object-fit: contain;
}

.transport-document h1 {
  margin: 5mm 0 1mm;
  font-size: 22pt;
  letter-spacing: 0;
}

.transport-document h2 {
  margin: 0 0 3mm;
  font-size: 12pt;
}

.transport-document p {
  margin: 1.5mm 0;
}

.transport-document-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3mm;
  margin: 0 0 7mm;
}

.transport-document-meta > div,
.transport-document-route > div,
.transport-document-section {
  border: 1px solid #cbdcca;
  padding: 4mm;
}

.transport-document-meta span {
  display: block;
  color: #5f6e62;
  font-size: 9pt;
  margin-bottom: 1mm;
}

.transport-document-meta strong {
  font-size: 11pt;
}

.transport-document-note {
  margin: 0 0 7mm;
}

.transport-document-route {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5mm;
  margin: 6mm 0;
}

.transport-document-table {
  width: 100%;
  min-width: 0;
  font-size: 10.5pt;
  border-collapse: collapse;
}

.transport-document-table th,
.transport-document-table td {
  padding: 2.6mm 2mm;
  border-bottom: 1px solid #d7e6cf;
  text-align: left;
}

.transport-document-footer {
  margin-top: 8mm;
  border-top: 1px solid #d7e6cf;
  padding-top: 4mm;
  color: #5f6e62;
}

.transport-print {
  margin: 0;
  padding: 24px;
  background: #fff;
}

.transport-print .transport-document {
  border: 0;
  border-radius: 0;
  width: 210mm;
  max-width: 100%;
}

@media print {
  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.transport-print {
    padding: 0;
  }

  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  .transport-document {
    width: auto;
    min-height: auto;
    padding: 0;
    box-shadow: none;
    border: 0;
  }
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.segmented button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.segment-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.segment-check input {
  width: auto;
  accent-color: var(--green-bright);
}

.segment-check:has(input:checked) {
  background: var(--surface);
  color: var(--green-strong);
}

.segmented button.active {
  background: var(--surface);
  color: var(--green-strong);
}

.finance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.finance-nav-panel {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(170px, 220px);
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}

.finance-nav-header {
  min-width: 0;
}

.finance-nav-header h2,
.finance-context-panel h2 {
  margin: 2px 0 0;
}

.finance-nav-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.finance-subnav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.finance-nav-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px;
}

.finance-nav-group > strong {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.finance-nav-group-items {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.finance-subnav button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  min-height: 52px;
  padding: 9px 10px;
  text-align: left;
}

.finance-subnav button span {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-subnav button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.finance-subnav button.active {
  border-color: var(--green-bright);
  background: var(--green-soft);
  box-shadow: inset 0 4px 0 var(--green-bright);
}

.odoo-hub-panel {
  display: grid;
  gap: 14px;
}

.odoo-hub-panel .panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.odoo-subnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  min-width: 0;
}

.odoo-subnav button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.odoo-subnav button span {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.odoo-subnav button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.odoo-subnav button.active {
  border-color: var(--green-bright);
  background: var(--green-soft);
  box-shadow: inset 0 4px 0 var(--green-bright);
}

.odoo-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.odoo-overview-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.odoo-overview-card strong {
  font-size: 18px;
}

.odoo-overview-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

[data-odoo-panel][hidden] {
  display: none !important;
}

.finance-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(210px, 100%);
}

.finance-main {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.finance-context-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-block: 14px;
}

.finance-context-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.finance-context-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.finance-task-list {
  display: grid;
  gap: 8px;
}

.finance-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  text-align: left;
}

.finance-task-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.finance-task-row span strong {
  font-size: 15px;
  line-height: 1.25;
}

.finance-task-row span small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.finance-task-row > strong {
  font-size: 22px;
}

.finance-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.finance-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.finance-workflow-card {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.finance-workflow-card h3 {
  margin: 0 0 8px;
}

.finance-workflow-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

td.wrap-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.purpose-cell {
  min-width: 180px;
  max-width: 260px;
}

.finance-transaction-table {
  table-layout: fixed;
  min-width: 900px;
}

.finance-transaction-table .purpose-cell {
  width: 220px;
  max-width: 220px;
  max-height: 44px;
  overflow: hidden;
}

.finance-transaction-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-transaction-table td:last-child {
  overflow: visible;
  white-space: normal;
}

.check-cell {
  width: 38px;
  text-align: center;
}

.check-cell input {
  min-height: auto;
}

.finance-transaction-table th:nth-child(2),
.finance-transaction-table td:nth-child(2) {
  width: 96px;
}

.finance-transaction-table th:nth-child(3),
.finance-transaction-table td:nth-child(3) {
  width: 130px;
}

.finance-transaction-table th:nth-child(4),
.finance-transaction-table td:nth-child(4) {
  width: 150px;
}

.finance-transaction-table th:nth-child(6),
.finance-transaction-table td:nth-child(6) {
  width: 90px;
}

.finance-transaction-table th:nth-child(7),
.finance-transaction-table td:nth-child(7) {
  width: 100px;
}

.finance-transaction-table th:nth-child(8),
.finance-transaction-table td:nth-child(8) {
  width: 220px;
}

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

.inline-actions select {
  max-width: 190px;
}

.block-note {
  display: block;
  margin-top: 6px;
  white-space: normal;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f7faf5;
}

tbody tr.selected-row {
  background: #eef8e7;
  box-shadow: inset 3px 0 0 var(--leaf);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.chip.green {
  background: var(--mint);
  color: var(--green-strong);
}

.chip.gold {
  background: #fff0ce;
  color: #7d5410;
}

.chip.rose {
  background: #ffe4e2;
  color: #8a312c;
}

.chip.blue {
  background: #e3eef9;
  color: #24527e;
}

.chip.muted-chip {
  background: #edf1eb;
  color: #617061;
}

.inner-panel {
  margin-top: 14px;
  box-shadow: none;
}

.preline-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

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

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.detail-row span {
  color: var(--muted);
}

.strain-overview-panel {
  margin-bottom: 16px;
}

.strain-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.overview-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.overview-block h3 {
  margin-bottom: 12px;
}

.compact-detail-list {
  gap: 8px;
}

.compact-detail-list .detail-row {
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}

.compact-detail-list .detail-row span {
  min-width: 0;
}

.compact-detail-list .detail-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

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

.member-attention-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--leaf);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.member-attention-card.kritisch {
  border-left-color: #b33a35;
}

.member-attention-card.warnung {
  border-left-color: #d6951b;
}

.member-attention-card.hinweis {
  border-left-color: #4a7fb4;
}

.member-attention-card p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.member-balance-panel .content-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

.balance-entry-block {
  margin-top: 16px;
  max-width: 1120px;
}

.balance-entry-block .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-balance-panel .metric strong {
  overflow-wrap: anywhere;
}

.account-flow {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.account-history-panel {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.account-history-panel h3 {
  font-size: 24px;
}

.account-history-panel .panel-header {
  align-items: flex-start;
}

.account-history-panel .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.account-history-panel th,
.account-history-panel td {
  padding: 14px 12px;
  font-size: 15px;
}

.account-flow .table-wrap {
  margin-top: 0;
}

.account-flow .table-tools {
  justify-content: flex-start;
  margin-top: 4px;
}

.account-table-slot {
  min-width: 0;
}

.account-table-slot table {
  min-width: 960px;
}

.account-reference {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
}

.small-segmented {
  justify-content: flex-end;
}

.small-segmented button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.pending-credit-box {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.positive-amount {
  color: var(--green-dark);
}

.negative-amount {
  color: #9f2f2f;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.dossier-timeline {
  margin-top: 4px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--green);
}

.timeline-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.calendar-panel {
  overflow-x: auto;
  padding-bottom: 16px;
  scrollbar-width: thin;
}

.cultivation-calendar {
  display: grid;
  gap: 8px;
  min-width: 860px;
}

.calendar-header-row,
.calendar-event-row,
.calendar-group-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.24fr) minmax(560px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.calendar-header-row {
  min-height: 36px;
}

.calendar-track {
  position: relative;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(211, 231, 203, 0.45) 1px, transparent 1px) 0 0 / calc(100% / 6) 100%,
    rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.calendar-month-track {
  min-height: 32px;
  background: rgba(236, 245, 232, 0.95);
}

.calendar-month {
  position: absolute;
  inset-block: 0;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-group-row {
  margin-top: 8px;
}

.calendar-group-title {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.calendar-group-track {
  min-height: 36px;
  opacity: 0.72;
}

.calendar-event-label {
  min-width: 0;
  padding: 8px 0;
}

.calendar-event-label strong {
  display: block;
  margin-bottom: 2px;
}

.calendar-event-label span {
  color: var(--muted);
  font-size: 13px;
}

.calendar-bar {
  position: absolute;
  top: 7px;
  bottom: 7px;
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 34px;
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(6, 45, 29, 0.12);
}

.calendar-bar span,
.calendar-bar small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-bar span {
  font-size: 13px;
  font-weight: 900;
}

.calendar-bar small {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.78;
}

.calendar-anzucht {
  background: #d9f2ce;
}

.calendar-stecklinge {
  background: #cdeeda;
}

.calendar-vegetation {
  background: #bbe4c4;
}

.calendar-bluete {
  background: #cfe5ff;
}

.calendar-trocknung {
  background: #ffe6b8;
}

.calendar-marker {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 999px;
  background: rgba(3, 63, 42, 0.72);
  transform: translateX(-1px);
  z-index: 3;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(3, 63, 42, 0.14);
}

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

.form-section-title {
  margin: 8px 0 0;
  font-size: 18px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.checkbox-line input {
  width: auto;
}

.settings-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.settings-permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.settings-permission-group h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.settings-hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f5faf1 100%);
}

.settings-hero-panel h2 {
  margin: 2px 0 4px;
  font-size: clamp(28px, 4vw, 44px);
}

.settings-section-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.settings-section-button,
.settings-home-card {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.settings-section-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas:
    "icon title"
    "icon hint";
  gap: 2px 10px;
  min-height: 76px;
  padding: 12px;
}

.settings-section-button span {
  grid-area: icon;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--green);
  font-weight: 900;
  font-size: 13px;
}

.settings-section-button strong {
  grid-area: title;
  align-self: end;
}

.settings-section-button small {
  grid-area: hint;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
}

.settings-section-button:hover,
.settings-section-button.active,
.settings-home-card:hover {
  border-color: var(--leaf);
  background: #f8fff2;
}

.settings-section-button.active {
  box-shadow: inset 4px 0 0 var(--leaf);
}

.settings-section-content {
  display: grid;
  gap: 16px;
}

.settings-home-grid,
.settings-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.settings-home-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  min-height: 190px;
}

.settings-card-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.settings-home-card strong {
  font-size: 21px;
}

.settings-home-card small,
.settings-home-card em,
.settings-module-card p {
  color: var(--muted);
  line-height: 1.35;
}

.settings-home-card em {
  font-style: normal;
  font-weight: 700;
}

.settings-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 900;
}

.settings-module-card {
  display: grid;
  align-content: space-between;
  gap: 16px;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.settings-module-card h3 {
  margin: 10px 0 6px;
  font-size: 22px;
}

.settings-module-actions,
.settings-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-rule-list {
  display: grid;
  gap: 0;
}

.settings-general-form {
  display: grid;
  gap: 18px;
}

.settings-form-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdf8;
}

.settings-form-section h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.settings-check-grid,
.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.settings-status-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.settings-status-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 6px;
}

.settings-status-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.settings-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-toggle,
.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.permission-toggle {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.permission-toggle.critical {
  border-color: #edd0b3;
  background: #fff8ed;
}

.permission-toggle input,
.inline-check input {
  width: auto;
  min-height: auto;
}

.permission-toggle small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.quick-amount-panel {
  display: grid;
  align-content: end;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-amounts {
  width: 100%;
  grid-auto-columns: 1fr;
}

.quick-amounts button {
  white-space: nowrap;
}

.workflow-tabs {
  margin: 0 0 16px;
  width: 100%;
  grid-auto-columns: minmax(0, 1fr);
}

.pos-panel,
.pos-list,
.reservation-strip,
.checkout-options {
  margin-top: 16px;
}

.reservation-strip,
.checkout-options {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-muted);
}

.reservation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.reservation-card:first-of-type {
  border-top: 0;
}

.reservation-card div {
  display: grid;
  gap: 3px;
}

.reservation-card span,
.reservation-card small,
.checkout-options small {
  color: var(--muted);
  font-weight: 700;
}

.reservation-item-stack {
  display: grid;
  gap: 5px;
  min-width: 140px;
  align-items: stretch;
  font-size: 0.84rem;
  line-height: 1.18;
  white-space: normal;
}

.reservation-item-line {
  display: grid;
  gap: 2px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  white-space: normal;
}

.reservation-item-line:last-child {
  border-bottom: 0;
}

.reservation-item-line strong {
  color: var(--ink);
  font-weight: 800;
  white-space: normal;
}

.reservation-item-line small,
.reservation-item-detail {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

.reservation-mode-tabs {
  margin-bottom: 14px;
}

.reservation-filters {
  align-items: flex-end;
}

.packlist-group-row td {
  background: var(--surface-muted);
  color: var(--green-strong);
  font-weight: 800;
  letter-spacing: 0;
}

.packlist-check {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--green-strong);
  border-radius: 4px;
}

.pack-summary {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pack-summary h3 {
  margin: 0;
  font-size: 22px;
}

.pack-summary-total td {
  background: var(--surface-muted);
  font-weight: 800;
}

.attention-row {
  background: #fff7e5;
}

.checkout-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: end;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 800;
}

.inline-check input {
  width: 18px;
  height: 18px;
}

.balance-metric {
  min-height: 96px;
}

.dispense-live-check {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dispense-live-check div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-muted);
  display: grid;
  gap: 4px;
}

.dispense-live-check span,
.dispense-live-check em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.dispense-live-check strong {
  font-size: 24px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-hub {
  margin-bottom: 16px;
}

.report-hub .panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.report-category-tabs {
  margin-top: 14px;
  max-width: 100%;
}

.report-category-tabs button {
  display: grid;
  gap: 1px;
  min-width: 108px;
}

.report-category-tabs small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.report-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.report-category-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-height: 112px;
  padding: 13px;
  text-align: left;
  cursor: pointer;
}

.report-category-card span,
.report-category-card strong,
.report-category-card small {
  display: block;
}

.report-category-card span {
  color: var(--muted);
  font-weight: 900;
}

.report-category-card strong {
  margin: 8px 0;
  font-size: 30px;
  line-height: 1;
}

.report-category-card small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
}

.report-category-card:hover,
.report-category-card:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(91, 192, 65, 0.16);
  outline: 0;
}

@media (max-width: 1180px) {
  .report-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .report-category-grid {
    grid-template-columns: 1fr;
  }
}

.metric-grid + .panel {
  margin-top: 16px;
}

.report-card,
.doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  min-height: 170px;
}

.report-card p,
.doc-card p {
  color: var(--muted);
  min-height: 44px;
}

.export-selection-card {
  grid-column: span 2;
}

.export-source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 14px;
  padding-right: 4px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  color: var(--text);
  background: var(--surface);
}

.check-row input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.check-row span {
  display: grid;
  gap: 2px;
}

.check-row small {
  color: var(--muted);
  font-size: 12px;
}

.mini-table {
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 10px 0 14px;
  max-height: 150px;
}

.mini-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 6px;
  text-align: left;
  white-space: nowrap;
}

.brand-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(5, 45, 32, 0.97), rgba(12, 72, 47, 0.94)),
    radial-gradient(circle at 85% 15%, rgba(134, 201, 71, 0.22), transparent 32%);
  color: #fff;
  padding: 22px;
  box-shadow: var(--shadow);
}

.brand-hero h2 {
  font-size: clamp(23px, 3vw, 34px);
  margin-bottom: 8px;
}

.brand-hero p {
  max-width: 760px;
  color: #dbeed5;
  margin-bottom: 0;
}

.hero-logo {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  justify-self: end;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px;
}

.dashboard-metrics {
  margin-top: 16px;
}

.dashboard-metrics .metric {
  min-height: 118px;
}

.dashboard-metrics .metric strong {
  font-size: 30px;
}

.dashboard-hero-compact {
  grid-template-columns: minmax(0, 1fr) 150px;
  padding: 16px 18px;
  margin-top: 16px;
  margin-bottom: 0;
}

.dashboard-hero-compact h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin-bottom: 0;
}

.dashboard-hero-compact .hero-logo {
  max-height: 104px;
  padding: 8px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.doc-card {
  min-height: 154px;
}

.doc-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.doc-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.doc-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf8;
  padding: 14px;
}

.doc-kpi span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.doc-kpi strong {
  display: block;
  margin-top: 7px;
  font-size: 23px;
}

.template-link {
  color: var(--green-strong);
  font-weight: 800;
  text-decoration: none;
}

.template-link:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: #17251d;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 16, 10, 0.58);
  padding: 18px;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .brand div:last-child,
  .nav-item span:last-child,
  .sidebar-toggle span:last-child,
  .sidebar-footer span:last-child {
    display: none;
  }

  .sidebar-toggle {
    width: 42px;
    min-height: 38px;
    margin-inline: auto;
    padding: 0;
  }

  .nav-group summary {
    display: flex;
    justify-content: center;
    min-height: 38px;
    padding: 0;
  }

  .nav-group-label {
    justify-content: center;
  }

  .nav-group-label > span:last-child {
    display: none;
  }

  .nav-group-chevron {
    display: none;
  }

  .nav-group,
  .nav-group[open] .nav-group-items {
    display: grid;
  }

  .nav-group:not([open]) .nav-group-items {
    display: none;
  }

  .nav-group {
    border-top: 0;
    padding-top: 0;
  }

  .brand-logo {
    width: 48px;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .metric-grid,
  .shortcut-grid,
  .report-grid,
  .doc-grid,
  .doc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .finance-layout {
    grid-template-columns: 1fr;
  }

  .finance-nav-panel {
    position: static;
    grid-template-columns: 1fr;
  }

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

  .finance-nav-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .finance-nav-actions .full {
    width: auto;
    flex: 1 1 180px;
  }

  .finance-context-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-context-actions {
    justify-content: flex-start;
  }

  .strain-overview-grid {
    grid-template-columns: 1fr;
  }

  .export-selection-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: block;
    height: auto;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 3px solid var(--leaf);
    border-bottom: 0;
    box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.24);
  }

  .brand,
  .sidebar-toggle,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    max-height: 58px;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 0 0 3px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-list-legacy,
  .nav-list-legacy[hidden] {
    display: none !important;
  }

  .nav-group {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    border-top: 0;
    padding-top: 0;
  }

  .nav-group summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    padding: 0 6px;
    border: 1px solid rgba(219, 232, 218, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #dbe8da;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.1;
    text-transform: none;
  }

  .nav-group-label {
    display: grid;
    justify-items: center;
    gap: 3px;
  }

  .nav-group-label > span:last-child {
    display: none;
  }

  .nav-group-icon {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(219, 232, 218, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
  }

  .nav-group-icon svg {
    width: 18px;
    height: 18px;
  }

  .nav-group[open] summary,
  .nav-group.mobile-active summary {
    background: #123420;
    box-shadow: inset 3px 0 0 var(--leaf);
    color: #fff;
  }

  .nav-group-chevron {
    display: none;
  }

  .nav-group:not([open]) .nav-group-chevron {
    transform: rotate(0deg);
  }

  .nav-group[open] .nav-group-chevron {
    transform: rotate(180deg);
  }

  .nav-group-items,
  .nav-group:not([open]) .nav-group-items {
    display: none;
  }

  .nav-group[open] .nav-group-items {
    position: fixed;
    right: 8px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 8px;
    z-index: 31;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: min(46vh, 320px);
    overflow-y: auto;
    border: 1px solid rgba(134, 201, 71, 0.42);
    border-radius: 12px;
    background: #07150e;
    padding: 10px;
    box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.28);
  }

  .nav-item {
    width: 100%;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    justify-items: stretch;
    align-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 7px 9px;
  }

  .nav-item span:last-child {
    display: block;
    max-width: none;
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.15;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-icon {
    width: 26px;
    height: 24px;
    font-size: 10px;
  }

  .workspace {
    padding: 12px 10px calc(88px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  h1 {
    font-size: clamp(26px, 9vw, 34px);
    line-height: 1;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
  }

  .search-wrap {
    order: 1;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    height: 42px;
  }

  #quickAction {
    order: 2;
    grid-column: span 2;
  }

  #annualDocAction {
    order: 3;
  }

  #anonymizeAction {
    order: 4;
  }

  #backupAction {
    order: 5;
  }

  .top-actions a[href="logout.php"] {
    order: 6;
  }

  #dashboard .dashboard-shortcuts,
  #dashboard .dashboard-hero-compact,
  #dashboard .dashboard-metrics,
  #dashboard .dashboard-focus-grid,
  #dashboard > .content-grid {
    display: none;
  }

  .mobile-dashboard {
    display: grid;
    gap: 12px;
  }

  .mobile-dashboard-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 12px;
  }

  .mobile-dashboard-card h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
  }

  .mobile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .mobile-action-button,
  .mobile-metric-card,
  .mobile-detail-row,
  .mobile-overview-button,
  .mobile-area-row {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-align: left;
  }

  .mobile-action-button {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 2px 8px;
    align-items: center;
    min-height: 68px;
    padding: 8px;
  }

  .mobile-action-button span {
    display: grid;
    grid-row: span 2;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--green);
    font-weight: 900;
  }

  .mobile-action-button strong,
  .mobile-overview-button strong,
  .mobile-area-row strong {
    min-width: 0;
    font-size: 14px;
    line-height: 1.15;
  }

  .mobile-action-button small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dashboard-motto {
    background:
      linear-gradient(135deg, rgba(5, 45, 32, 0.98), rgba(12, 72, 47, 0.95)),
      radial-gradient(circle at 90% 10%, rgba(134, 201, 71, 0.2), transparent 30%);
    color: #fff;
  }

  .mobile-dashboard-motto .eyebrow {
    margin-bottom: 6px;
    color: #dbeed5;
  }

  .mobile-dashboard-motto h2 {
    font-size: clamp(20px, 7vw, 26px);
    line-height: 1.12;
  }

  .mobile-detail-list,
  .mobile-area-list {
    display: grid;
    gap: 7px;
  }

  .mobile-detail-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    align-items: center;
    padding: 9px;
  }

  .mobile-detail-row span,
  .mobile-metric-card span,
  .mobile-overview-button span,
  .mobile-area-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-detail-row strong {
    grid-column: 1 / -1;
    min-width: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.25;
  }

  .mobile-detail-row em {
    justify-self: end;
    font-style: normal;
  }

  .mobile-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-metric-card {
    min-height: 92px;
    padding: 11px;
    position: relative;
    overflow: hidden;
  }

  .mobile-metric-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 54px;
    height: 4px;
    background: var(--leaf);
  }

  .mobile-metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(22px, 8vw, 30px);
    line-height: 1;
  }

  .mobile-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-overview-button {
    display: grid;
    gap: 5px;
    min-height: 72px;
    padding: 9px;
  }

  .mobile-area-row {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 9px;
  }

  .primary-button,
  .secondary-button,
  .icon-button {
    min-height: 38px;
    padding-inline: 8px;
    font-size: 13px;
  }

  .icon-button {
    width: 100%;
  }

  .metric-grid,
  .shortcut-grid,
  .report-grid,
  .doc-grid,
  .doc-kpis,
  .form-grid,
  .settings-permission-grid,
  .settings-home-grid,
  .settings-module-grid,
  .settings-section-nav,
  .dispense-live-check,
  .checkout-options,
  .export-source-list,
  .label-workbench {
    grid-template-columns: 1fr;
  }

  .settings-hero-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-section-button {
    min-height: 68px;
  }

  .metric {
    min-height: 96px;
    padding: 14px;
  }

  .metric strong,
  .dashboard-metrics .metric strong {
    font-size: 26px;
  }

  .compact-metrics .metric strong {
    font-size: 24px;
  }

  .shortcut-button {
    min-height: 48px;
  }

  .content-grid {
    gap: 12px;
    margin-top: 12px;
  }

  .panel {
    padding: 13px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header .toolbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .toolbar > *,
  .table-tools > * {
    width: 100%;
  }

  .toolbar label,
  .table-tools label {
    width: 100%;
  }

  .toolbar .wide {
    flex-basis: auto;
  }

  .table-column-menu {
    position: static;
    width: 100%;
    max-height: 260px;
    margin-top: 6px;
  }

  .segmented {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .segmented button {
    flex: 1 0 auto;
    min-height: 38px;
  }

  .pagination {
    justify-content: stretch;
    gap: 8px;
  }

  .pagination .secondary-button {
    flex: 1 1 0;
  }

  .pagination span {
    display: grid;
    min-width: 88px;
    place-items: center;
    text-align: center;
  }

  .table-wrap {
    margin-inline: -4px;
    padding-inline: 4px;
    scrollbar-width: thin;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  table {
    min-width: 640px;
    font-size: 14px;
  }

  th,
  td {
    padding: 9px 7px;
  }

  th {
    font-size: 11px;
  }

  .action-cell {
    gap: 6px;
  }

  .action-cell .compact-button {
    min-height: 34px;
  }

  .detail-row {
    display: grid;
    gap: 4px;
  }

  .detail-row strong,
  .dashboard-alert-row strong {
    text-align: left;
  }

  .dashboard-alert-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .transport-row {
    grid-template-columns: 1fr;
  }

  .report-card,
  .doc-card {
    min-height: auto;
    padding: 15px;
  }

  .report-card p,
  .doc-card p {
    min-height: 0;
  }

  .brand-hero {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }

  .brand-hero h2,
  .dashboard-hero-compact h2 {
    font-size: clamp(23px, 8vw, 30px);
    line-height: 1.12;
  }

  .dashboard-hero-compact {
    margin-top: 12px;
  }

  .hero-logo {
    justify-self: start;
    max-width: 150px;
    max-height: 92px;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 6px;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 86px);
    padding: 12px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding-inline: 8px;
  }

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

  .search-wrap,
  #quickAction {
    grid-column: 1 / -1;
  }

  .primary-button,
  .secondary-button,
  .icon-button {
    min-height: 36px;
    font-size: 12px;
  }

  .nav-item {
    min-height: 46px;
  }

  .nav-item span:last-child {
    font-size: 12px;
  }

  .nav-group {
    flex: 1 1 0;
  }

  .nav-group summary {
    min-height: 50px;
    padding-inline: 4px;
    font-size: 10px;
  }

  .nav-group[open] .nav-group-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-subnav {
    grid-template-columns: 1fr;
  }

  .finance-task-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .finance-task-row em {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .finance-action-strip {
    display: grid;
  }

  .metric {
    min-height: 90px;
  }

  .mobile-action-grid,
  .mobile-metric-grid,
  .mobile-overview-grid {
    grid-template-columns: 1fr;
  }

  .mobile-action-button {
    min-height: 58px;
  }

  .mobile-area-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-area-row strong {
    grid-column: 1 / -1;
  }

  .metric strong,
  .dashboard-metrics .metric strong {
    font-size: 24px;
  }

  .panel,
  .report-card,
  .doc-card {
    padding: 11px;
  }

  .brand-hero {
    padding: 14px;
  }

  .hero-logo {
    max-width: 150px;
  }

  .label-abgabe,
  .label-abgabe-90x32,
  .plant-label {
    transform-origin: top left;
  }
}

@media (hover: none) {
  .primary-button:hover,
  .secondary-button:hover,
  .icon-button:hover,
  .shortcut-button:hover {
    box-shadow: none;
    transform: none;
  }
}
