:root {
  --paper: #f6f4ef;
  --white: #fff;
  --ink: #2d2d2b;
  --muted: #686863;
  --line: #d8d8d0;
  --green: #345c49;
  --green-light: #edf3ee;
  --clay: #b45538;
  --gold: #d6ad55;
  --blue: #54798c;
  --radius: 4px;
  --row: 44px;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  font-size: 14px;
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--green);
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 9px 14px;
  border-radius: var(--radius);
  color: var(--ink);
}
button:hover {
  border-color: var(--green);
  background: var(--green-light);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover {
  background: #284938;
  color: white;
}
.danger {
  color: #973e2f;
}
.text-button {
  border: 0;
  background: none;
  padding: 4px;
  color:var(--ink);
  text-decoration: underline;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--ink);
  max-width: 100%;
}
input[type="checkbox"] {
  accent-color: var(--green);
}
textarea {
  min-height: 100px;
  width: 100%;
  resize: vertical;
}
a {
  color:var(--ink);
  text-decoration: none;
}
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  padding: 30px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
}
.brand {
  font-size: 25px;
  letter-spacing: 0.18em;
  font-weight: 650;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 0.15em;
  margin: 9px 0 40px;
  color: var(--muted);
}
.nav-group {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 28px 12px 8px;
}
.nav a {
  display: flex;
  justify-content: space-between;
  padding: 11px 13px;
  margin: 3px 0;
  border-radius: var(--radius);
  color: var(--muted);
}
.nav a.active {
  background: var(--green);
  color: white;
}
.nav a:hover {
  background: var(--green-light);
  color:var(--ink);
}
.sidebar-footer {
  position: absolute;
  bottom: 24px;
  color: var(--muted);
  font-size: 11px;
}
.main {
  min-width: 0;
}
.topbar {
  height: 70px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(246, 244, 239, 0.95);
}
.topbar .account {
  display: flex;
  gap: 20px;
  align-items: center;
}
.topbar .eyebrow {
  font-size: 11px;
  letter-spacing: 0.13em;
}
.content {
  padding: 32px 38px 80px;
  max-width: 1600px;
  margin: auto;
}
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.page-title h1 {
  font-weight: 550;
  font-size: 30px;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.page-title p,
.muted {
  color: var(--muted);
}
.page-title p {
  margin: 0;
  line-height: 1.7;
}
.kicker {
  font-size: 10px;
  color:var(--ink);
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.toolbar input[type="search"] {
  width: 250px;
}
.toolbar .right {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
  margin-bottom: 20px;
}
.panel h2 {
  font-size: 20px;
  font-weight: 550;
  margin: 0 0 20px;
}
.grid-wrap {
  overflow: auto;
  max-height: 65vh;
  border: 1px solid var(--line);
  background: var(--white);
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
th,
td {
  height: var(--row);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e7e8e1;
  font-weight: 400;
}
th {
  font-size: 12px;
  color: var(--muted);
  background: #f0f1eb;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}
th button {
  border: none;
  background: none;
  padding: 4px 0;
  font-size: 12px;
  color: inherit;
}
td:first-child,
th:first-child {
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 1;
  min-width: 155px;
  border-right: 1px solid #e7e8e1;
}
th:first-child {
  background: #f0f1eb;
  z-index: 3;
}
td.num,
th.num {
  text-align: right;
}
.cell-input {
  padding: 6px 8px;
  width: 100px;
  border-color: transparent;
  background: transparent;
  text-align: right;
}
.cell-input:hover,
.cell-input:focus {
  border-color: var(--line);
  background: #fff;
}
.cell-input.text {
  width: 140px;
  text-align: left;
}
.dirty {
  background: var(--surface-warning) !important;
  border-bottom-color: var(--gold);
}
.status {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 2px;
  background: var(--surface-subtle);
  color:var(--ink);
}
.status.warning {
  background: var(--surface-warning);
  color: #755919;
}
.status.error {
  background: #fbece5;
  color: #8b402f;
}
.identity {
  font-weight: 550;
}
.identity small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 10px;
  margin-top: 4px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.pagination .buttons {
  display: flex;
  gap: 10px;
}
.savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--ink);
  color: white;
  position: sticky;
  bottom: 14px;
  margin-top: 18px;
  border-radius: var(--radius);
  z-index: 6;
}
.savebar button {
  font-size: 13px;
}
.savebar .hint {
  font-size: 11px;
  color: #d6d8d1;
  margin-top: 4px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0;
}
.stat {
  padding: 18px 0;
  border-top: 2px solid var(--green);
}
.stat:nth-child(2) {
  border-color: var(--clay);
}
.stat:nth-child(3) {
  border-color: var(--blue);
}
.stat .number {
  font-size: 40px;
  font-weight: 500;
  margin: 12px 0;
}
.stat small {
  color: var(--muted);
}
.module-list {
  border-top: 1px solid var(--line);
}
.module-link {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.module-link .index {
  font-size: 11px;
  color: var(--muted);
}
.module-link h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 5px;
}
.module-link .arrow {
  margin-left: auto;
  font-size: 24px;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-brand {
  background: var(--green);
  color: var(--paper);
  padding: 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand h1 {
  font-size: 56px;
  line-height: 1.3;
  font-weight: 450;
  letter-spacing: -0.04em;
}
.login-brand .line {
  width: 65px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 30px;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px;
}
.login-form form {
  width: 360px;
}
.login-form h2 {
  font-size: 30px;
  font-weight: 500;
  margin-bottom: 12px;
}
.login-form label {
  display: block;
  margin: 22px 0 8px;
}
.login-form input,
.login-form button {
  width: 100%;
}
.login-form button {
  margin-top: 30px;
  padding: 12px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  padding: 28px;
  max-width: 800px;
  width: calc(100% - 32px);
  max-height: 90vh;
}
dialog::backdrop {
  background: rgba(25, 31, 26, 0.4);
}
dialog h2 {
  font-size: 25px;
  font-weight: 500;
  margin: 0 0 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.form-grid label input,
.form-grid label select {
  display: block;
  width: 100%;
  margin-top: 7px;
}
.form-grid .span {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.detail-hero h2 {
  margin: 0 0 8px;
}
.detail-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.detail-sections dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  margin: 0;
}
.detail-sections dt {
  color: var(--muted);
}
.detail-sections dd {
  margin: 0;
}
.empty {
  text-align: center;
  padding: 44px;
  color: var(--muted);
}
#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 12px 22px;
  background: var(--ink);
  color: white;
  display: none;
  max-width: 90vw;
}
.error-text {
  color: #973e2f;
  line-height: 1.6;
}
.notice {
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: var(--surface-warning);
  margin-bottom: 20px;
  line-height: 1.7;
}
.schedule-grid td:first-child {
  min-width: 170px;
}
.schedule-grid select {
  width: 115px;
  font-size: 12px;
}
.mobile-brand {
  display: none;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}
.page-subnav {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0;
}
.page-subnav button {
  border: 0;
  background: none;
  border-bottom: 2px solid transparent;
  padding: 12px 0;
}
.page-subnav button.active {
  border-bottom-color: var(--green);
  color:var(--ink);
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .sidebar {
    padding: 25px 12px;
  }
  .brand {
    font-size: 22px;
  }
  .content {
    padding: 28px 24px 65px;
  }
  .topbar {
    padding: 0 24px;
  }
  .detail-sections {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 40px;
  }
  .login-brand h1 {
    font-size: 42px;
  }
}
@media (max-width: 640px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 20px 16px 0;
    border-right: 0;
  }
  .brand-sub,
  .sidebar-footer,
  .nav-group {
    display: none;
  }
  .brand {
    font-size: 22px;
    margin-bottom: 14px;
  }
  .nav {
    display: flex;
    overflow: auto;
    gap: 3px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
  }
  .nav a {
    white-space: nowrap;
    margin: 0;
    padding: 9px 12px;
    font-size: 12px;
  }
  .nav a span:last-child {
    display: none;
  }
  .topbar {
    height: 48px;
    padding: 0 16px;
    font-size: 11px;
  }
  .topbar .account {
    gap: 10px;
  }
  .content {
    padding: 24px 16px 80px;
  }
  .page-title {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
  }
  .page-title h1 {
    font-size: 26px;
  }
  .page-title p {
    font-size: 12px;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar input[type="search"] {
    width: 100%;
  }
  .toolbar .right {
    margin-left: 0;
  }
  .stats {
    gap: 15px;
  }
  .stat .number {
    font-size: 30px;
  }
  .module-link {
    padding: 18px 0;
    gap: 16px;
  }
  .module-link h2 {
    font-size: 18px;
  }
  .grid-wrap {
    max-height: 60vh;
  }
  td,
  th {
    padding: 8px 10px;
  }
  td:first-child,
  th:first-child {
    min-width: 125px;
  }
  .savebar {
    padding: 12px;
    flex-wrap: wrap;
    bottom: 8px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span {
    grid-column: auto;
  }
  .login {
    display: block;
  }
  .login-brand {
    padding: 24px;
    min-height: 180px;
  }
  .login-brand h1 {
    font-size: 28px;
    margin: 20px 0;
  }
  .login-brand .line {
    margin: 0;
    width: 40px;
  }
  .login-brand .footer {
    display: none;
  }
  .login-form {
    padding: 35px 24px;
  }
  .panel {
    padding: 18px;
  }
  .detail-hero {
    flex-wrap: wrap;
  }
  .pagination {
    flex-wrap: wrap;
  }
  .cell-input {
    min-height: 36px;
  }
  .notice {
    font-size: 12px;
  }
}

/* Access matrix only; other module tables keep their existing layout. */
.access-page .access-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin-bottom: 20px; }
.access-page .access-toolbar label { min-width: 180px; }
.access-page .access-toolbar label.access-filter-select { min-width: 110px; width: 110px; }
.access-page .access-toolbar label.access-permission-filter { width: 220px; max-width: 100%; }
.access-page .access-toolbar .form-actions { margin-left: auto; }
.access-page .access-scroll { overflow: auto; max-height: 720px; isolation: isolate; }
.access-page { --access-account-width: 180px; --access-manage-width: 56px; --access-role-width: 140px; --access-scope-width: 160px; --access-permission-width: 64px; }
.access-page table { width: calc(var(--access-account-width) + var(--access-manage-width) + var(--access-role-width) + var(--access-scope-width) + var(--access-permission-count) * var(--access-permission-width) + var(--access-merged-count) * 8px); table-layout: fixed; }
.access-page col.access-id-col { width: var(--access-account-width); }
.access-page col.access-manage-col { width: var(--access-manage-width); }
.access-page col.access-merged-col { width: calc(var(--access-permission-width) + 8px); }
.access-page col.access-role-col { width: var(--access-role-width); }
.access-page col.access-scope-col { width: var(--access-scope-width); }
.access-page col.access-permission-col { width: var(--access-permission-width); }
.access-page th, .access-page td { min-width: 0; padding: 6px 4px; font-size: 12px; white-space: normal; text-align: center; vertical-align: middle; }
.access-page th small { display: block; font-size: 11px; color: var(--muted); font-weight: normal; }
.access-page thead { position: sticky; top: 0; z-index: 4; }
.access-page thead th { position: static; }
.access-page th.access-group { border-left: 1px solid var(--line); }
.access-page .access-account { position: sticky; left: 0; z-index: 2; width: var(--access-account-width); min-width: var(--access-account-width); max-width: var(--access-account-width); text-align: left; background: var(--white); border-right: 1px solid var(--line); }
.access-page thead .access-account { position: sticky; left: 0; background: var(--paper); z-index: 5; }
.access-page .access-account strong, .access-page .access-account span, .access-page .access-account small { display: block; overflow-wrap: anywhere; }
.access-page .access-account small { color: var(--muted); margin: 4px 0; }
.access-page .access-account button, .access-page .access-manage button { font-size: 12px; padding: 5px 8px; }
.access-page select { width: 100%; min-width: 0; max-width: 100%; padding: 6px; font-size: 12px; min-height: 34px; }
.access-page .access-scope-select { position: relative; font-size: 12px; text-align: left; }
.access-page .access-scope-select summary, .access-page .access-scope-disabled { display: block; border: 1px solid var(--line); background: var(--white); border-radius: 4px; padding: 7px 18px 7px 6px; min-height: 34px; }
.access-page .access-scope-select summary { cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.access-page .access-scope-select summary::-webkit-details-marker { display: none; }
.access-page .access-scope-select summary::after { content: "⌄"; position: absolute; right: 6px; top: 7px; }
.access-page .access-scope-select[open] { z-index: 6; }
.access-page .access-scope-options { position: absolute; top: 100%; left: 0; width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 12px #0002; padding: 5px; max-height: 240px; overflow-y: auto; }
.access-page .access-scope-options label { display: flex; gap: 5px; align-items: center; padding: 5px 0; margin: 0; font-size: 12px; color: var(--ink); }
.access-page .access-scope-options input { width: 15px; height: 15px; min-height: 0; flex: 0 0 15px; margin: 0; padding: 0; }
.access-page .access-scope-disabled { color: var(--muted); }
.access-page .is-write { background: #f4e8d1; color: #72521d; border-color: #d8bc82; }
.access-page .access-toggle { width: 100%; min-width: 0; min-height: 32px; padding: 5px 2px; white-space: nowrap; font-size: 12px; }
.access-page .is-on { background: var(--surface-selected); color:var(--ink); border-color: #b1cbb8; }
.access-page .is-personal, .access-page .access-personal-label { background: var(--surface-info); color: var(--ink); border-color: #bed0e9; }
.access-page .is-off { background: #efefed; color:var(--muted); border-color: #dfdfd9; }
.access-page .access-toggle:disabled { opacity: 1; cursor: default; }
.access-page .access-dirty td { background-color: #fff9e9; }
.access-page .access-scope-note { display: block; max-width: 100%; overflow-wrap: anywhere; font-size: 11px; color: var(--muted); margin-top: 5px; }
.access-page .access-range-help { font-size: 12px; color: var(--muted); max-width: 900px; }
.access-page .access-pagination { display: flex; gap: 14px; justify-content: end; align-items: center; margin-top: 16px; }
@media (max-width: 600px) {
  .access-page { --access-account-width: 135px; }
  .access-page .access-account { width: 135px; min-width: 135px; max-width: 135px; }
  .access-page .access-toolbar .form-actions { margin-left: 0; }
  .access-page .access-toolbar label { min-width: 0; width: 100%; }
  .access-page .access-scroll { max-height: 600px; }
}

/* Scheduling workspace: document scrolling, compact content, independent editors. */
body:has(.schedule-workspace) main, body:has(.schedule-workspace) #content {max-width:none;overflow:visible;}
.schedule-workspace {width:max-content;min-width:min(100%,700px);max-width:none;overflow:visible;}
.schedule-workspace .panel {padding:10px;width:max-content;min-width:100%;box-sizing:border-box;overflow:visible;}
.schedule-workspace table {width:auto;table-layout:auto;border-collapse:collapse;}
.schedule-workspace th,.schedule-workspace td {padding:4px 6px;white-space:nowrap;height:auto;}
.schedule-workspace .toolbar,.schedule-workspace .form-actions {gap:6px;}
.schedule-workspace button {padding:5px 8px;min-height:30px;}
.schedule-workspace .store-divider th {background:#e2e8dc;text-align:left;padding:5px 6px;}
.schedule-workspace .shift-divider th {background:#f1f2ea;text-align:left;padding:3px 6px;font-weight:500;}
.schedule-workspace td {position:relative;}
.schedule-workspace .staff-select,.staff-options button {display:flex;align-items:center;gap:4px;font-size:13px;white-space:nowrap;}
.schedule-workspace .staff-select {width:100%;min-width:72px;}
.staff-options {position:absolute;z-index:20;left:0;top:100%;width:max-content;background:#fff;border:1px solid #a5af9b;padding:4px;box-shadow:0 3px 12px #0002;}
.staff-options button {width:100%;border:0;background:transparent;text-align:left;padding:5px 6px;}
.staff-options button:hover,.staff-options button:focus {background:var(--surface-selected);}
.staff-options small {display:block;color:var(--muted);padding:3px 6px;}
.av-full,.booking-day.full strong {color:#79549b;}.av-lunch,.booking-day.lunch strong {color:#a95f0b;}.av-dinner,.booking-day.dinner strong {color:#276caa;}.av-none,.booking-count {color:var(--muted);}
.assigned-count {color:#276caa;font-variant-numeric:tabular-nums;}.assigned-count.over {color:#bc3535;}
.competence-grid input[type=number] {width:44px;padding:3px;min-height:28px;}
.schedule-workspace .skill-state {width:28px;height:28px;min-height:28px;padding:0;border:1px solid #99a68b;}
.skill-1 {background:#dbe7d0;color:var(--ink);}.skill-2 {background:#536748;color:white;}
.requirement-cell {display:flex;gap:4px;align-items:center;}.requirement-cell input[type=number] {width:38px;min-height:26px;padding:2px;}
.booking {min-width:0;width:min(100%,800px);}.booking table {width:100%;}.booking th small {display:block;white-space:normal;font-weight:400;}
.booking td {padding:2px;}.booking .booking-day {width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;background:transparent;border:0;min-height:64px;}.booking-day strong {align-self:center;font-size:24px;}.booking .weekend {background:#f1d7b7;}
.schedule-workspace {width:auto;min-width:0;}
.schedule-workspace .panel {width:max-content;min-width:0;}
.schedule-workspace th:first-child,.schedule-workspace td:first-child {min-width:0;}
.schedule-workspace.booking {width:min(100%,800px);}
.booking table {table-layout:fixed;}
.booking th:first-child {width:105px;}
@media (max-width:640px) {.booking th:first-child {width:72px;}.booking th,.booking td {padding:2px;font-size:11px;}.booking .booking-day {padding:3px 1px;min-height:56px;font-size:10px;}.booking-day strong {font-size:21px;}}
.schedule-workspace #schedule-warning {max-width:760px;white-space:normal;overflow-wrap:anywhere;}
body:has(.schedule-workspace) #toast {height:max-content;align-self:start;bottom:auto;}
.schedule-workspace .schedule-warnings {max-width:760px;white-space:normal;overflow-wrap:anywhere;}
.schedule-workspace .schedule-warnings p {margin:4px 0;}

/* Supply forms and master-data tables: keep changes scoped to these pages. */
.supply-controls .form-actions { margin: 0 0 16px; }
.supply-list-search { display: grid; gap: 6px; margin: 16px 0; }
.supply-list-search input { width: 100%; }
.supply-modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.supply-modal-heading h2, .supply-modal-heading .form-actions { margin: 0; }
.supply-entry-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.6fr) minmax(0,1fr); gap: 12px; margin-top: 16px; }
.supply-entry-filters label { display: grid; gap: 6px; min-width: 0; }
.supply-entry-filters input, .supply-entry-filters select { width: 100%; min-width: 0; }
.supply-sku-code { display: block; font-size: 10px; color:var(--muted); font-weight: 400; }
.item-settings-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.code-generator { display: flex; align-items: center; gap: 6px; min-width: 0; }
.code-generator input { flex: 1; width: 0; min-width: 0 !important; }
.code-generator button { flex: none; white-space: nowrap; padding: 9px 8px; font-size: 13px; }
.item-settings .code-generator { flex-direction: column; align-items: stretch; }
.item-settings .code-generator input { flex: auto; width: 100%; }
.item-settings-tabs .active { background: var(--ink); color: white; }
.item-settings .form-actions { flex-wrap: wrap; }
.item-settings-scroll table { width: max-content; min-width: 100%; }
.item-settings-scroll th { position: sticky; top: 0; background: var(--white); z-index: 2; }
.item-settings-scroll td { vertical-align: top; }
.item-settings-scroll input:not([type=checkbox]), .item-settings-scroll select { width: 150px; }
.item-settings-scroll td:nth-child(2) input { width: 180px; }
.item-settings-scroll td:first-child, .item-settings-scroll th:first-child { position: sticky; left: 0; background: var(--white); z-index: 1; }
.item-settings-scroll th:first-child { z-index: 3; }
.item-choice { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.item-choice input { margin: 0; }
.item-conversion { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
@media (max-width: 640px) {
  .supply-entry-filters { gap: 6px; font-size: 12px; }
  .supply-entry-filters input, .supply-entry-filters select { padding: 8px 5px; }
  .supply-modal-heading h2 { font-size: 20px; }
  .supply-modal-heading .form-actions { gap: 6px; flex-shrink: 0; }
  .supply-modal-heading button { padding: 8px 12px; }
}

.supply-entry-table table { table-layout: fixed; width: 100%; }
.supply-entry-table th:first-child, .supply-entry-table td:first-child { width: 45%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.supply-entry-table th:nth-child(2) { width: 20%; }
.supply-entry-table input { width: 100%; min-width: 0; }
/* Supply preparation: compact pages; configuration follows the document scroll. */
#toast { top:18px; bottom:auto; height:max-content; max-height:none; }
.supply-page .page-title {align-items:center;margin-bottom:12px;gap:12px}
.supply-page > .page-title p {display:none}
.supply-page .panel {padding:14px 16px;margin-bottom:12px}
.supply-filter-row {display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.supply-filter-row label {flex:1 1 140px;min-width:0;margin:0}
.supply-filter-row input,.supply-filter-row select {width:100%;padding:6px 8px}
.supply-page td,.supply-page th,.supply-editor td,.supply-editor th {padding:6px 8px}
.supply-material {display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.supply-material span {overflow-wrap:anywhere}
.supply-material small {white-space:nowrap;color:var(--muted);margin:0}
.supply-category th {background:var(--green-light);font-weight:600;text-align:left}
.supply-page table,.supply-editor table {width:100%;table-layout:fixed}
.supply-page td,.supply-page th {overflow-wrap:anywhere}
.supply-page .grid-wrap {overflow:visible;max-height:none}
.supply-page .form-actions {gap:8px;margin-top:10px}
.supply-editor label {margin:0}
.supply-editor input,.supply-editor select {padding:5px 7px}
.supply-settings-tabs {display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.supply-settings-tabs .active {background:var(--green-light);color:var(--ink)}
.supply-settings .config-search {display:inline-flex;align-items:center;gap:8px;margin-bottom:12px}
.supply-settings input:not([type=checkbox]),.supply-settings select {width:100%;min-width:0;padding:4px;font-size:12px}
.supply-settings td label {margin:0;display:block;font-size:12px}
.supply-settings td {vertical-align:top;padding:5px}
.supply-settings th {font-size:12px;padding:5px}
.supply-config-table th:nth-child(1) {width:7%}
.supply-config-table th:nth-child(2) {width:12%}
.supply-config-table td input:disabled,.supply-config-table td select:disabled {background:#deded8;color:#85857d;opacity:1}
.supply-completed > summary {padding:10px 12px;background:var(--green-light);cursor:pointer;margin-bottom:10px}
@media(max-width:1100px) {
 .supply-settings .supply-config-table thead {display:none}
 .supply-settings .supply-config-table,.supply-settings .supply-config-table tbody {display:block}
 .supply-settings .supply-config-table tr:not([hidden]) {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--line);margin-bottom:10px;padding:6px}
 .supply-settings .supply-config-table td {display:block;border:0;min-width:0}
 .supply-settings .supply-config-table td::before {content:attr(data-label);display:block;font-size:12px;color:var(--muted);margin-bottom:3px}
}
@media(max-width:600px) {
 .supply-settings .supply-config-table tr:not([hidden]) {grid-template-columns:repeat(2,minmax(0,1fr))}
 .supply-page .panel {padding:10px}
 .supply-material {gap:4px;flex-wrap:wrap}
 .supply-page .page-title {flex-wrap:wrap}
}
/* Master-data cells shrink with their columns; no grid wrapper or sticky scroll area. */
.item-settings-table {overflow:visible;min-width:0}
.item-settings .config-search,.item-settings .supply-list-search {max-width:360px}
.supply-settings .item-choice {white-space:normal;overflow-wrap:anywhere}
.supply-settings .item-choice input {flex-shrink:0}
.supply-settings table input:not([type=checkbox]),.supply-settings table select {min-width:0;max-width:100%;box-sizing:border-box}
.supply-settings label {min-width:0}
.supply-settings #config-note:empty,.supply-settings #config-error:empty,.supply-settings #config-dirty:empty {display:none}
.supply-editor .supply-material small {display:inline;white-space:nowrap}

.supply-category-toggle {display:flex;align-items:center;gap:.5rem;width:100%;border:0;border-radius:0;background:transparent;color:inherit;font:inherit;text-align:left;padding:.35rem .15rem;cursor:pointer}
.supply-category-toggle:hover {background:var(--green-light)}
.supply-category-toggle:focus-visible {outline:2px solid var(--green);outline-offset:2px}
.supply-category-arrow {width:1em;flex-shrink:0}

/* 1107-08: entity colour picker in the store settings dialog */
.org-colors{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;border:0;padding:0;margin:4px 0}
.org-colors legend{width:100%;font-size:13px;color:var(--muted);margin-bottom:4px}
.org-swatch{position:relative;display:inline-flex}
.org-swatch input{position:absolute;opacity:0;width:1px;height:1px}
.org-swatch span{display:block;width:26px;height:26px;border-radius:6px}
.org-swatch input:checked+span{box-shadow:0 0 0 2px #fff,0 0 0 4px #1f2a24}
.org-swatch input:focus-visible+span{outline:2px solid #437b87;outline-offset:3px}
.org-swatch.none span{width:auto;padding:0 8px;line-height:24px;border:1px solid var(--line,#d9ddd4);background:#fff;font-size:12px}
