:root {
  color-scheme: light;
  --ink: #18202f;
  --muted: #617086;
  --line: #d9e0ea;
  --line-strong: #c4cedb;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #eef4f1;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --teal: #0f766e;
  --green: #15803d;
  --amber: #b45309;
  --red: #b42318;
  --violet: #6d28d9;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
  --radius: 8px;
  --sidebar: 260px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px;
  background: #172033;
  color: #eef4ff;
}

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

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

.brand strong {
  font-size: 18px;
}

.brand small {
  color: #aebbd0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #243047;
}

.brand-mark span {
  background: #7dd3fc;
  border-radius: 2px;
}

.brand-mark span:nth-child(2) {
  background: #86efac;
}

.brand-mark span:nth-child(3) {
  grid-column: span 2;
  background: #facc15;
}

.site-logo {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  flex: 0 0 auto;
  object-fit: contain !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.auth-brand .site-logo {
  border-color: var(--line);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #cbd5e1;
  font-size: 13px;
  padding: 10px 8px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 4px;
  font-size: 17px;
}

.panel-header p,
.modal-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions,
.toolbar,
.panel-header,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 14px;
}

.dashboard-filter strong {
  display: block;
  font-size: 16px;
}

.dashboard-filter small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin: 0;
}

.filter-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.custom-range-form {
  display: grid;
  grid-template-columns: 145px 145px auto;
  gap: 8px;
  align-items: end;
}

.custom-range-form label {
  font-size: 11px;
  text-transform: uppercase;
}

.custom-range-form input {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 8px;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.filter-form .primary-button,
.filter-form .secondary-button {
  min-height: 40px;
}

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 10px;
}

.dashboard-section-heading h2 {
  margin: 0;
  font-size: 21px;
}

.dashboard-section-heading small {
  color: var(--muted);
}

.search {
  width: min(360px, 100%);
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.mode-select {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mode-select select {
  min-height: 34px;
  min-width: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.primary-button {
  padding: 0 14px;
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button,
.ghost-button {
  padding: 0 12px;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  color: var(--red);
  border-color: #fecaca;
  background: #fff7f7;
  font-weight: 800;
}

.ghost-button {
  background: transparent;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.icon {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item .icon {
  color: #93c5fd;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.compact-metrics .metric {
  min-height: 86px;
  padding: 12px;
}

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

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
}

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

.metric strong.compact-metric {
  font-size: 17px;
  line-height: 1.35;
  word-break: break-word;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.split-layout,
.receiving-grid,
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.narrow-right {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.65fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-header {
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header select,
.toolbar select,
label select,
label input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #edf2ff;
  color: #1d4ed8;
}

.status.received,
.status.available,
.status.packed,
.status.shipped,
.status.completed {
  background: #dcfce7;
  color: var(--green);
}

.status.awaiting-pick,
.status.picking,
.status.packing {
  background: #e0f2fe;
  color: #0369a1;
}

.status.exception,
.status.low,
.status.rejected {
  background: #fee2e2;
  color: var(--red);
}

.status.awaiting {
  background: #fef3c7;
  color: var(--amber);
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  margin-top: 10px;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.stage-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 10px;
  padding: 16px;
}

.stage-card {
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.stage-card header {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
}

.stage-card ul {
  list-style: none;
  display: grid;
  gap: 7px;
  padding: 10px;
  margin: 0;
}

.mini-order {
  padding: 9px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 12px;
}

.mini-order strong {
  display: block;
  margin-bottom: 3px;
}

.warehouse-map {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 16px;
}

.zone {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--teal);
}

.zone strong {
  font-size: 18px;
}

.zone small {
  font-weight: 800;
}

.zone.cool {
  background: #0e7490;
}

.zone.busy {
  background: var(--amber);
}

.zone.hot {
  background: var(--red);
}

.table-wrap {
  overflow: auto;
}

.table-wrap.action-menu-wrap {
  overflow: visible;
}

.table-wrap.tall {
  max-height: calc(100vh - 210px);
}

.table-wrap.tall.action-menu-wrap {
  max-height: none;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

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

.row-title small {
  color: var(--muted);
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.inline-form {
  margin: 0;
}

.row-menu {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.row-menu summary {
  width: 38px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu-panel {
  min-width: 138px;
  display: grid;
  gap: 4px;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.row-menu-panel a,
.row-menu-panel button {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.row-menu-panel a:hover,
.row-menu-panel button:hover {
  background: #f8fafc;
}

.row-menu-panel form {
  margin: 0;
}

.payment-form,
.assign-client-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.payment-form input,
.assign-client-form input,
.assign-client-form select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--ink);
}

.payment-form input {
  width: 104px;
}

.assign-client-form {
  min-width: 380px;
}

.assign-client-form select,
.assign-client-form input {
  width: 170px;
}

.payment-form button,
.assign-client-form button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.invoice-detail-grid .form-grid {
  grid-template-columns: 1fr;
  padding: 0;
}

.service-record-form {
  display: grid;
  grid-template-columns: 84px minmax(220px, 1fr) 130px 170px auto;
  gap: 8px;
  align-items: center;
}

.service-record-form input,
.service-record-form select,
.service-record-form button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--ink);
}

.service-record-form button {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
}

.task-archive-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.task-archive-form select,
.task-archive-form button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
}

.task-archive-form select {
  padding: 0 10px;
  color: var(--ink);
}

.task-archive-form button {
  padding: 0 12px;
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 800;
}

.task-archive-form small {
  grid-column: 1 / -1;
}

.task-action-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.task-action-form button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--blue);
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.task-action-form .danger-button {
  color: var(--red);
  border-color: #fecaca;
  background: #fff7f7;
}

.task-action-form small {
  flex-basis: 100%;
  text-align: right;
}

.action-row button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.segmented button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #172033;
  color: #ffffff;
}

.alert-list,
.appointment-list,
.wave-list,
.client-grid {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.alert,
.appointment,
.wave,
.client-card,
.pack-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.alert {
  border-left: 4px solid var(--amber);
}

.alert.critical {
  border-left-color: var(--red);
}

.alert strong,
.appointment strong,
.wave strong,
.client-card strong {
  display: block;
  margin-bottom: 4px;
}

.alert p,
.appointment p,
.wave p,
.client-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.readonly-field {
  min-height: 40px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.readonly-field strong {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #f8fafc;
  color: var(--ink);
}

.service-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.fba-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fba-sku-lines {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.fba-sku-row {
  display: grid;
  grid-template-columns: 58px minmax(260px, 1fr) 86px 92px 104px 130px minmax(130px, 0.7fr) 84px;
  min-width: 1080px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-left: 5px solid #2563eb;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.fba-sku-row:nth-child(2n) {
  border-left-color: #0f766e;
}

.fba-sku-row:nth-child(3n) {
  border-left-color: #b45309;
}

.fba-line-title {
  align-self: center;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}

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

.fba-row-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fba-row-field input,
.fba-row-field select {
  width: 100%;
  min-height: 38px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  font-weight: 500;
}

.fba-check-field {
  min-height: 38px;
  align-self: end;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.fba-check-field input[type="checkbox"],
label.fba-check-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
  accent-color: var(--blue);
}

.fba-check-field input[type="hidden"] {
  display: none;
}

.fba-remove-row {
  align-self: end;
  min-height: 38px;
  padding: 0 12px;
  color: var(--red);
  border-color: #fecaca;
  background: #fff7f7;
}

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

.invoice-builder .form-grid {
  grid-template-columns: 1fr;
}

.invoice-form-top {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1fr);
  gap: 32px;
  align-items: start;
}

.invoice-form-top section {
  display: grid;
  gap: 8px;
}

.invoice-form-top input[readonly] {
  color: var(--ink);
  background: #f8fafc;
}

.invoice-heading {
  justify-self: end;
  width: min(420px, 100%);
}

.invoice-heading h2 {
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.invoice-lines {
  display: grid;
  gap: 8px;
}

.invoice-lines-head,
.invoice-line {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 110px 130px 130px 42px;
  gap: 8px;
  align-items: center;
}

.invoice-lines-head {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-line {
  padding: 8px 0;
}

.invoice-line input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
}

.invoice-line strong {
  text-align: right;
}

.add-line-button {
  justify-self: start;
  color: var(--blue);
  font-weight: 800;
}

.invoice-total-box {
  justify-self: end;
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.invoice-total-box > div,
.discount-row,
.invoice-total-box label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.discount-row input {
  width: 120px;
}

.discount-row select {
  width: 76px;
}

.invoice-grand-total {
  min-height: 54px;
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.service-fields[hidden],
#bubbleFeetField[hidden] {
  display: none;
}

.helper-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.checkbox-field {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

.estimate-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.estimate-card span,
.estimate-card small {
  color: var(--muted);
  font-size: 13px;
}

.estimate-card strong {
  font-size: 24px;
}

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

label input,
label select {
  width: 100%;
  color: var(--ink);
  font-weight: 500;
}

.form-button {
  align-self: end;
}

.work-grid {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.7fr);
}

.pack-station {
  padding: 16px;
}

.pack-card {
  display: grid;
  gap: 12px;
}

.scan-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.scan-strip input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
}

.conveyor {
  height: 70px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, #d7dee9 0 18px, #c7d0dd 18px 36px);
  border: 1px solid var(--line-strong);
}

.box {
  position: absolute;
  top: 15px;
  width: 42px;
  height: 38px;
  border-radius: 5px;
  background: #c08457;
  border: 2px solid #8b5e34;
  animation: travel 7s linear infinite;
}

.box:nth-child(2) {
  animation-delay: -2.5s;
}

.box:nth-child(3) {
  animation-delay: -5s;
}

@keyframes travel {
  from {
    left: -60px;
  }
  to {
    left: calc(100% + 60px);
  }
}

.client-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  padding: 0;
}

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

.portal-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #eef7f5 100%);
}

.portal-hero h2 {
  font-size: 24px;
}

.portal-hero p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.audit-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.audit-entry {
  display: grid;
  grid-template-columns: minmax(160px, 0.25fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.audit-entry small {
  color: var(--muted);
}

.permission {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.permission.yes {
  color: var(--green);
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.permission.no {
  color: var(--muted);
}

.client-card {
  box-shadow: var(--shadow);
}

.client-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.client-stats div {
  padding: 9px;
  border-radius: 7px;
  background: #f8fafc;
}

.client-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.client-stats b {
  font-size: 18px;
}

dialog {
  width: min(760px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.26);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  background: #ffffff;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  padding: 16px 18px 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef4f1;
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-brand {
  padding: 0;
  color: var(--ink);
}

.auth-brand small {
  color: var(--muted);
}

.auth-card h1 {
  margin-bottom: 0;
}

.auth-copy,
.auth-help {
  margin: 0;
  color: var(--muted);
}

.auth-help {
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form .primary-button {
  width: 100%;
}

.form-error,
.form-success {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.form-error {
  background: #fee2e2;
  color: var(--red);
}

.form-success {
  background: #dcfce7;
  color: var(--green);
}

.form-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  padding: 11px 12px;
}

.form-note.is-working {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--blue);
}

.form-note.is-success {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: var(--green);
}

.form-note.is-error {
  border-color: #fecaca;
  background: #fee2e2;
  color: var(--red);
}

.page-message {
  margin-bottom: 14px;
}

.page-section {
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 88px 1fr;
  }

  .sidebar {
    padding-inline: 10px;
  }

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

  .nav-item {
    justify-content: center;
  }

  .split-layout,
  .receiving-grid,
  .work-grid,
  .narrow-right {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .compact-metrics,
  .dashboard-filter,
  .custom-range-form,
  .invoice-form-top,
  .client-grid,
  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invoice-lines-head,
  .invoice-line {
    grid-template-columns: minmax(220px, 1fr) 90px 110px 110px 42px;
  }

  .fba-sku-row {
    grid-template-columns: 54px minmax(220px, 1fr) 78px 88px 102px 126px 120px 78px;
  }

  .invoice-detail-grid,
  .service-record-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

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

  .top-actions,
  .toolbar,
  .panel-header {
    align-items: stretch;
  }

  .metric-grid,
  .compact-metrics,
  .dashboard-filter,
  .custom-range-form,
  .invoice-form-top,
  .stage-board,
  .warehouse-map,
  .form-grid,
  .service-fields,
  .client-grid,
  .portal-grid {
    grid-template-columns: 1fr;
  }

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

  .main {
    padding: 14px;
  }

  .invoice-heading,
  .invoice-total-box {
    justify-self: stretch;
    width: 100%;
  }

  .invoice-lines-head {
    display: none;
  }

  .invoice-line {
    grid-template-columns: 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .fba-section-head,
  .fba-sku-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .fba-check-field,
  .fba-remove-row {
    align-self: stretch;
  }

  .invoice-line strong {
    text-align: left;
  }

  h1 {
    font-size: 26px;
  }
}
.scan-metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.scan-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr minmax(180px, 280px) minmax(150px, 190px);
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.scan-form label {
  display: grid;
  gap: 6px;
  color: #52637c;
  font-size: 13px;
  font-weight: 700;
}

.scan-input {
  min-height: 56px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.scan-button {
  min-height: 56px;
}

.scan-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin: 0 16px 16px;
  padding: 14px 16px;
  border: 1px solid #b7ebc6;
  border-radius: 8px;
  background: #eafaf0;
  color: #064e20;
}

.scan-live-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 0 16px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.scan-live-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.scan-live-log {
  display: grid;
  gap: 8px;
  margin: 0 16px 16px;
}

.scan-live-row {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.scan-live-row.success {
  border: 1px solid #b7ebc6;
  background: #eafaf0;
  color: #064e20;
}

.scan-live-row.error {
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.bulk-scan-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.bulk-scan-form label {
  display: grid;
  gap: 6px;
  color: #52637c;
  font-size: 13px;
  font-weight: 700;
}

.bulk-scan-textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.5;
  font-family: Consolas, "Courier New", monospace;
}

.bulk-apply-button {
  align-self: end;
}

.batch-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 16px 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.batch-summary span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #1f2a44;
}

.batch-summary.success {
  border: 1px solid #b7ebc6;
  background: #eafaf0;
  color: #064e20;
}

.batch-summary.blocked {
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.status.success,
.status.ready_to_ship,
.status.received,
.status.applied {
  color: #087443;
  background: #d8f8e5;
}

.status.not_found,
.status.wrong_mode,
.status.duplicate,
.status.blocked {
  color: #a51818;
  background: #ffe2e2;
}

@media (max-width: 980px) {
  .scan-metrics,
  .scan-form,
  .scan-result,
  .scan-live-panel,
  .batch-summary {
    grid-template-columns: 1fr;
    display: grid;
  }
}
