main {
  width: calc(100% - 96px);
  max-width: none;
  margin: 0 0 0 96px;
  padding: 16px 32px 112px;
}

.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  display: flex;
  width: 96px;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 18px 8px;
  background: #101126;
  box-shadow: 8px 0 28px rgba(13, 14, 35, .12);
}

.nav-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 2px auto 14px;
  place-items: center;
  border-radius: 15px;
  background: #ffb545;
  color: #171823;
  font-size: 21px;
  font-weight: 900;
}

.side-nav .nav-button {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 16px;
  background: transparent;
  color: #d9d9e5;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: none;
}

.side-nav .nav-button span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  font-size: 21px;
  line-height: 1;
}

.side-nav .nav-button:hover {
  transform: none;
  background: rgba(255, 255, 255, .08);
}

.side-nav .nav-button.active {
  background: #5553c6;
  color: #fff;
}

.actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 14px 42px rgba(20, 20, 25, .14);
  backdrop-filter: blur(16px);
}

.metrics-carousel {
  position: relative;
  margin: 0 0 18px;
}

.metrics-window {
  overflow: hidden;
  border-radius: 24px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 42px, #000 calc(100% - 42px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 42px, #000 calc(100% - 42px), transparent 100%);
}

.metrics-carousel .stats {
  display: flex;
  gap: 13px;
  margin: 0;
  transform: translateX(0);
  will-change: transform;
}

.metrics-carousel .stats.is-cycling {
  animation: metrics-loop 38s linear infinite;
}

@keyframes metrics-loop {
  from { transform: translateX(0); }
  to { transform: translateX(var(--metric-loop-distance)); }
}

.metrics-carousel .stats article {
  min-width: calc((100% - 26px) / 3);
  flex: 0 0 calc((100% - 26px) / 3);
}


.toolbar {
  margin: 18px 0;
}

#inventoryPage .toolbar {
  margin-top: 0;
  margin-bottom: 14px;
}

.settings-page {
  max-width: 760px;
}

.settings-card {
  overflow: hidden;
  border: 1px solid #e5e5e9;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 14px 48px rgba(25, 25, 30, .06);
}

.settings-card > h1,
.settings-kicker {
  margin-left: 28px;
  margin-right: 28px;
}

.settings-kicker {
  margin-top: 28px;
  margin-bottom: 4px;
  color: #8a8a91;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.settings-card > h1 {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 36px;
  letter-spacing: -1.4px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  border-top: 1px solid #ededf0;
}

.settings-row > div {
  display: grid;
  gap: 4px;
}

.settings-row strong {
  font-size: 15px;
}

.settings-row span {
  color: #7d7d84;
  font-size: 13px;
}

.danger-row {
  background: #fcfcfd;
}

.calendar-card {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid #e5e5e9;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 14px 48px rgba(25, 25, 30, .055);
}

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

.calendar-head p {
  margin: 0 0 3px;
  color: #898990;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.calendar-head h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -1px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.calendar-controls select,
.calendar-controls input {
  width: auto;
  height: 40px;
  padding: 8px 12px;
  border-radius: 13px;
  background: #f5f5f7;
  font-size: 13px;
  font-weight: 800;
}

.calendar-controls input {
  width: 86px;
}

.calendar-arrow {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border-radius: 13px;
  background: #ededf0;
  color: #303036;
  font-size: 25px;
}

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

.calendar-weekdays {
  margin-bottom: 7px;
}

.calendar-weekdays span {
  padding: 0 8px;
  color: #94949b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calendar-day,
.calendar-blank {
  min-height: 92px;
  border-radius: 17px;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 11px;
  border: 1px solid #ececef;
  background: #fafafc;
  color: #77777d;
  text-align: left;
  box-shadow: none;
}

.calendar-day:disabled {
  cursor: default;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px #ffb545;
}

.calendar-day.has-sales {
  border-color: #cfe9d5;
  background: #f0faf3;
  color: #26763a;
}

.calendar-day.has-sales:hover {
  transform: translateY(-2px);
  border-color: #a8dcb4;
  background: #e9f7ed;
}

.calendar-day > span {
  font-size: 12px;
  font-weight: 900;
}

.calendar-day strong {
  margin-top: auto;
  font-size: 15px;
}

.calendar-day small {
  margin-top: 2px;
  color: #6c9a77;
  font-size: 9px;
  font-weight: 800;
}

.loss {
  color: #bd4038 !important;
}

.day-dialog {
  width: min(650px, calc(100% - 28px));
}

.day-dialog-inner {
  padding: 28px;
}

.day-dialog .dialog-head p {
  margin: 0 0 3px;
  color: #818188;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.day-sales {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.day-sales article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  border-radius: 17px;
  background: #f6f6f8;
}

.day-sales article > div:first-child,
.day-profit {
  display: grid;
  gap: 3px;
}

.day-sales article span {
  color: #808087;
  font-size: 11px;
}

.day-profit {
  justify-items: end;
  color: #26763a;
  white-space: nowrap;
}

.day-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.day-totals div {
  padding: 16px;
  border: 1px solid #d7eadb;
  border-radius: 17px;
  background: #f0faf3;
}

.day-totals span,
.day-totals strong {
  display: block;
}

.day-totals span {
  color: #64806b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.day-totals strong {
  margin-top: 4px;
  color: #26763a;
  font-size: 22px;
}

.grid {
  grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
  gap: 18px;
}

.item {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 248px;
  min-height: 248px;
  padding: 24px calc(36% + 28px) 24px 24px;
  overflow: visible;
  border: 1px solid #ececef;
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 32px rgba(25, 25, 30, .045);
}

.item:hover {
  border-color: #dedee3;
  box-shadow: 0 16px 44px rgba(25, 25, 30, .075);
}

.item.sold {
  background: linear-gradient(145deg, #f5fcf7, #edf9f0);
  border-color: #ccebd4;
  box-shadow: 0 10px 32px rgba(34, 139, 60, .07);
}

.item-top {
  display: block;
}

.item-top h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -.35px;
}

.item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.item .date-pill,
.item .pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid #e7e7eb;
  border-radius: 999px;
  background: #f7f7f9;
  color: #64646b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.item .date-pill::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background: #ffae32;
  box-shadow: 0 0 0 3px rgba(255, 174, 50, .14);
}

.item .pill {
  border-color: transparent;
  background: #ededf0;
  color: #29292c;
}

.item.sold .pill {
  background: #d8f1de;
  color: #24753a;
}

.item > p {
  flex: 1;
  margin: 16px 0 8px;
  color: #1d1d1f;
  font-size: 15px;
  line-height: 1.45;
}

.item .sku {
  align-self: flex-start;
  margin-top: 13px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f2f2f5;
  color: #77777f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
}

.item .sku + p {
  margin-top: 9px;
}

.item.sold .sku {
  background: rgba(255, 255, 255, .72);
  color: #4f7e5b;
}

.item-meta .sku {
  align-self: center;
  max-width: none;
  margin: 0;
  overflow: visible;
  padding: 6px 9px;
  border: 1px solid #e7e7eb;
  border-radius: 999px;
  text-overflow: clip;
  white-space: nowrap;
}

.photo-button {
  position: absolute;
  inset: 12px 12px 12px auto;
  z-index: 4;
  display: grid;
  width: 36%;
  height: auto;
  overflow: hidden;
  padding: 0;
  place-items: center;
  border: 1px solid #e4e4e8;
  border-radius: 20px;
  background: linear-gradient(145deg, #f7f7f8, #eeeeF1);
  color: #77777e;
  font-size: 42px;
  font-weight: 700;
  box-shadow: none;
}

.photo-button:hover {
  transform: none;
  border-color: #bfc0c6;
  background: #f7f7f9;
}

.photo-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  mix-blend-mode: multiply;
  transition: transform .2s ease;
}

.photo-button:hover img {
  transform: scale(1.035);
}

.photo-button.has-photo::after {
  content: '+';
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9);
  background: rgba(20, 20, 24, .84);
  color: #fff;
  font-size: 14px;
}

.barcode-button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  place-items: center;
  border: 1px solid #dedee3;
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}

.barcode-button:hover {
  transform: none;
  border-color: #bfc0c6;
  background: #f6f6f8;
}

.barcode-icon {
  width: 15px;
  height: 14px;
  background: repeating-linear-gradient(90deg,#222 0 1px,transparent 1px 3px,#222 3px 5px,transparent 5px 7px);
}

.barcode-dialog {
  width: min(520px, calc(100% - 28px));
}

.barcode-preview {
  position: relative;
  padding: 30px;
  text-align: center;
}

.barcode-preview > .close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.barcode-preview > p {
  margin: 0 0 4px;
  color: #8b8b92;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.barcode-preview > h2 {
  margin: 0 40px 22px;
  font-size: 25px;
  letter-spacing: -.5px;
}

.barcode-paper {
  padding: 24px;
  border: 1px solid #e4e4e8;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20,20,25,.055);
}

.barcode-paper img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: contain;
}

.barcode-paper strong {
  display: block;
  margin-top: 10px;
  color: #55555b;
  font-size: 12px;
  letter-spacing: .08em;
}

#barcodePrint {
  width: 100%;
  margin-top: 16px;
}

.item > p {
  padding-right: 0;
}

.item.sold .sale-summary {
  padding-right: 0;
}

.sale-summary {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 12px;
  color: #28763c;
  font-size: 11px;
  font-weight: 900;
}

.sale-summary span {
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  white-space: nowrap;
}

.sale-summary span:first-child {
  padding-left: 0;
}

.sale-summary span + span {
  border-left: 1px solid #bcdcc4;
}

.sale-summary .profit.negative {
  border-color: #f0d4d1;
  color: #b53d35;
}

.item footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
}

.cost {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.cost span {
  color: #929298;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.item footer .cost strong {
  color: #1d1d1f;
  font-size: 21px;
  letter-spacing: -.35px;
}

.status-action {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.item .status-button {
  position: relative;
  z-index: 22;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, .9);
  font-size: 19px;
  box-shadow: 0 8px 20px rgba(34, 139, 60, .2);
}

.item .unsell-button {
  box-shadow: 0 8px 20px rgba(201, 54, 43, .18);
}

.item .sell-button.cancel-sale {
  background: #e04444;
  box-shadow: 0 8px 20px rgba(201, 54, 43, .18);
}

.item .sell-button.cancel-sale:hover {
  background: #c93636;
}

.sell-button[hidden] {
  display: grid !important;
  pointer-events: none;
}

.sale-form {
  position: absolute;
  left: 21px;
  right: auto;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  width: 190px;
  height: 42px;
  gap: 3px;
  padding: 4px 4px 4px 23px;
  border: 1px solid #d8e8dc;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(23, 61, 33, .16);
}

.sale-form input,
.sale-form input:focus {
  width: 124px;
  height: 32px;
  padding: 0 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.sale-form input::-webkit-inner-spin-button,
.sale-form input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.sale-form button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border-radius: 50%;
  background: #28a745;
  font-size: 14px;
}

.item:has(.sale-form:not([hidden])) {
  z-index: 50;
}

@media (max-width: 760px) {
  main {
    width: 100%;
    margin: 0;
    padding: 12px 16px 118px;
  }

  .side-nav {
    inset: auto 10px 10px;
    width: auto;
    height: 70px;
    flex-direction: row;
    justify-content: center;
    gap: 3px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(13, 14, 35, .24);
  }

  .nav-mark {
    display: none;
  }

  .side-nav .nav-button {
    width: 72px;
    min-height: 56px;
    gap: 2px;
    border-radius: 16px;
    font-size: 9px;
  }

  .side-nav .nav-button span {
    width: 25px;
    height: 25px;
    font-size: 18px;
  }

  .actions {
    right: 14px;
    bottom: 14px;
    width: auto;
  }

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

  .metrics-carousel .stats article {
    min-width: 100%;
    flex-basis: 100%;
  }


  .calendar-card {
    padding: 16px;
    border-radius: 24px;
  }

  .calendar-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-controls {
    width: 100%;
  }

  .calendar-controls select {
    flex: 1;
  }

  .calendar-day,
  .calendar-blank {
    min-height: 64px;
    border-radius: 12px;
  }

  .calendar-day {
    padding: 7px;
  }

  .calendar-day strong {
    font-size: 10px;
  }

  .calendar-day small {
    display: none;
  }

  .item {
    height: 248px;
    min-height: 248px;
    padding-right: calc(34% + 22px);
  }

  .photo-button {
    inset: 10px 10px 10px auto;
    width: 34%;
    height: auto;
    border-radius: 18px;
  }

  .item > p {
    padding-right: 0;
  }
}
