:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #64736c;
  --line: #d7e0db;
  --panel: #ffffff;
  --soft: #f4f7f5;
  --field: #fbfcfb;
  --green: #1f6b50;
  --green-2: #2d8a68;
  --teal-soft: #e8f4ef;
  --amber-soft: #fff7df;
  --red: #b84242;
  --gold: #b9841c;
  --blue: #2d5f91;
  --shadow: 0 18px 48px rgba(24, 35, 30, 0.12);
  --shadow-soft: 0 2px 8px rgba(24, 35, 30, 0.06);
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7faf7 0%, #eef3ef 260px, #f3f5f4 100%);
  accent-color: var(--green);
}
button, input, select {
  font: inherit;
}
button {
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
  box-shadow: var(--shadow-soft);
  transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
button:hover {
  background: var(--green-2);
  box-shadow: 0 8px 18px rgba(31, 107, 80, 0.18);
}
button:active { transform: translateY(1px); }
button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}
button:focus-visible {
  outline: 3px solid rgba(31, 107, 80, 0.22);
  outline-offset: 2px;
}
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
input, select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input:focus, select:focus {
  border-color: #87b8a3;
  box-shadow: 0 0 0 3px rgba(31, 107, 80, 0.12);
}
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(24px, 5vw, 42px); line-height: 1.02; letter-spacing: 0; }
h2 { margin-bottom: 5px; font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.025em; }
h3 { margin-bottom: 14px; font-size: 17px; letter-spacing: -0.01em; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  background: #f7faf8;
  color: #4a5650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}
tbody tr:nth-child(even) td {
  background: #fcfdfb;
}
tbody tr:hover td {
  background: #f3f8f5;
}
tr.clickable-row {
  cursor: pointer;
}
tr.clickable-row:hover td {
  background: #eef6f1;
}
.table-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
}
.po-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.po-search-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}
.po-search-bar button {
  min-height: 38px;
}
.po-action {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 2px 5px rgba(24, 35, 30, 0.12);
}
.approve-action {
  background: var(--blue);
}
.approve-action:hover {
  background: #214f7d;
}
.receive-action {
  background: var(--green);
}
.disabled-action,
.disabled-action:hover {
  background: #e6ebe7;
  color: #8a968f;
  cursor: not-allowed;
  box-shadow: none;
}
.danger-action {
  background: var(--red);
}
.danger-action:hover {
  background: #9e3030;
}
code {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbf7;
  white-space: normal;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 18px; }
.eyebrow {
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(246,248,244,0.70), rgba(246,248,244,0.84)),
    image-set(
      url("/login-bg-1280.webp") type("image/webp") 1x,
      url("/login-bg-1920.webp") type("image/webp") 2x,
      url("/login-bg-1920.jpg") type("image/jpeg")
    ) center 42%/cover no-repeat;
}
.login-panel {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 34px;
  align-items: end;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.login-intro {
  align-self: center;
  display: grid;
  justify-items: center;
  text-align: center;
}
.login-logo {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  margin-bottom: 18px;
}
.stack { display: grid; gap: 14px; }
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}
.sidebar {
  background: rgba(253, 254, 253, 0.96);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 4;
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 6px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}
.brand small { display: block; color: var(--muted); margin-top: 3px; }
nav {
  display: grid;
  gap: 14px;
  overflow-y: auto;
  padding: 2px 4px 12px 0;
  scrollbar-width: thin;
}
.nav-group {
  display: grid;
  gap: 4px;
}
.nav-group-label {
  padding: 0 10px 3px;
  color: #89948e;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
nav button {
  width: 100%;
  justify-content: start;
  text-align: left;
  background: transparent;
  color: #344039;
  border: 1px solid transparent;
  min-height: 40px;
  box-shadow: none;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 10px;
  font-weight: 700;
}
nav button.active {
  background: #e8f3ee;
  color: var(--green);
  border-color: #c9ded4;
  box-shadow: inset 3px 0 0 var(--green), 0 1px 3px rgba(31, 107, 80, 0.08);
}
nav button:hover {
  background: #f0f5f2;
  color: var(--green);
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.content {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 32px);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(215, 224, 219, 0.82);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.topbar-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar .top-actions button {
  display: none !important;
}
.top-actions select { min-width: 220px; }
.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--teal-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.sync-status.offline {
  background: var(--amber-soft);
  color: #8a5a00;
}
.view { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 224, 219, 0.84);
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 20px);
  min-width: 0;
  box-shadow: var(--shadow-soft);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h3 {
  margin-bottom: 0;
}
.panel-head button {
  min-height: 34px;
}
.grid-two {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 16px;
  align-items: start;
}
.full-width-panel {
  grid-column: 1 / -1;
}
.commissary-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.commissary-main-panel,
.commissary-wide-panel {
  width: 100%;
}
.commissary-main-panel {
  display: grid;
  gap: 14px;
}
.commissary-form-grid {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.commissary-form-grid > label {
  min-width: 0;
}
.commissary-form-grid > label:nth-child(1) { grid-column: span 2; }
.commissary-form-grid > label:nth-child(2) { grid-column: span 4; }
.commissary-form-grid > label:nth-child(n+3) { grid-column: span 2; }
.commissary-form-grid input,
.commissary-form-grid select {
  min-width: 0;
}
.commissary-item-field {
  min-width: 0;
}
.commissary-allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  gap: 16px;
  align-items: stretch;
  max-width: 100%;
  min-width: 0;
}
.commissary-submit-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-left: 1px solid var(--line);
  padding-left: 16px;
  min-width: 0;
}
.commissary-submit-area button {
  width: 100%;
  max-width: 220px;
  white-space: normal;
}
.commissary-wide-panel .table-wrap {
  width: 100%;
}
.report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.product-sales-report-panel {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 14px 16px;
}
.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}
.report-filter-grid input[type="date"] {
  max-width: 170px;
}
.daily-inventory-filter-grid {
  grid-template-columns: minmax(180px, 1fr) auto auto;
}
.report-grid h3 {
  margin-bottom: 0;
}
.report-grid .report-actions {
  align-items: end;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
}
.report-grid .table-wrap {
  max-height: 420px;
}
.product-sales-tabs {
  align-items: center;
  background: #eef6f2;
  border: 1px solid #d5e4dc;
  border-radius: 16px;
  display: inline-flex;
  gap: 4px;
  justify-self: start;
  padding: 4px;
}
.product-sales-tabs .report-tab {
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: #456256;
  min-height: 38px;
  padding: 8px 18px;
}
.product-sales-tabs .report-tab.active {
  background: #1f7959;
  box-shadow: 0 8px 22px rgba(31, 121, 89, .2);
  color: #fff;
}
.product-sales-table-wrap {
  overflow: auto;
}
.product-sales-nested-table {
  border-collapse: collapse;
  border-spacing: 0;
  color: #000;
  font-size: 18px;
  min-width: 1120px;
  width: 100%;
}
.product-sales-nested-table th {
  background: #0f4f66;
  border: 1px solid #0b4256;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 7px 8px;
  text-align: left;
  text-transform: none;
  vertical-align: middle;
  white-space: nowrap;
}
.product-sales-nested-table th:first-child,
.product-sales-nested-table td:first-child {
  text-align: left;
}
.product-sales-nested-table .product-sales-sticky-col {
  background: #0f4f66;
  box-shadow: 5px 0 10px rgba(15, 79, 102, .12);
  left: 0;
  min-width: 260px;
  position: sticky;
  text-align: left;
  width: 260px;
  z-index: 3;
}
.product-sales-nested-table tbody .product-sales-sticky-col {
  background: inherit;
  color: #173328;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.product-sales-nested-table td {
  border: 1px solid #2a5a73;
  padding: 6px 8px;
  vertical-align: middle;
}
.product-sales-production-table th {
  min-width: 132px;
}
.product-sales-production-table th:first-child,
.product-sales-production-table td:first-child {
  min-width: 260px;
}
.product-sales-production-value {
  min-width: 132px;
  text-align: right;
}
.product-sales-receipt-cell {
  cursor: pointer;
  font-weight: 500;
}
.product-sales-receipt-cell:hover {
  background: #d6eef7;
  box-shadow: inset 0 0 0 2px #0f4f66;
}
.product-sales-row:nth-child(even):not(.product-sales-selected) {
  background: #c2e8f5;
}
.product-sales-row:nth-child(odd):not(.product-sales-selected) {
  background: #fff;
}
.product-sales-clickable {
  cursor: pointer;
}
.product-sales-clickable:hover {
  background: #d7f1f9;
}
.product-sales-selected {
  background: #c2e8f5;
}
.product-sales-main-cell {
  color: #000;
  font-weight: 500;
}
.product-sales-nested-cell {
  color: #264c3b;
  font-weight: 750;
  padding-left: 34px !important;
}
.product-sales-size-cell {
  color: #000;
  padding-left: 8px !important;
}
.product-sales-caret {
  color: #1f6b4d;
}
.product-sales-toggle {
  align-items: center;
  background: #edf5f1;
  border: 1px solid #cbded4;
  border-radius: 7px;
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}
.product-sales-level-1 {
  font-size: 13.5px;
}
.product-sales-level-2 {
  color: var(--muted);
  font-size: 13px;
}
.product-sales-qty {
  color: #000;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}
.product-sales-noodles-table {
  margin: 0 auto;
  max-width: 820px;
  min-width: 640px;
  width: 72%;
}
.product-sales-noodles-expanded-table {
  max-width: 860px;
  min-width: 720px;
}
.product-sales-noodles-table th:nth-child(1),
.product-sales-noodles-table td:nth-child(1) {
  width: 36%;
}
.product-sales-noodles-table th:nth-child(2),
.product-sales-noodles-table td:nth-child(2) {
  width: 28%;
}
.product-sales-noodles-table th:last-child,
.product-sales-noodles-table td:last-child {
  text-align: right;
  width: 18%;
}
.product-sales-noodles-expanded-table th:nth-child(1),
.product-sales-noodles-expanded-table td:nth-child(1) {
  width: 32%;
}
.product-sales-noodles-expanded-table th:nth-child(2),
.product-sales-noodles-expanded-table td:nth-child(2) {
  width: 26%;
}
.product-sales-noodles-expanded-table th:nth-child(3),
.product-sales-noodles-expanded-table td:nth-child(3) {
  width: 24%;
}
.product-sales-noodle-group {
  background: #c2e8f5;
  vertical-align: top !important;
}
.report-filter-field {
  display: grid;
  gap: 6px;
}
.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.multi-dropdown {
  position: relative;
}
.multi-dropdown-toggle {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  min-height: 40px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-dropdown-toggle::after {
  content: "v";
  color: var(--muted);
  font-size: 12px;
  margin-left: 10px;
}
.multi-dropdown-menu {
  position: absolute;
  z-index: 6;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.multi-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 7px;
  color: var(--ink);
}
.multi-option:hover {
  background: #f0f5f2;
}
.multi-option input {
  min-height: auto;
  width: auto;
}
.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
#adminUsersPanel { order: 1; }
#emailRecipientsPanel { order: 2; }
#adminProductsPanel { order: 3; }
#adminLocationsPanel { order: 4; }
#holidaySchedulePanel { order: 99; }
.panel {
  position: relative;
}
.card-collapse-toggle {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 30px;
  z-index: 3;
}
.panel.card-collapsible {
  padding-top: 48px;
}
.panel.card-collapsed {
  min-height: 76px;
  overflow: hidden;
}
.panel.card-collapsed > :not(.card-collapse-toggle):not(.panel-head):not(.section-heading):not(h3) {
  display: none !important;
}
.panel.card-collapsed > .panel-head,
.panel.card-collapsed > .section-heading {
  margin-bottom: 0;
}
.email-recipient-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.email-recipient-form button {
  white-space: nowrap;
}
.stock-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.6fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.transfer-wide-form {
  display: grid;
  gap: 14px;
}
.transfer-form-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.24fr);
  gap: 18px;
  align-items: stretch;
}
.transfer-form-fields {
  display: grid;
  gap: 12px;
}
.transfer-form-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.transfer-form-action button {
  width: 100%;
  max-width: 210px;
}
.sales-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(460px, 1.05fr);
  gap: 16px;
  align-items: start;
}
.sales-focus-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(520px, 1.2fr);
  gap: 16px;
  align-items: start;
}
.sales-column {
  display: grid;
  gap: 16px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.metric span, .metric-mini span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}
.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}
.metric small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.metric-mini {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbf8;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.unserved-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#dashUnserved th:first-child,
#dashUnserved td:first-child {
  width: 44px;
  text-align: center;
}
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.section-heading h3 { margin-bottom: 3px; }
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.dashboard-wide-panel {
  grid-column: 1 / -1;
}
.dashboard-half-panel {
  grid-column: span 1;
}
.admin-compact-notices #dashPoNotices {
  table-layout: fixed;
  min-width: 0;
}
.admin-compact-notices #dashPoNotices th,
.admin-compact-notices #dashPoNotices td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-compact-notices #dashPoNotices th:nth-child(1),
.admin-compact-notices #dashPoNotices td:nth-child(1) {
  width: 32%;
}
.admin-compact-notices #dashPoNotices th:nth-child(2),
.admin-compact-notices #dashPoNotices td:nth-child(2) {
  width: 30%;
}
.admin-compact-notices #dashPoNotices th:nth-child(3),
.admin-compact-notices #dashPoNotices td:nth-child(3) {
  width: 38%;
}
.consumption-trends-panel {
  overflow: hidden;
  padding: 0;
  border-color: rgba(112, 95, 198, 0.45);
  background:
    radial-gradient(circle at 50% 62%, rgba(120, 70, 255, 0.24), transparent 14rem),
    linear-gradient(180deg, #171833 0%, #111329 100%);
  box-shadow: 0 22px 58px rgba(19, 18, 48, 0.30);
}
.trend-chart-wrap {
  position: relative;
  min-height: 100%;
  padding: 16px 16px 12px;
  color: #f4f1ff;
}
.trend-chart-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.trend-chart-top h3 {
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.02em;
}
.trend-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.trend-grid-line {
  stroke: rgba(190, 197, 244, 0.15);
  stroke-width: 1;
}
.trend-axis-line {
  stroke: rgba(190, 197, 244, 0.18);
  stroke-width: 1.1;
}
.trend-axis-label {
  fill: #aab0d0;
  font-size: 11px;
  font-weight: 650;
}
.trend-axis-title {
  fill: #cbd1f3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.trend-fill {
  pointer-events: none;
}
.trend-fill-current {
  fill: url(#trendCurrentFill);
}
.trend-fill-last {
  fill: url(#trendLastFill);
}
.trend-line {
  fill: none;
  filter: url(#trendGlow);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}
.trend-line-current {
  stroke: #43dff2;
}
.trend-line-last {
  stroke: #b56cff;
}
.trend-dot {
  filter: url(#trendGlow);
  stroke: #171833;
  stroke-width: 1.5;
}
.trend-dot-current {
  fill: #43dff2;
}
.trend-dot-last {
  fill: #b56cff;
}
.trend-legend {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  color: #c5cae6;
  font-size: 12px;
  font-weight: 750;
}
.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.trend-swatch {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 999px;
}
.trend-current {
  background: #43dff2;
  box-shadow: 0 0 12px rgba(67, 223, 242, 0.70);
}
.trend-last {
  background: #b56cff;
  box-shadow: 0 0 12px rgba(181, 108, 255, 0.72);
}
.branch-variance-panel {
  overflow: hidden;
  padding: 0;
  border-color: rgba(112, 95, 198, 0.36);
  background:
    radial-gradient(circle at 18% 20%, rgba(67, 223, 242, 0.18), transparent 12rem),
    radial-gradient(circle at 84% 62%, rgba(181, 108, 255, 0.18), transparent 13rem),
    linear-gradient(180deg, #171833 0%, #111329 100%);
  box-shadow: 0 22px 58px rgba(19, 18, 48, 0.25);
}
.branch-variance-chart-wrap {
  min-height: 100%;
}
.branch-variance-chart .trend-axis-label {
  font-size: 10px;
}
.branch-variance-zero {
  stroke: rgba(244, 241, 255, 0.34);
  stroke-width: 1.4;
}
.branch-variance-bar {
  fill: var(--branch-color);
  filter: url(#branchVarianceGlow);
  opacity: .9;
  stroke: rgba(255, 255, 255, .32);
  stroke-width: 1;
}
.branch-variance-hit {
  cursor: pointer;
  outline: none;
}
.branch-variance-click-target {
  fill: transparent;
}
.branch-variance-hit:hover .branch-variance-bar,
.branch-variance-hit:focus .branch-variance-bar {
  opacity: 1;
  stroke: rgba(255, 255, 255, .75);
  stroke-width: 2;
}
.branch-variance-legend {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px 14px;
  padding: 0 2px;
}
.branch-variance-swatch {
  background: var(--branch-color);
  box-shadow: 0 0 12px rgba(67, 223, 242, 0.35);
}
.branch-variance-empty {
  color: #c5cae6;
  border: 1px dashed rgba(190, 197, 244, 0.22);
  background: rgba(255,255,255,0.04);
}
.warehouse-health-panel {
  overflow: hidden;
  padding: 18px !important;
  background:
    radial-gradient(circle at 16% 12%, rgba(67, 223, 242, 0.18), transparent 12rem),
    radial-gradient(circle at 88% 28%, rgba(181, 108, 255, 0.18), transparent 14rem),
    linear-gradient(180deg, #171833 0%, #101226 100%) !important;
  border-color: rgba(112, 95, 198, 0.48) !important;
  color: #fff;
  box-shadow: 0 22px 58px rgba(19, 18, 48, 0.28);
}
.warehouse-health-heading h3,
.warehouse-health-heading p {
  color: #fff;
}
.warehouse-health-heading p {
  color: #c8cde8;
}
.warehouse-health-heading {
  margin-bottom: 0;
}
.warehouse-health-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
.warehouse-health-chip {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(190, 197, 244, 0.20);
  border-radius: 18px;
  color: #f8fbff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 76px;
  padding: 10px 12px;
  text-align: left;
}
.warehouse-health-chip span {
  font-size: 13px;
}
.warehouse-health-chip strong {
  color: #43dff2;
  font-size: 24px;
  line-height: 1;
}
.warehouse-health-chip small {
  color: #b9bedc;
  font-size: 11px;
  font-weight: 700;
}
.warehouse-health-chip.active {
  border-color: rgba(67, 223, 242, 0.72);
  box-shadow: 0 0 0 2px rgba(67, 223, 242, 0.18), 0 0 22px rgba(67, 223, 242, 0.18);
}
.warehouse-health-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.warehouse-health-row {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(190, 197, 244, 0.16);
  border-radius: 18px;
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  min-width: 0;
}
.warehouse-health-main {
  align-items: center;
  display: flex;
  gap: 11px;
}
.warehouse-health-main strong {
  color: #fff;
  display: block;
  font-size: 15px;
}
.warehouse-health-main small,
.warehouse-health-meta {
  color: #c8cde8;
  font-size: 12px;
  font-weight: 750;
}
.warehouse-health-tag {
  align-items: center;
  background: rgba(96, 255, 168, 0.12);
  border: 1px solid rgba(96, 255, 168, 0.28);
  border-radius: 999px;
  color: #c8ffdf;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  justify-self: start;
  padding: 5px 9px;
}
.warehouse-health-action {
  border-color: rgba(67, 223, 242, 0.35);
  color: #dcfbff;
  justify-self: start;
  min-height: 32px;
  padding: 4px 10px;
}
.warehouse-badge {
  background: rgba(67, 223, 242, 0.16);
  border: 1px solid rgba(67, 223, 242, 0.45);
  border-radius: 999px;
  color: #72effa;
  font-size: 12px;
  font-weight: 900;
  min-width: 54px;
  padding: 6px 9px;
  text-align: center;
}
.warehouse-health-meter {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}
.warehouse-health-meter span {
  background: linear-gradient(90deg, #43dff2, #b56cff);
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(67, 223, 242, 0.45);
  display: block;
  height: 100%;
}
.warehouse-health-low .warehouse-health-meter span {
  background: linear-gradient(90deg, #ffcc66, #ff7d7d);
}
.warehouse-health-over .warehouse-health-meter span {
  background: linear-gradient(90deg, #43dff2, #60ffa8);
}
.warehouse-health-expire .warehouse-health-meter span {
  background: linear-gradient(90deg, #ffdf5a, #ff9b2f);
}
.warehouse-health-nearout .warehouse-health-meter span {
  background: linear-gradient(90deg, #ff7d7d, #ffcc66);
}
.warehouse-expiry-yellow .warehouse-health-meter span {
  background: linear-gradient(90deg, #ffe66b, #ffca3a);
  box-shadow: 0 0 16px rgba(255, 214, 58, 0.45);
}
.warehouse-expiry-orange .warehouse-health-meter span {
  background: linear-gradient(90deg, #ffb347, #ff7a1f);
  box-shadow: 0 0 16px rgba(255, 122, 31, 0.48);
}
.warehouse-expiry-red .warehouse-health-meter span {
  background: linear-gradient(90deg, #ff6b5f, #d92222);
  box-shadow: 0 0 16px rgba(217, 34, 34, 0.5);
}
.warehouse-expiry-darkred .warehouse-health-meter span {
  background: linear-gradient(90deg, #9b111e, #3c0509);
  box-shadow: 0 0 18px rgba(155, 17, 30, 0.58);
}
.warehouse-health-empty {
  color: #c5cae6;
  border: 1px dashed rgba(190, 197, 244, 0.22);
  background: rgba(255,255,255,0.04);
}
.mission-panel {
  border-color: #bdd8cc;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf9 100%);
}
.forecast-grid {
  display: grid;
  gap: 18px;
}
.forecast-toolbar-panel {
  padding: 14px 18px;
}
.forecast-date-control {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.forecast-date-control label {
  max-width: 220px;
}
.forecast-panel {
  border-color: #bdd8cc;
}
.forecast-date {
  background: #eaf4ef;
  border: 1px solid #cfe2d8;
  border-radius: 999px;
  color: #1f6b4d;
  font-size: 12px;
  font-weight: 850;
  padding: 8px 12px;
  white-space: nowrap;
}
.reorder-actions {
  display: flex;
  gap: 6px;
  min-width: 150px;
}
.table-wrap {
  overflow: auto;
  max-height: 340px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  scrollbar-color: #b6c6be transparent;
  scrollbar-width: thin;
}
.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 130px;
  align-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  white-space: normal;
}
.empty-state::before {
  content: "";
  width: 30px;
  height: 30px;
  border: 2px solid #c8d8d0;
  border-radius: 9px;
  background: linear-gradient(135deg, transparent 45%, #e8f3ee 45%);
}
.view.is-loading {
  position: relative;
  min-height: 180px;
}
.view.is-loading > * {
  opacity: 0.38;
  pointer-events: none;
}
.view.is-loading::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 72px;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  border: 3px solid #d8e6df;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: loadingSpin .7s linear infinite;
}
@keyframes loadingSpin { to { transform: rotate(360deg); } }
.balanced-table {
  max-height: 320px;
}
.compact-table {
  max-height: 300px;
}
.dashboard-five-rows {
  max-height: 245px;
}
#poTable {
  table-layout: fixed;
  min-width: 0;
}
#poTable th,
#poTable td {
  padding: 7px 8px;
  white-space: normal;
}
#poTable th:nth-child(1),
#poTable td:nth-child(1) {
  width: 96px;
}
#poTable th:nth-child(2),
#poTable td:nth-child(2) {
  width: 92px;
}
#poTable th:nth-child(3),
#poTable td:nth-child(3) {
  width: 86px;
}
#poTable th:nth-child(4),
#poTable td:nth-child(4) {
  width: 142px;
}
#poTable th:nth-child(5),
#poTable td:nth-child(5) {
  width: 88px;
  text-align: right;
}
#poTable th:nth-child(6),
#poTable td:nth-child(6) {
  width: auto;
  min-width: 220px;
}
#poTable th:nth-child(7),
#poTable td:nth-child(7) {
  width: 220px;
}
#poTable .status {
  white-space: normal;
  display: inline-block;
  max-width: 130px;
  line-height: 1.2;
}
#poTable .po-number-link {
  display: inline-block;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}
#poTable .po-actions {
  justify-content: flex-end;
  min-width: 190px;
}
.po-number-link {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--blue);
  cursor: pointer;
  font-weight: 850;
  min-height: 0;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.po-number-link:hover {
  background: transparent;
  color: var(--green);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(215, 224, 219, 0.84);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}
.toolbar input { max-width: 420px; }
.scoped-toolbar {
  justify-content: flex-start;
}
.scoped-toolbar select {
  max-width: 360px;
}
.branch-inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 520px) auto auto;
  justify-content: start;
  align-items: center;
  gap: 8px;
  padding: 10px;
}
.branch-inventory-toolbar input {
  width: 100%;
  max-width: none;
}
.branch-inventory-toolbar button {
  min-height: 38px;
  white-space: nowrap;
}
.master-search-toolbar {
  margin-bottom: 10px;
  padding: 10px;
  box-shadow: none;
}
.master-search-toolbar input {
  width: min(540px, 100%);
  max-width: none;
}
.count-entry-panel {
  max-width: none;
  width: min(980px, 100%);
}
.count-post-button {
  justify-self: end;
  min-width: 150px;
  max-width: 190px;
  width: 100%;
}
.count-entry-wrap {
  max-height: 58vh;
  overflow: auto;
}
.count-entry-wrap table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
.count-entry-wrap th,
.count-entry-wrap td {
  padding: 8px 10px;
  white-space: normal;
}
.count-entry-wrap th:first-child,
.count-entry-wrap td:first-child {
  width: 18%;
}
.count-entry-wrap th:nth-child(3),
.count-entry-wrap td:nth-child(3) {
  width: 14%;
}
.count-entry-wrap th:last-child,
.count-entry-wrap td:last-child {
  width: 150px;
}
.countLineQty {
  min-height: 34px;
  padding: 6px 8px;
  width: 100%;
}
.manual-adjustment-wrap {
  max-height: 520px;
  overflow-x: hidden;
}
#manualAdjustmentsTable {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
#manualAdjustmentsTable th,
#manualAdjustmentsTable td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: normal;
}
#manualAdjustmentsTable .manual-col-location {
  width: 12%;
}
#manualAdjustmentsTable .manual-col-lot {
  width: 14%;
}
#manualAdjustmentsTable .manual-col-product {
  width: auto;
}
#manualAdjustmentsTable .manual-col-on-hand {
  width: 8%;
  white-space: nowrap;
}
#manualAdjustmentsTable .manual-col-action {
  width: 15%;
}
#manualAdjustmentsTable .manual-col-qty {
  width: 8%;
}
#manualAdjustmentsTable .manual-col-reason {
  width: 24%;
}
#manualAdjustmentsTable .manual-col-post {
  width: 9%;
}
#manualAdjustmentsTable input,
#manualAdjustmentsTable select {
  min-height: 34px;
  padding: 6px 8px;
  width: 100%;
}
#manualAdjustmentsTable .manualAdjustQty {
  min-width: 68px;
}
#manualAdjustmentsTable .manualAdjustAction {
  min-width: 138px;
}
.manual-reason-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}
#manualAdjustmentsTable .manualAdjustReason,
#manualAdjustmentsTable .manualAdjustOther {
  min-width: 0;
}
#manualAdjustmentsTable .lot-code {
  display: block;
  overflow-wrap: anywhere;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.allocation-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbf8;
  min-width: 0;
  overflow: hidden;
}
.allocation-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
}
.allocation-grid label {
  grid-template-columns: minmax(0, 1fr) minmax(72px, 88px);
  align-items: center;
  color: var(--ink);
  font-weight: 550;
  font-size: 12px;
  min-width: 0;
}
.allocation-grid input {
  min-width: 0;
  width: 100%;
}
.line-list {
  display: grid;
  gap: 10px;
}
.po-request-panel {
  margin-bottom: 10px;
  padding: 12px 14px;
  gap: 8px;
}
.po-request-panel .panel-head {
  margin-bottom: 6px;
}
.po-request-panel h3 {
  margin-bottom: 0;
}
.po-request-panel label {
  gap: 4px;
}
.po-request-panel input,
.po-request-panel button {
  min-height: 34px;
}
.po-request-panel .form-row {
  gap: 8px;
}
.po-request-panel .report-actions {
  margin-top: 0;
}
.po-request-results-panel {
  padding: 14px;
}
.po-request-results-panel h3 {
  margin-bottom: 8px;
}
.po-request-results-panel .po-search-bar {
  margin-bottom: 8px;
  padding: 8px;
}
.po-request-results-panel .po-search-bar input,
.po-request-results-panel .po-search-bar button {
  min-height: 34px;
}
.po-request-table-wrap {
  max-height: 455px;
}
#poRequestTable {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
#poRequestTable th,
#poRequestTable td {
  padding: 6px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#poRequestTable th {
  overflow: visible;
  line-height: 1.18;
  word-break: normal;
}
#poRequestTable td {
  overflow: hidden;
}
#poRequestTable th:nth-child(1),
#poRequestTable td:nth-child(1) { width: 92px; }
#poRequestTable th:nth-child(2),
#poRequestTable td:nth-child(2) { width: 118px; }
#poRequestTable th:nth-child(2),
#poRequestTable td:nth-child(2) {
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#poRequestTable td:nth-child(2) a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}
#poRequestTable th:nth-child(3),
#poRequestTable td:nth-child(3) { width: 76px; }
#poRequestTable th:nth-child(4),
#poRequestTable td:nth-child(4) { width: 138px; }
#poRequestTable th:nth-child(5),
#poRequestTable td:nth-child(5) {
  overflow-wrap: normal;
  white-space: nowrap;
  width: 88px;
}
#poRequestTable th:nth-child(6),
#poRequestTable td:nth-child(6) {
  text-align: right;
  width: 78px;
}
#poRequestTable th:nth-child(7),
#poRequestTable td:nth-child(7) { width: auto; }
#poRequestTable th:last-child,
#poRequestTable td:last-child {
  overflow: hidden;
  width: 136px;
}
#poRequestTable .po-action {
  min-height: 26px;
  padding: 0 7px;
}
.po-status-wrap .status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
  line-height: 1.2;
  padding-inline: 10px;
  text-align: center;
  white-space: normal;
}
.po-notice-preview {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  line-height: 1.32;
  max-height: 2.64em;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}
.document-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(31, 107, 80, 0.16);
  border-radius: 10px;
  background: var(--teal-soft);
}
.document-actions > strong {
  color: var(--green);
  font-size: 13px;
}
.document-actions .po-actions {
  justify-content: flex-end;
}
.po-request-lines {
  display: grid;
  gap: 6px;
}
.po-request-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(90px, 120px) minmax(110px, 150px) 96px;
  gap: 8px;
  align-items: end;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}
.readonly-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.vendor-po-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
}
.vendor-card {
  overflow: visible;
  width: 100%;
}
.vendor-card .panel-head {
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(215, 224, 219, 0.72);
}
.vendor-card .panel-head p,
.vendor-po-tracking .section-heading p {
  margin: 4px 0 0;
  font-size: 12px;
}
.vendor-po-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 107, 80, 0.14);
  border-radius: 14px;
  background: rgba(232, 245, 239, 0.64);
  color: var(--muted);
  font-size: 12px;
}
.vendor-po-help strong {
  color: var(--green);
}
.movement-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}
.movement-summary-card {
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(236, 249, 244, 0.96), rgba(255,255,255,0.92));
  border: 1px solid rgba(31, 107, 80, 0.16);
  border-radius: 16px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 92px;
  padding: 12px;
  text-align: left;
  width: 100%;
}
.movement-summary-card strong {
  color: var(--green);
  font-size: 22px;
}
.movement-summary-card small,
.movement-summary-card span {
  color: var(--muted);
}
.vendor-form-grid,
.vendor-po-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}
.vendor-form-grid > *,
.vendor-po-meta-grid > * {
  min-width: 0;
}
.vendor-address-field {
  grid-column: span 3;
}
.vendor-item-grid {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.55fr) minmax(150px, 0.45fr) minmax(160px, auto);
}
.vendor-item-grid button {
  min-height: 40px;
  white-space: nowrap;
}
.vendor-lines-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.transfer-lines-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.transfer-lines {
  display: grid;
  gap: 8px;
}
.transfer-line {
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 180px) auto;
}
.vendor-lines-head button {
  min-height: 34px;
  padding-inline: 12px;
  white-space: nowrap;
}
.vendor-po-lines {
  display: grid;
  gap: 8px;
}
.vendor-po-line {
  grid-template-columns: minmax(260px, 1.3fr) minmax(190px, 0.9fr) minmax(104px, 130px) minmax(110px, 130px) minmax(110px, 130px) auto;
  padding: 10px;
  gap: 8px;
  border: 1px solid rgba(215, 224, 219, 0.78);
  border-radius: 14px;
  background: rgba(255,255,255,0.74);
}
.vendor-po-line select,
.vendor-po-line input {
  min-width: 0;
}
.vendor-po-line .removeVendorPoLine {
  align-self: end;
  min-height: 34px;
  padding: 0 10px;
  color: var(--red);
  white-space: nowrap;
}
.vendor-po-card textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}
.vendor-po-card .report-actions button {
  min-width: 170px;
}
.muted-disabled {
  opacity: 0.72;
}
.holiday-edit-row,
.holiday-export-row {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0;
}
.holiday-export-row {
  grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) minmax(320px, 1fr);
}
.holiday-actions {
  align-items: end;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.holiday-export-row button,
.holiday-edit-row button,
.file-action {
  min-height: 40px;
  white-space: nowrap;
}
.file-action {
  align-items: center;
  background: #eaf4ef;
  border: 1px solid #cfe2d8;
  border-radius: 10px;
  color: var(--green);
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  padding: 0 14px;
}
.file-action input {
  display: none;
}
.vendor-po-tracking {
  margin-top: 0;
  width: 100%;
}
.vendor-po-table-wrap {
  max-height: 420px;
}
.db-edits-panel {
  grid-column: 1 / -1;
}
.db-edits-table-wrap {
  max-height: 620px;
}
.db-edits-table-wrap table {
  min-width: 1500px;
}
.db-edit-input {
  min-width: 120px;
  width: 100%;
}
#vendorPoTable {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
#vendorPoTable th,
#vendorPoTable td {
  white-space: normal;
  overflow-wrap: anywhere;
}
#vendorPoTable th:nth-child(1),
#vendorPoTable td:nth-child(1) { width: 112px; }
#vendorPoTable th:nth-child(2),
#vendorPoTable td:nth-child(2) { width: 132px; }
#vendorPoTable th:nth-child(3),
#vendorPoTable td:nth-child(3) { width: 122px; }
#vendorPoTable th:nth-child(4),
#vendorPoTable td:nth-child(4) { width: 96px; }
#vendorPoTable th:nth-child(5),
#vendorPoTable td:nth-child(5) { width: 106px; }
#vendorPoTable th:nth-child(6),
#vendorPoTable td:nth-child(6) { width: 88px; }
.vendor-po-item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.vendor-po-item-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(31, 107, 80, 0.16);
  border-radius: 999px;
  background: var(--teal-soft);
  color: #244f41;
  font-size: 12px;
  line-height: 1.25;
}
.vendor-po-item-list small {
  color: #5f7168;
  font-weight: 700;
}
@media (max-width: 1180px) {
  .vendor-form-grid,
  .vendor-po-meta-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  .vendor-address-field {
    grid-column: 1 / -1;
  }
  .vendor-item-grid,
  .vendor-po-line {
    grid-template-columns: minmax(220px, 1fr) minmax(120px, 150px) minmax(120px, 150px);
  }
  .vendor-item-grid button,
  .vendor-po-line .removeVendorPoLine {
    grid-column: 1 / -1;
    justify-self: end;
    min-width: 180px;
  }
  .holiday-edit-row,
  .holiday-export-row {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
  .holiday-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
.tab-access-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbf8;
}
.tab-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.tab-access-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.tab-access-option input {
  width: auto;
  min-height: auto;
}
.sales-line {
  display: grid;
  grid-template-columns: 1fr 100px 120px;
  gap: 10px;
  align-items: end;
}
.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #1f4e3e;
  background: #e6f3ee;
  border: 1px solid #cde5d9;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  margin-right: 6px;
}
.status-success {
  color: #1f5b45;
  background: #e8f4ef;
  border-color: #c7e1d5;
}
.status-warn {
  color: #76520e;
  background: #fff6dc;
  border-color: #ead598;
}
.status-danger {
  color: #8f2e2e;
  background: #fceaea;
  border-color: #efc4c4;
}
.status-neutral {
  color: #45544d;
  background: #eef2f0;
  border-color: #d7dfdb;
}
.dashboard-action-required {
  background: rgba(220, 38, 38, 0.12) !important;
  box-shadow: inset 4px 0 0 #dc2626;
}
.dashboard-action-required td {
  background: rgba(220, 38, 38, 0.08) !important;
  border-color: rgba(220, 38, 38, 0.22);
}
.dashboard-action-required .dashboard-notice-text {
  color: #8f2e2e;
  font-weight: 850;
}
.danger { color: var(--red); font-weight: 800; }
.warn { color: var(--gold); font-weight: 800; }
.lot-code {
  display: inline-block;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}
.json-preview {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}
.expiry-expired {
  color: #8f2424;
  background: #fde8e8;
  border: 1px solid #f2bcbc;
}
.expiry-warning {
  color: #7a540d;
  background: #fff4cf;
  border: 1px solid #efd78c;
}
tr.expiry-expired td {
  background: #fde8e8 !important;
  color: #6f1f1f;
}
tr.expiry-warning td {
  background: #fff4cf !important;
  color: #5f430a;
}
.toast {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 5;
  background: #1f2a25;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  max-width: min(420px, calc(100vw - 44px));
}
.po-incoming-alert {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(760px, calc(100vw - 36px));
  padding: 14px 16px;
  color: #fff;
  background: #b42318;
  border: 1px solid #f7c2bd;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(68, 22, 18, 0.28);
  transform: translateX(-50%);
}
.po-incoming-alert.attention {
  animation: poPulse 1.2s ease-in-out 2;
}
.po-incoming-alert button {
  min-height: 32px;
  color: #7a1b13;
  background: #fff;
  border-color: #fff;
}
@keyframes poPulse {
  0%, 100% { box-shadow: 0 18px 44px rgba(68, 22, 18, 0.28); }
  50% { box-shadow: 0 18px 60px rgba(180, 35, 24, 0.62); }
}
.report-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.report-meta div {
  padding: 10px 12px;
  background: #f8fbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.report-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
.report-meta strong {
  display: block;
  margin-top: 4px;
}
.daily-inventory-filter-grid {
  align-items: end;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(22, 31, 27, 0.42);
}
.modal-panel {
  width: min(780px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.po-detail-panel {
  width: min(1180px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow: auto;
}
.branch-variance-detail-panel {
  width: min(980px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow: auto;
}
.po-review-panel {
  width: min(1040px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow: auto;
}
.po-review-table-wrap {
  max-height: 460px;
}
.poReviewAcceptedQty {
  min-height: 34px;
  text-align: right;
}
.poReviewUnserved {
  font-weight: 850;
  color: #8f2424;
}
.old-po-panel {
  width: min(920px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  display: grid;
  gap: 16px;
}
.old-po-header {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.old-po-header img {
  width: min(260px, 72%);
  height: auto;
  display: block;
}
.old-po-header h3 {
  margin: 0;
  color: #1f4e3e;
  font-size: 22px;
  letter-spacing: 0;
}
.old-po-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.old-po-meta-grid input:disabled {
  color: var(--ink);
  background: #f8fbf7;
  opacity: 1;
}
.old-po-instruction {
  margin: 0;
  color: #b42318;
  font-weight: 850;
  text-align: center;
}
.old-po-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(140px, 0.26fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  background: #f8fbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.old-po-tools label {
  gap: 4px;
}
.old-po-tools input,
.old-po-tools select,
.old-po-tools button {
  min-height: 34px;
}
.old-po-nav {
  display: flex;
  gap: 8px;
}
.old-po-table-wrap {
  max-height: 420px;
}
.old-po-table tr.old-po-match td {
  background: #fff4cf !important;
}
.old-po-table th:nth-child(1),
.old-po-table td:nth-child(1) {
  width: 42%;
}
.old-po-table th:nth-child(2),
.old-po-table td:nth-child(2) {
  width: 22%;
}
.old-po-table th:nth-child(3),
.old-po-table td:nth-child(3) {
  width: 20%;
}
.old-po-table th:nth-child(4),
.old-po-table td:nth-child(4) {
  width: 16%;
}
.oldPoQty {
  min-height: 34px;
  text-align: right;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}
.detail-meta div {
  background: #f9fbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.detail-meta span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
.detail-meta strong {
  display: block;
  font-size: 13px;
  margin-top: 5px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-width: 0;
}
.detail-grid > div {
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(215, 224, 219, 0.72);
  border-radius: 8px;
  padding: 12px;
}
.detail-grid h3 {
  margin-bottom: 10px;
}
.po-detail-panel .table-wrap {
  max-width: 100%;
}
.po-detail-panel .compact-table {
  max-height: 260px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.print-area {
  display: none;
}
.document-sheet-wrap {
  max-width: 100%;
  overflow: auto;
}
.document-sheet {
  background: #fff;
  border: 1px solid rgba(215, 224, 219, 0.92);
  border-radius: 14px;
  color: #151d1a;
  font-family: Arial, sans-serif;
  margin: 0 auto;
  max-width: 860px;
  padding: 26px 30px;
}
.document-sheet-top {
  align-items: flex-start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 280px;
  margin-bottom: 34px;
}
.document-sheet-brand img {
  display: block;
  height: auto;
  margin-bottom: 14px;
  max-width: 190px;
}
.document-sheet-brand h1 {
  font-size: 36px;
  letter-spacing: .02em;
  margin: 0;
  text-transform: uppercase;
}
.document-sheet-fields {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: 1fr 1fr;
}
.document-sheet-fields div {
  min-width: 0;
}
.document-sheet-fields span,
.document-sheet-meta span,
.document-sheet-signatures span {
  color: #777;
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.document-sheet-fields strong,
.document-sheet-meta strong {
  border-bottom: 1px solid #cfcfcf;
  display: block;
  font-size: 13px;
  margin-top: 4px;
  min-height: 22px;
  padding-bottom: 4px;
}
.document-sheet-fields .document-bill-to {
  grid-column: 1 / -1;
  margin-top: 14px;
  text-align: right;
}
.document-sheet-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}
.document-sheet-table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}
.document-sheet-table th {
  border-bottom: 1px solid #222;
  color: #111;
  font-size: 13px;
  padding: 8px 7px;
  position: static;
  text-align: left;
}
.document-sheet-table td {
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 7px;
  white-space: normal;
}
.document-sheet-table td strong {
  display: block;
  font-size: 13px;
}
.document-sheet-table td small {
  color: #777;
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.document-num {
  text-align: right;
  white-space: nowrap !important;
}
.document-edit-cell input {
  max-width: 110px;
  min-height: 34px;
  text-align: right;
}
.document-sheet-total {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 18px;
}
.document-sheet-total span {
  font-weight: 800;
}
.document-sheet-total strong {
  border-bottom: 1px solid #222;
  min-width: 130px;
  padding: 4px 8px;
  text-align: right;
}
.document-sheet-notes {
  margin-top: 20px;
}
.document-sheet-notes p {
  border: 1px solid #dedede;
  border-radius: 10px;
  color: #4f5d56;
  margin: 6px 0 0;
  min-height: 50px;
  padding: 10px;
}
.document-copy-label {
  color: #666;
  font-size: 11px;
  margin-top: 12px;
  text-align: right;
}
.document-sheet-signatures {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 48px;
}
.document-sheet-signatures div {
  border-top: 1px solid #111;
  min-height: 36px;
  padding-top: 6px;
}
.invoice-review-panel .po-review-table-wrap {
  display: none;
}
@media (max-width: 980px) {
  .login-panel, .app, .grid-two, .dashboard-grid, .report-grid, .report-filter-grid, .admin-grid, .stock-grid, .sales-grid, .sales-focus-grid, .metrics {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
  }
  .brand {
    min-height: 44px;
    padding: 0;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px;
  }
  .nav-group {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
  }
  .nav-group-label {
    display: none;
  }
  nav button {
    width: auto;
    min-height: 38px;
    white-space: nowrap;
  }
  nav button.active {
    box-shadow: inset 0 -3px 0 var(--green);
  }
  #logout {
    min-height: 38px;
    white-space: nowrap;
  }
  .topbar, .toolbar, .top-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .form-row, .sales-line, .po-request-line, .po-search-bar {
    grid-template-columns: 1fr;
  }
  .vendor-po-workspace,
  .vendor-form-grid,
  .vendor-item-grid,
  .vendor-po-meta-grid,
  .vendor-po-help,
  .movement-summary-grid,
  .transfer-line,
  .vendor-po-line {
    grid-template-columns: 1fr;
  }
  .vendor-item-grid button,
  .vendor-po-card .report-actions button,
  .vendor-po-line .removeVendorPoLine {
    width: 100%;
  }
  #vendorPoTable {
    min-width: 620px;
  }
  .email-recipient-form {
    grid-template-columns: 1fr;
  }
  .commissary-form-grid,
  .commissary-allocation-row {
    grid-template-columns: 1fr;
  }
  .commissary-form-grid > label:nth-child(n) {
    grid-column: 1 / -1;
  }
  .commissary-submit-area {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
  .commissary-submit-area button {
    max-width: none;
  }
  .detail-grid, .detail-meta {
    grid-template-columns: 1fr;
  }
  .document-sheet-top,
  .document-sheet-meta {
    grid-template-columns: 1fr;
  }
  .document-sheet-fields .document-bill-to {
    text-align: left;
  }
  .report-meta,
  .po-incoming-alert {
    grid-template-columns: 1fr;
  }
  .old-po-meta-grid {
    grid-template-columns: 1fr;
  }
  .old-po-tools {
    grid-template-columns: 1fr;
  }
  .transfer-form-body {
    grid-template-columns: 1fr;
  }
  .transfer-form-action {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
  .transfer-form-action button {
    max-width: none;
  }
  .table-wrap {
    max-height: 300px;
  }
  .table-wrap table { min-width: 680px; }
  .table-wrap table:has(.empty-state) { min-width: 0; }
  th, td { white-space: nowrap; }
}

@media (max-width: 640px) {
  .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .brand strong { font-size: 13px; }
  .brand small {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  nav button span { font-size: 12px; }
  .content { padding: 14px; }
  .topbar { padding: 15px; }
  .top-actions select { min-width: 0; }
  .panel { padding: 15px; }
  .report-actions,
  .panel-head,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .branch-inventory-toolbar { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: Letter;
    margin: 0.35in;
  }
  body {
    background: #fff;
  }
  body > :not(.print-area) {
    display: none !important;
  }
  .print-area {
    display: block;
  }
  .po-print-page {
    width: 100%;
    min-height: 10.3in;
    max-height: 10.3in;
    page-break-after: always;
    overflow: hidden;
    color: #111;
    font-family: Arial, sans-serif;
    font-size: 10.5px;
  }
  .po-print-page:last-child {
    page-break-after: auto;
  }
  .print-area .document-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 10.3in;
    max-height: 10.3in;
    max-width: none;
    overflow: hidden;
    page-break-after: always;
    padding: 0;
    width: 100%;
  }
  .print-area .document-sheet:last-child {
    page-break-after: auto;
  }
  .print-area .document-sheet-top {
    margin-bottom: 32px;
  }
  .print-area .document-sheet-brand h1 {
    font-size: 30px;
  }
  .print-area .document-sheet-table {
    font-size: 10.5px;
  }
  .print-area .document-sheet-table th,
  .print-area .document-sheet-table td {
    padding: 5px 6px;
  }
  .po-print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #222;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  .po-print-header img {
    width: 150px;
    height: auto;
    display: block;
    margin-bottom: 5px;
  }
  .po-print-header h1 {
    font-size: 18px;
    margin: 0;
  }
  .po-print-number {
    text-align: right;
  }
  .po-print-number span,
  .po-print-meta span,
  .po-print-signatures span {
    display: block;
    color: #555;
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .po-print-number strong {
    display: block;
    font-size: 18px;
    margin: 3px 0;
  }
  .po-print-number small {
    color: #555;
  }
  .po-print-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
  }
  .po-print-meta div {
    border: 1px solid #bbb;
    padding: 5px;
    min-height: 36px;
  }
  .po-print-meta strong {
    display: block;
    margin-top: 3px;
    font-size: 10px;
  }
  .po-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
  }
  .po-print-table th,
  .po-print-table td {
    border: 1px solid #aaa;
    padding: 4px 5px;
    white-space: normal;
  }
  .po-print-table th {
    background: #eee !important;
    color: #111;
    position: static;
    font-size: 9px;
  }
  .po-print-table .num {
    text-align: right;
    white-space: nowrap;
  }
  .po-print-notes {
    border: 1px solid #bbb;
    margin-top: 8px;
    padding: 6px;
    min-height: 42px;
  }
  .po-print-notes p {
    margin: 4px 0 0;
  }
  .po-print-signatures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 28px;
  }
  .po-print-signatures div {
    border-top: 1px solid #111;
    padding-top: 5px;
    min-height: 28px;
  }
}


.scope-control {
  align-items: center;
  display: inline-flex;
  gap: 0.5rem;
}

.fixed-scope {
  align-items: center;
  background: #f6f8f5;
  border: 1px solid #dbe5d6;
  border-radius: 8px;
  color: #31432c;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 38px;
  padding: 0 0.85rem;
}


/* Nightly workbook-style Daily Inventory report */
#dailyInventoryTable {
  margin: 0 auto;
  max-width: 680px;
  table-layout: fixed;
  width: 100%;
}
#dailyInventoryTable th,
#dailyInventoryTable td {
  padding: 7px 10px;
}
#dailyInventoryTable th:nth-child(1),
#dailyInventoryTable td:nth-child(1) {
  text-align: left;
  width: 62%;
}
#dailyInventoryTable th:nth-child(2),
#dailyInventoryTable td:nth-child(2) {
  text-align: right;
  width: 16%;
}
#dailyInventoryTable th:nth-child(3),
#dailyInventoryTable td:nth-child(3) {
  text-align: left;
  width: 22%;
}
#dailyInventoryTable .daily-inventory-section td {
  background: #f2f5ef;
  color: #263623;
  font-weight: 800;
  text-align: center;
}
#dailyInventoryTable .daily-inventory-highlight td {
  background: #fff2a8;
}
#dailyInventoryTable .daily-inventory-unmatched td:first-child {
  color: #8a4b16;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.daily-inventory-title strong {
  font-size: 1rem;
}


/* Editable nightly report and signoff */
#dailyInventoryTable .daily-inventory-spacer td {
  background: transparent;
  height: 12px;
  padding: 0;
}
#dailyInventoryTable .daily-inventory-footer-spacer td {
  height: 18px;
}
#dailyInventoryTable .daily-inventory-quantity,
#dailyInventoryTable .daily-inventory-signoff input {
  min-height: 34px;
  width: 100%;
}
#dailyInventoryTable .daily-inventory-quantity {
  text-align: right;
}
#dailyInventoryTable .daily-inventory-signoff td {
  background: #f8faf7;
  border-top: 1px solid #dce4d8;
}
#dailyInventoryTable .daily-inventory-signoff span:not(.required-mark) {
  display: inline-block;
  font-weight: 700;
  padding: 7px 2px;
}
#dailyInventoryTable .required-mark {
  color: #b42318;
  font-weight: 800;
}
#emailDailyInventory:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}


/* Daily Inventory conversion entry */
#dailyInventoryTable .daily-inventory-conversion td {
  vertical-align: bottom;
}
#dailyInventoryTable .daily-inventory-conversion strong {
  display: block;
  margin-bottom: 6px;
}
#dailyInventoryTable .daily-inventory-conversion input {
  min-height: 34px;
  width: 100%;
}


/* All-branch nightly inventory matrix */
.all-branches-report-panel {
  grid-column: 1 / -1;
}
.all-branches-inventory-wrap {
  max-height: 680px;
  overflow: auto;
}
#allBranchesInventoryTable {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 2700px;
  table-layout: fixed;
}
#allBranchesInventoryTable th,
#allBranchesInventoryTable td {
  min-width: 82px;
  padding: 7px 8px;
  white-space: nowrap;
}
#allBranchesInventoryTable th:first-child,
#allBranchesInventoryTable td:first-child {
  background: #fff;
  left: 0;
  min-width: 210px;
  position: sticky;
  z-index: 2;
}
#allBranchesInventoryTable thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}
#allBranchesInventoryTable thead tr:nth-child(2) th {
  top: 36px;
}
#allBranchesInventoryTable thead th:first-child {
  z-index: 6;
}
#allBranchesInventoryTable .num {
  text-align: right;
}
#allBranchesInventoryTable .all-branches-section td {
  background: #eaf1e6;
  color: #263623;
  font-weight: 800;
  text-align: center;
}
#allBranchesInventoryTable .all-branches-spacer td {
  background: #fff;
  height: 12px;
  padding: 0;
}
#allBranchesInventoryTable .all-branches-highlight td {
  background: #fff2a8;
}
#allBranchesInventoryTable .all-branches-unmatched td:first-child {
  color: #8a4b16;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
#allBranchesInventoryTable .all-branches-signoff td {
  background: #fff2a8;
  border-top: 1px solid #dce4d8;
}

/* Final cross-device safeguards. Keep this block last so report-specific rules
   cannot accidentally undo the shared responsive behavior. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

button,
input,
select,
textarea,
.view,
.panel,
.toolbar,
form {
  min-width: 0;
  max-width: 100%;
}

.table-wrap,
.manual-adjustment-wrap,
.all-branches-inventory-wrap {
  overflow: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.report-actions,
.modal-actions,
.po-actions,
.reorder-actions {
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .content,
  .topbar,
  .view,
  .panel {
    width: 100%;
  }

  .sidebar {
    height: auto;
    min-height: 0;
  }

  .table-wrap,
  .all-branches-inventory-wrap {
    max-height: min(62dvh, 560px);
  }
}

.po-job-order-panel {
  width: min(1080px, calc(100vw - 44px));
}

.po-job-order-table-wrap {
  max-height: min(52vh, 480px);
  margin-bottom: 14px;
}

#poJobOrderTable {
  min-width: 760px;
  table-layout: fixed;
}

#poJobOrderTable th,
#poJobOrderTable td {
  padding: 8px;
  white-space: normal;
}

#poJobOrderTable th:nth-child(1),
#poJobOrderTable td:nth-child(1) {
  width: 100px;
}

#poJobOrderTable th:nth-child(3),
#poJobOrderTable td:nth-child(3),
#poJobOrderTable th:nth-child(4),
#poJobOrderTable td:nth-child(4),
#poJobOrderTable th:nth-child(5),
#poJobOrderTable td:nth-child(5) {
  text-align: right;
  width: 100px;
}

#poJobOrderTable th:nth-child(6),
#poJobOrderTable td:nth-child(6) {
  width: 170px;
}

.poJobOrderQty {
  text-align: right;
  width: 100%;
}

@media (max-width: 640px) {
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .sidebar {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .sidebar nav {
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
  }

  .sidebar nav button {
    min-height: 44px;
    scroll-snap-align: start;
  }

  .content {
    padding: 12px max(10px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .topbar {
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .topbar h2 {
    font-size: clamp(1.35rem, 8vw, 1.75rem);
  }

  .topbar p {
    font-size: 0.82rem;
  }

  .top-actions,
  .top-actions > *,
  .toolbar > *,
  .branch-toolbar > *,
  .report-actions > *,
  .modal-actions > * {
    width: 100%;
    max-width: none;
  }

  .panel {
    border-radius: 10px;
    padding: 14px;
  }

  .toolbar,
  .po-search-bar {
    padding: 10px;
  }

  .table-wrap,
  .all-branches-inventory-wrap {
    max-height: min(58dvh, 440px);
  }

  .table-wrap table:not(#dailyInventoryTable) {
    min-width: 620px;
  }

  #dailyInventoryTable {
    min-width: 520px;
  }

  td button,
  td .btn-small,
  .table-action {
    min-height: 40px;
  }

  .modal {
    align-items: stretch;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  }

  .modal-panel,
  .po-detail-panel,
  .po-review-panel,
  .old-po-panel {
    border-radius: 0;
    height: 100%;
    max-height: 100dvh;
    max-width: none;
    overflow: auto;
    padding: 16px;
    width: 100%;
  }

  .modal-actions {
    background: #fff;
    bottom: 0;
    padding-top: 10px;
    position: sticky;
    z-index: 2;
  }

  .po-incoming-alert {
    left: 8px;
    right: 8px;
    top: max(8px, env(safe-area-inset-top));
    width: auto;
  }

  .toast {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    max-width: none;
    right: 10px;
    top: auto;
  }

  .allocation-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .detail-grid > div {
    padding: 10px;
  }
}

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

  .panel {
    padding: 12px;
  }

  .brand div {
    min-width: 0;
  }

  .brand strong,
  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Dashboard PO tables keep notices compact so workflow actions stay visible. */
#dashPoNotices,
#dashPoRequests {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}

#dashPoNotices th,
#dashPoNotices td,
#dashPoRequests th,
#dashPoRequests td {
  padding: 8px;
  white-space: normal;
}
#dashPoNotices th,
#dashPoRequests th {
  overflow: visible;
  line-height: 1.18;
  word-break: normal;
}
#dashPoNotices td,
#dashPoRequests td {
  overflow: hidden;
}

#dashPoNotices th:nth-child(1),
#dashPoNotices td:nth-child(1) {
  width: 118px;
}

#dashPoRequests th:nth-child(1),
#dashPoRequests td:nth-child(1) {
  width: 92px;
}

#dashPoRequests th:nth-child(2),
#dashPoRequests td:nth-child(2) {
  width: 118px;
}

#dashPoRequests th:nth-child(2),
#dashPoRequests td:nth-child(2) {
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashPoRequests td:nth-child(2) a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

#dashPoNotices th:nth-child(3),
#dashPoNotices td:nth-child(3),
#dashPoRequests th:nth-child(3),
#dashPoRequests td:nth-child(3) {
  width: 76px;
}

#dashPoRequests th:nth-child(4),
#dashPoRequests td:nth-child(4) {
  width: 138px;
}

#dashPoRequests th:nth-child(5),
#dashPoRequests td:nth-child(5) {
  overflow-wrap: normal;
  white-space: nowrap;
  width: 88px;
}

#dashPoRequests th:nth-child(6),
#dashPoRequests td:nth-child(6) {
  text-align: right;
  width: 78px;
}

#dashPoRequests th:nth-child(7),
#dashPoRequests td:nth-child(7) {
  width: auto;
}

#dashPoNotices th:last-child,
#dashPoNotices td:last-child,
#dashPoRequests th:last-child,
#dashPoRequests td:last-child {
  overflow: hidden;
  width: 136px;
}

.dashboard-notice-text {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  line-height: 1.35;
  max-height: 2.7em;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

#dashPoNotices .po-actions,
#dashPoRequests .po-actions {
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

#dashPoNotices .po-action,
#dashPoRequests .po-action {
  padding-inline: 9px;
  white-space: normal;
}

@media (max-width: 980px) {
  #dashPoNotices,
  #dashPoRequests {
    min-width: 0;
  }
}

/* Chrome presentation polish. */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar {
    height: 12px;
    width: 12px;
  }

  ::-webkit-scrollbar-track {
    background: #edf3ef;
  }

  ::-webkit-scrollbar-thumb {
    background: #b7c9bf;
    border: 3px solid #edf3ef;
    border-radius: 999px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #8fb29f;
  }
}

.panel,
.topbar,
.toolbar,
.po-search-bar {
  backdrop-filter: blur(12px);
}

.panel {
  box-shadow: 0 14px 34px rgba(24, 35, 30, 0.08);
}

.topbar {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(246,250,247,0.90)),
    radial-gradient(circle at 100% 0%, rgba(185,132,28,0.12), transparent 18rem);
}

.sidebar {
  box-shadow: 18px 0 42px rgba(24, 35, 30, 0.08);
}

.sidebar nav button {
  position: relative;
}

.sidebar nav button.active::before {
  background: #fff;
  border-radius: 999px;
  content: "";
  height: 58%;
  left: 6px;
  opacity: .95;
  position: absolute;
  top: 21%;
  width: 4px;
}

tbody tr {
  transition: background .16s var(--ease), transform .16s var(--ease);
}

tbody tr:hover {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* Direct app polish: refined shell, login, navigation, cards, and tables. */
:root {
  --canvas: #eef4ef;
  --canvas-warm: #f8f1e4;
  --panel-glass: rgba(255, 255, 255, 0.86);
  --line-soft: rgba(31, 107, 80, 0.13);
  --shadow-card: 0 18px 52px rgba(24, 35, 30, 0.10);
  --shadow-float: 0 26px 76px rgba(24, 35, 30, 0.16);
}

body {
  background:
    radial-gradient(circle at 6% 0%, rgba(185, 132, 28, 0.16), transparent 30rem),
    radial-gradient(circle at 96% 12%, rgba(31, 107, 80, 0.12), transparent 34rem),
    linear-gradient(135deg, #f8faf7 0%, var(--canvas) 48%, var(--canvas-warm) 100%);
}

.login-screen {
  background:
    linear-gradient(115deg, rgba(16, 39, 31, 0.48), rgba(238, 244, 239, 0.82) 48%, rgba(248, 241, 228, 0.88)),
    image-set(
      url("/login-bg-1280.webp") type("image/webp") 1x,
      url("/login-bg-1920.webp") type("image/webp") 2x,
      url("/login-bg-1920.jpg") type("image/jpeg")
    ) center 42%/cover no-repeat;
}

.login-panel {
  width: fit-content;
  max-width: min(92vw, 980px);
  grid-template-columns: 1.05fr 0.72fr;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.76));
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(20px);
}

.login-intro {
  border-radius: 22px;
  min-height: 260px;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(31,107,80,.15), transparent 22rem),
    linear-gradient(180deg, rgba(232,244,239,.78), rgba(255,255,255,.44));
}

.login-logo {
  width: min(220px, 64vw);
  margin-bottom: 12px;
}

.login-intro h1 {
  margin-bottom: 0;
  color: #17241f;
  font-size: clamp(26px, 3.6vw, 42px);
  letter-spacing: -0.055em;
}

#loginForm {
  align-self: center;
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 260px;
  border: 1px solid rgba(31, 107, 80, 0.12);
  border-radius: 22px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 14px 36px rgba(24, 35, 30, 0.08);
}

#loginForm::before {
  content: "Sign in to continue";
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

#loginError:empty {
  min-height: 0;
  margin: 0;
}

.app {
  background:
    radial-gradient(circle at 20% 0%, rgba(185, 132, 28, 0.11), transparent 28rem),
    linear-gradient(135deg, rgba(248,250,247,.92), rgba(238,244,239,.78));
}

.sidebar {
  border-right: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,251,249,.88)),
    radial-gradient(circle at 0% 0%, rgba(31,107,80,.10), transparent 16rem);
  box-shadow: 16px 0 50px rgba(24, 35, 30, 0.08);
}

.brand {
  border: 1px solid rgba(31, 107, 80, 0.11);
  border-radius: 18px;
  background: rgba(255,255,255,0.70);
  padding: 10px;
}

.brand-mark {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 10px 24px rgba(31, 107, 80, 0.22);
}

.brand strong {
  letter-spacing: -0.025em;
}

nav button {
  border-radius: 13px;
  min-height: 43px;
}

nav button.active {
  background: linear-gradient(135deg, #e8f4ef, #f7fbf8);
  border-color: rgba(31, 107, 80, 0.22);
  box-shadow: inset 4px 0 0 var(--green), 0 8px 22px rgba(31, 107, 80, 0.10);
}

.content {
  padding: clamp(16px, 2.2vw, 30px);
}

.topbar,
.panel,
.toolbar,
.po-search-bar {
  border-color: var(--line-soft);
  background: var(--panel-glass);
  box-shadow: var(--shadow-card);
}

.topbar {
  border-radius: 24px;
  padding: 20px 22px;
}

.topbar h2 {
  font-size: clamp(25px, 3.2vw, 36px);
  letter-spacing: -0.045em;
}

.panel {
  border-radius: 22px;
}

.dashboard-grid .panel,
.stock-grid .panel,
.report-grid .panel {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.dashboard-grid .panel:hover,
.stock-grid .panel:hover,
.report-grid .panel:hover {
  border-color: rgba(31, 107, 80, 0.22);
  box-shadow: var(--shadow-float);
  transform: translateY(-2px);
}

input,
select,
textarea {
  border-color: rgba(31, 107, 80, 0.18);
  background: rgba(255,255,255,0.86);
}

button {
  border-radius: 12px;
}

button.ghost {
  background: rgba(255,255,255,0.62);
}

th {
  background: #edf5f0;
  color: #43534b;
}

tbody tr:nth-child(even) td {
  background: rgba(250, 253, 251, 0.72);
}

tbody tr:hover td {
  background: #eef7f2;
}

.status {
  border-radius: 999px;
  font-weight: 850;
}

.toast,
.po-incoming-alert {
  border: 1px solid rgba(31, 107, 80, 0.18);
  box-shadow: var(--shadow-float);
}

@media (max-width: 760px) {
  .login-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .login-intro {
    min-height: auto;
    padding: 18px;
  }

  #loginForm {
    min-height: auto;
    padding: 18px;
  }
}

/* Final dashboard overrides for System Admin compact notices plus trend card. */
.admin-compact-notices #dashPoNotices,
.admin-compact-notices #dashPoNotices th,
.admin-compact-notices #dashPoNotices td {
  min-width: 0;
  white-space: nowrap;
}

.admin-compact-notices #dashPoNotices th:last-child,
.admin-compact-notices #dashPoNotices td:last-child {
  background: inherit;
  box-shadow: none;
  overflow: hidden;
  position: static;
  right: auto;
  width: 38%;
  z-index: auto;
}

.admin-compact-notices #dashPoNotices th:nth-child(1),
.admin-compact-notices #dashPoNotices td:nth-child(1) {
  width: 32%;
}

.admin-compact-notices #dashPoNotices th:nth-child(2),
.admin-compact-notices #dashPoNotices td:nth-child(2) {
  width: 30%;
}

@media (max-width: 980px) {
  .dashboard-half-panel {
    grid-column: 1 / -1;
  }

  .warehouse-health-chips {
    grid-template-columns: 1fr;
  }

  .admin-compact-notices #dashPoNotices {
    min-width: 0;
  }
}

/* Keep the Consumption Trends card dark even after generic panel polish. */
.consumption-trends-panel {
  background:
    radial-gradient(circle at 52% 58%, rgba(127, 74, 255, 0.30), transparent 15rem),
    linear-gradient(180deg, #171833 0%, #101226 100%) !important;
  border-color: rgba(112, 95, 198, 0.48) !important;
  color: #fff;
  padding: 0 !important;
}

.consumption-trends-panel .trend-chart-top h3 {
  color: #fff !important;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
}

/* Keep the Inventory Variances card dark even after generic panel polish. */
.dashboard-grid .branch-variance-panel,
.dashboard-grid .branch-variance-panel:hover {
  background:
    radial-gradient(circle at 18% 20%, rgba(67, 223, 242, 0.20), transparent 12rem),
    radial-gradient(circle at 84% 62%, rgba(181, 108, 255, 0.22), transparent 13rem),
    linear-gradient(180deg, #171833 0%, #101226 100%) !important;
  border-color: rgba(112, 95, 198, 0.48) !important;
  color: #fff;
  padding: 0 !important;
  box-shadow: 0 22px 58px rgba(19, 18, 48, 0.30) !important;
}

.branch-variance-panel .trend-chart-top h3 {
  color: #fff !important;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
}

/* UX clarity pass: make every tab feel guided, readable, and touch-friendly. */
body {
  background:
    radial-gradient(circle at 78% 6%, rgba(255, 183, 77, 0.12), transparent 24rem),
    radial-gradient(circle at 6% 22%, rgba(31, 107, 80, 0.14), transparent 23rem),
    linear-gradient(135deg, #f7faf7 0%, #eef5f0 52%, #fbf7ee 100%);
}

.content {
  gap: 18px;
}

.view {
  animation: viewFadeIn 0.18s ease-out;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  align-items: center;
  gap: 18px;
  min-height: 94px;
}

.topbar-copy {
  min-width: 0;
}

.topbar h2 {
  line-height: 1.02;
}

.topbar-copy p {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.45;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
}

.sync-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(31, 107, 80, 0.10);
}

.panel {
  overflow: hidden;
  padding: clamp(16px, 2vw, 24px);
}

.panel::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 42%);
}

.panel > * {
  position: relative;
  z-index: 1;
}

.consumption-trends-panel::after,
.branch-variance-panel::after {
  display: none;
}

.panel h3,
.panel-head h3,
.section-heading h3 {
  color: #17241f;
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.panel p,
.section-heading p,
.panel-head p {
  line-height: 1.45;
}

.panel-head,
.section-heading {
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(215, 224, 219, 0.70);
}

.toolbar,
.po-search-bar,
.report-actions,
.inline-actions,
.branch-toolbar {
  gap: 10px;
}

.toolbar,
.po-search-bar {
  border-radius: 18px;
  padding: 12px;
}

label {
  color: #596a61;
  font-size: 0.86rem;
  font-weight: 850;
}

input,
select,
textarea {
  min-height: 44px;
  border-radius: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

textarea {
  width: 100%;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 107, 80, 0.46);
  box-shadow: 0 0 0 4px rgba(31, 107, 80, 0.12);
  outline: none;
}

button,
.table-action,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

button:hover,
.table-action:hover,
.link-button:hover {
  transform: translateY(-1px);
}

button:active,
.table-action:active,
.link-button:active {
  transform: translateY(0);
}

button:focus-visible,
.table-action:focus-visible,
.link-button:focus-visible,
nav button:focus-visible {
  outline: 3px solid rgba(31, 107, 80, 0.26);
  outline-offset: 2px;
}

nav button {
  justify-content: flex-start;
  color: #4b5d54;
}

nav button.active {
  color: #174932;
}

nav .nav-section {
  margin-top: 12px;
  color: #7a8980;
  font-size: 0.68rem;
}

.table-wrap,
.manual-adjustment-wrap,
.all-branches-inventory-wrap {
  border: 1px solid rgba(215, 224, 219, 0.84);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.80);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid rgba(191, 207, 198, 0.92);
  font-size: 0.78rem;
  letter-spacing: .055em;
  text-transform: uppercase;
}

td {
  color: #26342e;
  line-height: 1.36;
  vertical-align: middle;
}

tbody tr td:first-child,
tbody tr th:first-child {
  border-left: 0;
}

tbody tr:hover td,
tbody tr:hover th {
  background: #eaf5ef;
}

.empty-state {
  min-height: 118px;
  padding: 28px;
  border: 1px dashed rgba(31, 107, 80, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(31, 107, 80, 0.08), transparent 12rem),
    rgba(250, 253, 251, 0.78);
  color: #64756c;
  text-align: center;
}

.empty-state strong {
  display: block;
  color: #21312a;
  font-size: 0.98rem;
  font-weight: 900;
}

.empty-state span {
  display: block;
  max-width: 34rem;
  margin-top: 6px;
  font-size: 0.9rem;
}

.empty-state::before {
  opacity: .72;
}

.status {
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  line-height: 1.15;
  text-align: center;
}

.card-collapse-toggle {
  border-radius: 999px;
  min-width: 38px;
  position: absolute;
  right: 16px;
  top: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  padding: 0;
}

.panel.card-collapsible {
  padding-top: clamp(16px, 2vw, 24px);
}

.panel.card-collapsible > h3,
.panel.card-collapsible > .panel-head,
.panel.card-collapsible > .section-heading {
  padding-right: 52px;
}

.panel.card-collapsed {
  min-height: 72px;
}

.modal-panel,
.po-detail-panel,
.po-review-panel {
  border: 1px solid rgba(215, 224, 219, 0.92);
  border-radius: 24px;
  box-shadow: 0 34px 90px rgba(24, 35, 30, 0.24);
}

.toast {
  border-radius: 16px;
}

.po-number-link,
.document-link,
a.table-action {
  font-weight: 900;
  text-underline-offset: 3px;
}

.warehouse-health-row,
.po-line-row,
.delivery-line,
.count-line,
.transfer-line {
  border-radius: 16px;
}

.product-sales-nested-table th {
  background: #104f64;
  color: #fff;
}

.product-sales-nested-table td,
.product-sales-nested-table th {
  white-space: nowrap;
}

.vendor-po-workspace,
.admin-grid,
.report-grid,
.stock-grid,
.dashboard-grid {
  gap: 18px;
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    min-height: auto;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions select,
  .top-actions button,
  .toolbar input,
  .toolbar select,
  .po-search-bar input,
  .po-search-bar select {
    width: 100%;
    max-width: none;
  }

  .panel-head,
  .section-heading,
  .toolbar,
  .po-search-bar,
  .report-actions,
  .inline-actions {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 12px;
  }

  .topbar,
  .panel,
  .toolbar,
  .po-search-bar {
    border-radius: 16px;
  }

  .panel {
    padding: 14px;
  }

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

  .empty-state {
    min-height: 96px;
    padding: 20px;
  }
}
