:root {
  color: #18212f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.mobile-header {
  display: none;
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex: 0 0 248px;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  padding: 24px 16px 16px;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}

.greeting {
  margin: 0 12px 30px;
  color: #18212f;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.tab-list {
  display: grid;
  gap: 4px;
}

.subtab-list { display: grid; gap: 2px; margin: -2px 0 2px 31px; }
.subtab-list a { overflow: hidden; padding: 5px 8px; border-radius: 5px; color: #6b7280; font-size: 12px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.subtab-list a:hover { color: #18212f; background: #eef2f7; }

.tab,
.logout-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  color: #4b5563;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

.tab:hover,
.logout-button:hover {
  background: #eef2f7;
  color: #18212f;
}

.tab--active {
  color: #18212f;
  background: #e8edf4;
}

.logout-button {
  cursor: pointer;
}

.main-content {
  flex: 1;
  min-width: 0;
  background: #ffffff;
}

.table-layout {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 24px;
}

.page-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 16px;
  margin-bottom: 20px;
  background: #ffffff;
}

.page-header h1 {
  margin: 0;
  color: #18212f;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.page-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header__actions {
  display: flex;
  gap: 8px;
}

.page-header__search {
  width: 260px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  color: #18212f;
  background: #ffffff;
  font: inherit;
  font-size: 14px;
}

.page-header__search:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
  border-color: #2563eb;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0 16px 24px;
}

.dashboard-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 152px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
}

.dashboard-card--wide,
.dashboard-card--accent {
  grid-column: span 2;
}

.dashboard-card--chart {
  grid-column: 1 / -1;
  min-height: 300px;
}

.dashboard-card--alert {
  border-color: #fecaca;
  background: #fffafa;
}

.dashboard-card--warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.dashboard-card--accent {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.dashboard-card--header,
.dashboard-card__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-card h2,
.dashboard-card__label,
.dashboard-card__metric,
.dashboard-card__empty {
  margin: 0;
}

.dashboard-card h2 {
  color: #18212f;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dashboard-card__count {
  display: grid;
  flex: 0 0 auto;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  color: #374151;
  background: #eef2f7;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-card__period {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

.dashboard-chart {
  position: relative;
  min-height: 220px;
  padding-top: 16px;
}

.dashboard-chart svg {
  display: block;
  width: 100%;
  height: 220px;
  overflow: visible;
}

.dashboard-chart__maximum {
  position: absolute;
  top: 0;
  left: 0;
  color: #6b7280;
  font-size: 12px;
}

.dashboard-chart__labels {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  font-size: 12px;
}

.dashboard-chart__gridline {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.dashboard-chart__baseline {
  stroke: #cbd5e1;
  stroke-width: 1.5;
}

.dashboard-chart__line {
  fill: none;
  stroke: #2563eb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.dashboard-chart__point {
  fill: #ffffff;
  stroke: #2563eb;
  stroke-width: 3;
}

.dashboard-card--alert .dashboard-card__count {
  color: #b91c1c;
  background: #fee2e2;
}

.dashboard-card--warning .dashboard-card__count {
  color: #a16207;
  background: #fef3c7;
}

.dashboard-card--accent .dashboard-card__count {
  color: #1d4ed8;
  background: #dbeafe;
}

.dashboard-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #4b5563;
  font-size: 13px;
}

.dashboard-list strong {
  color: #18212f;
}

.dashboard-list--names li {
  display: block;
  color: #1e3a8a;
  font-weight: 600;
}

.dashboard-card__empty {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-card--metric {
  justify-content: space-between;
}

.dashboard-card__label {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

.dashboard-card__metric {
  color: #18212f;
  font-size: 36px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.work-page { display: grid; gap: 20px; padding: 0 16px 32px; }
.work-standalone { min-height: 100vh; background: #ffffff; }
.work-standalone__content { width: 100%; max-width: 1440px; margin: 0 auto; padding-top: 24px; }
.work-search { display: grid; gap: 7px; width: 100%; color: #374151; font-size: 14px; font-weight: 600; }
.work-search input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; font: inherit; }
.work-results, .work-completed { display: grid; gap: 8px; }
.work-completed { padding-top: 20px; border-top: 1px solid #e5e7eb; }
.work-completed h2 { margin: 0 0 8px; font-size: 18px; }
.work-item { width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid #e5e7eb; color: #374151; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.work-item:hover { color: #18212f; }
.work-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.work-count-fields { display: grid; gap: 16px; }
.work-see-more { justify-self: start; padding: 0; border: 0; color: #2563eb; background: transparent; font: inherit; cursor: pointer; }
.work-see-more:hover { text-decoration: underline; }
.work-message { margin: 0; color: #b91c1c; }

.button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.button--primary {
  color: #ffffff;
  background: #18212f;
}

.button--primary:hover {
  background: #29364a;
}

.button--secondary {
  color: #374151;
  background: #eef2f7;
}

.button--secondary:hover {
  background: #e2e8f0;
}

.button--destructive {
  color: #ffffff;
  background: #b91c1c;
}

.button--destructive:hover {
  background: #991b1b;
}

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

.table-scroll {
  width: 100%;
  max-height: calc(100vh - 100px);
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-spacing: 0;
  border-collapse: collapse;
  color: #374151;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #6b7280;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.table-sort {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.table-sort:hover {
  color: #18212f;
}

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

.data-table__empty {
  color: #6b7280;
  text-align: center !important;
}

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

.login-card {
  width: min(100%, 360px);
  padding: 28px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgb(24 33 47 / 8%);
}

.login-card h1 {
  margin: 0 0 24px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #18212f;
  background: #ffffff;
  font: inherit;
}

.login-form input:focus {
  border-color: #64748b;
  outline: 2px solid #cbd5e1;
  outline-offset: 1px;
}

.login-form .button {
  min-height: 40px;
}

.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #991b1b;
  background: #fef2f2;
  font-size: 14px;
}

.login-copy,
.modal-help {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.45;
}

.login-copy {
  margin: -12px 0 20px;
}

.data-table__row--interactive {
  cursor: pointer;
}

.data-table__row--interactive:focus {
  outline: 2px solid #64748b;
  outline-offset: -2px;
}

.modal {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
}

.modal[open] {
  display: grid;
  place-items: center;
}

.modal::backdrop {
  background: rgb(24 33 47 / 35%);
}

.modal__panel {
  width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgb(24 33 47 / 20%);
}

.modal__panel--small {
  max-width: 420px;
}

.modal__panel--medium {
  max-width: 560px;
}

.modal__panel--large {
  max-width: 760px;
}

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

.modal__header h2 {
  margin: 0;
  color: #18212f;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.modal-form {
  display: grid;
  gap: 16px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.modal-form input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #18212f;
  background: #ffffff;
  font: inherit;
}

.modal-form input:focus {
  border-color: #64748b;
  outline: 2px solid #cbd5e1;
  outline-offset: 1px;
}

.modal-product-form {
  display: grid;
  gap: 24px;
}

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

.modal-product-form > .modal-section + .modal-section {
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.modal-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-section__title {
  margin: 0;
  color: #18212f;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.modal-form__field {
  display: grid;
  gap: 7px;
}

.modal-form__label {
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.modal-form__field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #18212f;
  background: #ffffff;
  font: inherit;
}

.modal-form__field select {
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #18212f;
  background: #ffffff;
  font: inherit;
}

.modal-form__field input:focus {
  border-color: #64748b;
  outline: 2px solid #cbd5e1;
  outline-offset: 1px;
}

.modal-form__field select:focus {
  border-color: #64748b;
  outline: 2px solid #cbd5e1;
  outline-offset: 1px;
}

.modal-form__field input[readonly] {
  color: #6b7280;
  background: #f8fafc;
}

.barcode-field input {
  cursor: pointer;
}

.barcode-field__control {
  position: relative;
}

.barcode-field__control input {
  width: 100%;
  padding-right: 64px;
}

.barcode-field__cancel {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 1;
  padding: 4px 0;
  border: 0;
  color: #2563eb;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transform: translateY(-50%);
  white-space: nowrap;
}

.barcode-field__cancel:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.barcode-field--listening input {
  border-color: #2563eb;
  outline: 2px solid #bfdbfe;
  outline-offset: 1px;
}

.barcode-field--saved input {
  border-color: #86efac;
  color: #166534;
  background: #f0fdf4;
}

.modal-form__field input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.modal-form__field input[type="number"]::-webkit-inner-spin-button,
.modal-form__field input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.container-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.container-editor--pending {
  border-style: dashed;
  background: #f8fafc;
}

.container-editor__heading {
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.container-editor__action {
  justify-self: start;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
}

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

.shipping-container-list__item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.shipping-container-list__number {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-top: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: #4b5563;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.shipping-container-list__number::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  width: 14px;
  height: 16px;
  content: "";
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'%3E%3Cpath d='M2 4h10M5 4V2h4v2M3 4l.7 10h6.6L11 4M6 7v4M8 7v4'/%3E%3C/svg%3E");
  transform: translate(-50%, -50%);
}

.shipping-container-list__item:hover .shipping-container-list__number,
.shipping-container-list__number:focus-visible {
  color: transparent;
  background: #dc2626;
}

.shipping-container-list__item:hover .shipping-container-list__number::after,
.shipping-container-list__number:focus-visible::after {
  display: block;
}

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

.modal-form__group {
  display: grid;
  gap: 16px;
}

.modal-form__group--additional {
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.modal-form__group[hidden],
.modal__footer[hidden] {
  display: none;
}

.modal-form__group-title {
  margin: 0;
  color: #18212f;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.modal__footer {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.modal__footer > .button {
  height: 36px;
  min-height: 36px;
}
.delivery-breakdown { display: grid; gap: 8px; }
.delivery-breakdown__sku { display:flex; justify-content:space-between; gap:16px; padding:12px; border:1px solid #e5e7eb; border-radius:7px; color:#18212f; }
.delivery-breakdown__component { margin-left:24px; padding:8px 12px; border-left:2px solid #cbd5e1; color:#4b5563; font-size:14px; }

.modal-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.modal-details > div {
  min-height: 72px;
  padding: 12px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.modal-details > div:nth-child(even) {
  border-right: 0;
}

.modal-details > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.modal-details dt {
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.modal-details dd {
  margin: 0;
  color: #18212f;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.modal-loading,
.modal-message {
  margin: 0;
  padding: 12px;
  border-radius: 7px;
  color: #4b5563;
  background: #f8fafc;
  font-size: 14px;
}

.modal-message {
  color: #991b1b;
  background: #fef2f2;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
  }

  .mobile-header__greeting {
    margin: 0;
    color: #18212f;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.03em;
  }

  .mobile-menu-button {
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 7px;
    color: #18212f;
    background: #eef2f7;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .sidebar {
    display: none;
    position: fixed;
    z-index: 50;
    inset: 60px 0 0;
    width: 100%;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    padding: 16px;
    overflow-y: auto;
    border: 0;
  }

  .sidebar.sidebar--open {
    display: flex;
  }

  .sidebar .greeting {
    display: none;
  }

  .sidebar .tab {
    min-height: 48px;
    font-size: 16px;
  }

  .sidebar .logout-button {
    min-height: 48px;
    font-size: 16px;
  }

  .table-layout {
    padding-top: 12px;
  }

  .page-header {
    top: 60px;
    align-items: flex-start;
    min-height: 0;
    padding: 0 16px;
  }

  .page-header__right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .page-header__search {
    width: min(260px, 100%);
  }

  .page-header h1 {
    font-size: 26px;
  }

  .table-scroll {
    max-height: calc(100dvh - 152px);
  }

  .modal {
    position: fixed;
    z-index: 40;
    inset: 60px 0 0;
    width: 100vw;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    max-height: none;
    padding: 0;
    background: rgb(24 33 47 / 35%);
  }

  .modal[open] {
    place-items: stretch;
  }

  .modal__panel,
  .modal__panel--small,
  .modal__panel--medium,
  .modal__panel--large {
    width: 100%;
    max-width: none;
    min-height: 100%;
    max-height: 100%;
    padding: 20px 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .dashboard-grid,
  .modal-form__columns {
    grid-template-columns: 1fr;
  }

  .dashboard-card--wide,
  .dashboard-card--accent {
    grid-column: span 1;
  }

  .dashboard-card--chart {
    grid-column: 1;
  }
}
