/* Na'em admin.
   Same family as the store: plum from the packaging, Almarai for reading,
   El Messiri for headings, gold only for "this needs you".
   Logical properties only, so one stylesheet serves Arabic and English. */

@font-face {
  font-family: Almarai;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/almarai-400-ar.woff2) format("woff2");
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: Almarai;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/almarai-400-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: Almarai;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/almarai-700-ar.woff2) format("woff2");
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: Almarai;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/almarai-700-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: Almarai;
  font-weight: 800;
  font-display: swap;
  src: url(fonts/almarai-800-ar.woff2) format("woff2");
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: Almarai;
  font-weight: 800;
  font-display: swap;
  src: url(fonts/almarai-800-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "El Messiri";
  font-weight: 600 700;
  font-display: swap;
  src: url(fonts/messiri-ar.woff2) format("woff2");
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "El Messiri";
  font-weight: 600 700;
  font-display: swap;
  src: url(fonts/messiri-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/plex-lat.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

:root {
  /* Plum, from the packaging. */
  --plum: #81007e;
  --plum-strong: #5c005a;
  --plum-deep: #3a0838;
  --plum-night: #2a0628;
  --plum-tint: #f4e8f3;
  --plum-wash: #fbf6fa;
  /* Gold means "this needs you". */
  --gold: #e4ba59;
  --gold-ink: #6e500c;
  --gold-tint: #fbf1d7;
  /* Sage means done. */
  --sage: #4f7a55;
  --sage-tint: #e7f0e6;
  --slate: #3c5a80;
  --slate-tint: #e8eef6;
  --red: #b3261e;
  --red-tint: #fbe8e6;

  --ink: #2d0f29;
  --ink-2: #6b4a63;
  --ink-3: #8f7a8a;
  --line: #ecdfe8;
  --line-strong: #8a7586;
  --surface: #ffffff;
  --page: #f7f2f6;
  --focus: #1d5fa8;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --sidebar: 248px;
  --tabbar: 64px;

  --font: Almarai, system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-head: "El Messiri", Almarai, serif;
}
html:lang(en) {
  --font: "IBM Plex Sans", Almarai, system-ui, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  font-variant-numeric: tabular-nums;
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}
h1 {
  font-size: 26px;
}
h2 {
  font-size: 18px;
  margin-block-end: 12px;
}
p {
  margin-block: 0 12px;
}
a {
  color: var(--plum);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--plum-strong);
}
small {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.icon {
  flex: none;
  display: block;
}
.icon.flip:dir(rtl) {
  transform: scaleX(-1);
}
.skip {
  position: absolute;
  inset-inline-start: 8px;
  inset-block-start: -60px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--r-s);
  z-index: 50;
}
.skip:focus {
  inset-block-start: 8px;
}

/* ---------------------------------------------------------------- shell */

.app {
  min-height: 100vh;
}
.side {
  display: none;
}
.main-col {
  min-width: 0;
}
main {
  padding: 16px 16px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom));
  max-width: 1240px;
}

/* Phone: a slim top bar and a tab bar at the bottom. */
.mbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--plum-deep);
  color: #f3e6f1;
}
.mbar .brand-mark {
  color: #fff;
  font-size: 22px;
}
.mbar .plain-btn {
  color: #f3e6f1;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.1;
}
.brand-mark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  color: #fff;
}
.brand-sub {
  font-size: 12px;
  color: #cdb4c9;
}

.tabbar {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-block-start: 1px solid var(--line);
  padding: 4px 6px env(safe-area-inset-bottom);
  box-shadow: 0 -6px 18px rgb(58 8 56 / 0.06);
}
.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--r-s);
  cursor: pointer;
  list-style: none;
}
.tab::-webkit-details-marker {
  display: none;
}
.tab[aria-current="page"],
.tab.is-active,
.more[open] > .tab {
  color: var(--plum);
}
.tab[aria-current="page"]::before,
.tab.is-active::before {
  content: "";
  position: absolute;
  inset-block-start: -5px;
  inset-inline: 30%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--plum);
}
.tab .count {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: calc(50% + 6px);
}
.more {
  flex: 1;
  display: flex;
}
.more > .tab {
  flex: 1;
}
.more:not([open]) .more-sheet {
  display: none;
}
.more-sheet {
  position: fixed;
  inset-inline: 0;
  inset-block-end: calc(var(--tabbar) + env(safe-area-inset-bottom));
  max-height: calc(100vh - var(--tabbar) - 40px);
  overflow-y: auto;
  padding: 12px 12px 16px;
  background: var(--surface);
  border-radius: var(--r-l) var(--r-l) 0 0;
  box-shadow: 0 -16px 40px rgb(42 6 40 / 0.18);
  display: grid;
  gap: 8px;
}
.more-sheet .nav-title {
  color: var(--ink-3);
}
.more-sheet .nav-link {
  color: var(--ink);
}
.more-sheet .nav-link[aria-current="page"] {
  background: var(--plum-tint);
  color: var(--plum-strong);
}

/* Desktop: a plum sidebar. */
@media (min-width: 960px) {
  .app {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
  }
  .tabbar,
  .mbar {
    display: none;
  }
  main {
    padding: 28px 36px 48px;
  }
  .side {
    position: sticky;
    inset-block-start: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 14px 16px;
    background: var(--plum-night);
    color: #e9d9e6;
    overflow-y: auto;
  }
  .side .brand {
    padding-inline: 10px;
  }
}
.side-nav {
  display: grid;
  gap: 14px;
  flex: 1;
  align-content: start;
}
.nav-group {
  display: grid;
  gap: 2px;
}
.nav-title {
  margin: 0 0 4px;
  padding-inline: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #a98aa4;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: var(--r-s);
  color: #e9d9e6;
  text-decoration: none;
  font-weight: 700;
  width: 100%;
}
.nav-link > span:first-of-type {
  flex: 1;
  text-align: start;
}
.nav-link:hover {
  background: rgb(255 255 255 / 0.07);
  color: #fff;
}
.nav-link[aria-current="page"] {
  background: #fff;
  color: var(--plum-deep);
}
.nav-link[aria-current="page"] .icon {
  color: var(--plum);
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.count.alert {
  background: var(--gold);
  color: #3b2a05;
}
.count.quiet {
  background: rgb(255 255 255 / 0.16);
  color: inherit;
}
.tab .count.quiet,
.more-sheet .count.quiet,
.nav-link[aria-current="page"] .count.quiet {
  background: var(--plum-tint);
  color: var(--plum-strong);
}

.side-foot {
  display: grid;
  gap: 8px;
  padding-block-start: 12px;
  border-block-start: 1px solid rgb(255 255 255 / 0.1);
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-s);
  color: #fff;
  text-decoration: none;
}
.who:hover,
.who[aria-current="page"] {
  background: rgb(255 255 255 / 0.08);
}
.who small {
  color: #bfa5ba;
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: #3b2a05;
  font-weight: 800;
}
.side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-inline: 10px;
}
.side-actions form {
  margin: 0;
}
.side .plain-btn {
  color: #cdb4c9;
}
.side .plain-btn:hover {
  color: #fff;
}
.plain-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--plum);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--plum);
  text-decoration: underline;
  cursor: pointer;
}

/* ------------------------------------------------------------ page head */

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-end: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-block-end: 20px;
}
.subtitle {
  margin: 4px 0 0;
  color: var(--ink-2);
  max-width: 62ch;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-block-end: 16px;
  padding: 10px 14px;
  border-radius: var(--r-m);
  background: var(--sage-tint);
  color: #24452a;
  font-weight: 700;
  animation: toast-in 260ms ease-out;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--plum-wash);
  border-color: var(--plum);
  color: var(--plum-strong);
}
.btn.primary {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}
.btn.primary:hover {
  background: var(--plum-strong);
  border-color: var(--plum-strong);
  color: #fff;
}
.btn.danger {
  border-color: #e3b3ae;
  color: var(--red);
}
.btn.danger:hover {
  background: var(--red-tint);
  border-color: var(--red);
}
.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 4px;
}

.field {
  display: grid;
  gap: 6px;
  align-content: start;
}
.label {
  font-weight: 700;
  font-size: 14px;
}
input:not([type="checkbox"], [type="radio"], [type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1.5px solid #d9c8d4;
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
input:not([type="checkbox"], [type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}
input:not([type="checkbox"], [type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--plum);
  outline: 3px solid rgb(129 0 126 / 0.16);
  outline-offset: 0;
}
textarea {
  resize: vertical;
}
input[readonly] {
  background: var(--plum-wash);
  color: var(--ink-2);
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--plum);
}
input.short {
  width: 110px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  cursor: pointer;
}
.check:has(input:checked) {
  border-color: #d6b5d3;
  background: var(--plum-wash);
}
.check input {
  flex: none;
  margin: 2px 0 0;
}
.check > span {
  font-weight: 700;
}
.hint {
  color: var(--ink-2);
  font-size: 14px;
  max-width: 70ch;
}
.fine {
  color: var(--ink-3);
  font-size: 13px;
  margin: 0;
}

/* -------------------------------------------------------------- panels */

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 18px;
  margin-block-end: 16px;
}
.card > :last-child,
.panel > :last-child {
  margin-block-end: 0;
}
details.card > summary {
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
}
details.card[open] > summary {
  margin-block-end: 14px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 12px;
}
.panel-head h2 {
  margin: 0;
}
.quiet-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.quiet-link:hover {
  text-decoration: underline;
}
.attention {
  border-color: #efd9a2;
  background: var(--gold-tint);
}
.attention ul {
  margin: 0;
  padding-inline-start: 20px;
}

.stack {
  display: grid;
  gap: 14px;
  align-content: start;
}
.stack > * {
  margin-block: 0;
}
.narrow {
  max-width: 420px;
}
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 640px) {
  .grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.notice {
  padding: 12px 14px;
  border-radius: var(--r-m);
  background: var(--plum-wash);
  border: 1px solid var(--line);
}
.notice ul {
  margin: 0;
  padding-inline-start: 18px;
}
.notice.ok {
  background: var(--sage-tint);
  border-color: #c6dcc4;
}
.notice.error {
  background: var(--red-tint);
  border-color: #efc1bc;
  color: #7c1a14;
  font-weight: 700;
}
.notice.warn {
  background: var(--gold-tint);
  border-color: #efd9a2;
  color: #4d3907;
}
.empty {
  color: var(--ink-2);
  padding: 20px 0;
}
.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-2);
}
.empty-state p {
  margin: 0;
  max-width: 44ch;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--plum-tint);
  color: var(--plum);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: #f1eaf0;
  color: var(--ink-2);
}
.badge.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok {
  background: var(--sage-tint);
  color: #2f5a35;
}
.badge.warn {
  background: var(--gold-tint);
  color: var(--gold-ink);
}
.badge.bad {
  background: var(--red-tint);
  color: #8f1e17;
}
.badge.info {
  background: var(--slate-tint);
  color: var(--slate);
}
.badge.plum {
  background: var(--plum-tint);
  color: var(--plum-strong);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 14px;
}
.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
@media (max-width: 720px) {
  /* One swipeable row instead of three wrapped ones. */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -16px;
    padding-inline: 16px;
    scrollbar-width: none;
  }
  .chip {
    flex: none;
  }
}
.chip strong {
  color: var(--ink-3);
}
.chip:hover {
  border-color: var(--plum);
}
.chip[aria-current="page"] {
  background: var(--plum-deep);
  border-color: var(--plum-deep);
  color: #fff;
}
.chip[aria-current="page"] strong {
  color: var(--gold);
}
.card .chips {
  margin-block-end: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-block-end: 16px;
}
.filters .field {
  flex: 1 1 160px;
  max-width: 280px;
}
.filters .field:first-of-type {
  flex-basis: 220px;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0 0 12px;
}
.facts dt {
  color: var(--ink-2);
}
.facts dd {
  margin: 0;
  font-weight: 700;
}
.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

/* --------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  margin-block-end: 16px;
}
.card .table-wrap {
  border: 0;
  border-radius: 0;
  margin-inline: -18px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px 14px;
  text-align: start;
  vertical-align: middle;
  border-block-end: 1px solid var(--line);
}
thead th {
  background: var(--plum-wash);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}
tbody tr:last-child td {
  border-block-end: 0;
}
tbody tr:hover {
  background: #fdfafc;
}
.num {
  text-align: end;
  white-space: nowrap;
}
tfoot th {
  text-align: end;
  font-weight: 400;
  color: var(--ink-2);
}
tfoot td,
tfoot th {
  border-block-end: 0;
  padding-block: 7px;
}
tfoot .grand th,
tfoot .grand td {
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  border-block-start: 1px solid var(--line);
}
tr.variant td {
  border-block-start-color: transparent;
}
tr.variant td.thumb img {
  opacity: 0.5;
}
td.thumb {
  width: 64px;
}
td.thumb img {
  display: block;
  border-radius: var(--r-s);
  background: var(--plum-wash);
  object-fit: cover;
}
.sheet td {
  padding-block: 8px;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

/* --------------------------------------------------------------- today */

.today {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
.today > .panel {
  margin: 0;
}
@media (min-width: 1100px) {
  .today {
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
    grid-template-areas:
      "queue sales"
      "flow flow"
      "recent low";
    align-items: start;
  }
  .queue {
    grid-area: queue;
  }
  .sales {
    grid-area: sales;
  }
  .flow-panel {
    grid-area: flow;
  }
  .recent {
    grid-area: recent;
  }
  .low {
    grid-area: low;
  }
}

.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-m);
  border: 1.5px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.task:hover {
  border-color: var(--plum);
  color: var(--ink);
}
.task-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--plum-tint);
  color: var(--plum);
}
.task.now {
  background: var(--gold-tint);
  border-color: #efd497;
}
.task.now .task-icon {
  background: var(--gold);
  color: #3b2a05;
}
.task.setup .task-icon {
  background: #f1eaf0;
  color: var(--ink-2);
}
.task-text b {
  display: block;
  font-size: 16px;
}
.task-count {
  font-size: 20px;
  font-weight: 800;
  margin-inline-end: 4px;
}
.task-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--plum);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .task {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .task-go {
    grid-column: 2;
  }
}

.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.figure {
  margin: 0;
}
.figure dt {
  color: var(--ink-2);
  font-size: 13px;
}
.figure dd {
  margin: 0;
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}
.figure.lead dd:not(.figure-sub) {
  font-size: 22px;
  color: var(--plum-strong);
}
.figure dd.figure-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}
.chart {
  margin: 0 0 10px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 110px;
}
.chart .bar {
  fill: #d9b6d6;
}
.chart .bar.zero {
  fill: #eee3ec;
}
.chart .bar.today {
  fill: var(--plum);
}
.chart-base {
  stroke: var(--line);
  stroke-width: 1;
}
.chart figcaption {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
}

/* The order flow: five steps, a line through them. */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.step {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 12px 12px;
  border-radius: var(--r-m);
  background: var(--plum-wash);
  color: var(--ink);
  text-decoration: none;
  height: 100%;
}
.step::after {
  content: "";
  position: absolute;
  inset-block-start: 26px;
  inset-inline-end: -8px;
  width: 8px;
  height: 2px;
  background: var(--line);
}
.flow li:last-child .step::after {
  display: none;
}
.step:hover {
  outline: 1.5px solid var(--plum);
  color: var(--ink);
}
.step-n {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink-3);
}
.step.has .step-n {
  color: var(--plum-strong);
}
.step.has.pending {
  background: var(--gold-tint);
}
.step.has.pending .step-n {
  color: var(--gold-ink);
}
.step.has.delivered .step-n {
  color: var(--sage);
}
.step-name {
  font-weight: 700;
}
@media (max-width: 720px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .step {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    padding: 10px 12px;
  }
  .step-n {
    grid-row: span 2;
    text-align: center;
  }
  .step::after {
    display: none;
  }
}

.lowlist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lowlist a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-block-end: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.lowlist li:last-child a {
  border-block-end: 0;
}
.lowlist a:hover {
  color: var(--plum);
}
.left {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold-tint);
  color: var(--gold-ink);
  font-size: 13px;
}
.left.out {
  background: var(--red-tint);
  color: #8f1e17;
}

/* ---------------------------------------------------------- order rows */

.olist {
  container: olist / inline-size;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
}
.panel .olist {
  border: 0;
  border-radius: 0;
  margin-inline: -18px;
}
.orow {
  display: grid;
  grid-template-columns: 76px 84px minmax(0, 1.5fr) 150px 100px minmax(
      170px,
      1fr
    );
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-block-end: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.olist li:last-child .orow {
  border-block-end: 0;
}
.orow:hover {
  background: var(--plum-wash);
  color: var(--ink);
}
.orow-num {
  font-weight: 800;
  color: var(--plum);
}
.orow-who b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orow-when {
  font-size: 14px;
  white-space: nowrap;
}
.orow-total {
  font-weight: 800;
  text-align: end;
  white-space: nowrap;
}
.orow-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
/* Narrow list (a phone, or the panel on Today): two lines per order. */
@container olist (max-width: 760px) {
  .orow {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "pics who total"
      "pics num state";
    gap: 6px 12px;
  }
  .orow-who {
    grid-area: who;
  }
  .orow .thumbs {
    grid-area: pics;
    width: 52px;
  }
  .orow .thumbs img:not(:first-child) {
    display: none;
  }
  .orow .thumbs img:first-child {
    width: 52px;
    height: 52px;
  }
  .orow-total {
    grid-area: total;
  }
  .orow-num {
    grid-area: num;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }
  .orow-state {
    grid-area: state;
  }
  .orow-when {
    display: none;
  }
}

/* ---------------------------------------------------------- order page */

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--ink-2);
  margin-block-end: 16px;
}
.progress {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.progress li {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
}
.progress li::before {
  content: "";
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.progress li.done {
  color: var(--ink);
}
.progress li.done::before {
  background: var(--plum);
}
.progress li.now::before {
  background: var(--gold);
}
.progress.stopped li::before {
  background: var(--line);
}
.order-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.order-layout .card {
  margin: 0;
}
/* Phone: the next step first, then the items, then customer and delivery. */
@media (max-width: 1099px) {
  .order-side {
    display: contents;
  }
  .order-side > .next-step,
  .order-side > details {
    order: -1;
  }
}
@media (min-width: 1100px) {
  .order-layout {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  }
  .order-side {
    order: 0;
    position: sticky;
    inset-block-start: 20px;
  }
}
.next-step {
  border: 2px solid var(--plum);
  box-shadow: 0 8px 24px rgb(129 0 126 / 0.08);
}
.next-step h2 {
  color: var(--plum-strong);
}
.action {
  padding-block-end: 14px;
  border-block-end: 1px solid var(--line);
}
.action:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}
.item-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: end;
}
.note-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-block-end: 14px;
}
.note-form .field {
  flex: 1;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.timeline li {
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--line);
}
.timeline .event-note {
  border-inline-start-color: var(--gold);
}
.timeline .event-payment {
  border-inline-start-color: var(--sage);
}
.timeline .event-status {
  border-inline-start-color: var(--plum);
}
span.event-note {
  display: block;
  color: var(--ink-2);
}

.slip {
  background: var(--surface);
  padding: 24px;
  margin-block: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
}
.slip header {
  border-block-end: 2px solid var(--ink);
  margin-block-end: 16px;
}
.slip-due {
  font-size: 18px;
}

/* --------------------------------------------------------- bare pages */

.bare {
  margin-inline: auto;
  max-width: 760px;
  padding: 16px;
}
body.is-bare {
  background:
    radial-gradient(circle at 15% 0%, #4e0c4b 0, transparent 55%),
    var(--plum-night);
  min-height: 100vh;
}
body.is-bare .slip,
body.is-bare .card {
  color: var(--ink);
}
.sign-in {
  max-width: 400px;
  margin: 10vh auto 0;
  padding: 28px;
  border: 0;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.3);
}
.sign-in h1 {
  margin-block-end: 4px;
  color: var(--plum-strong);
  font-size: 30px;
}
.sign-in-lang {
  margin-block-start: 16px;
  text-align: center;
}

@media print {
  body,
  body.is-bare {
    background: #fff;
  }
  .no-print,
  .side,
  .tabbar,
  .mbar {
    display: none;
  }
  .slip {
    border: 0;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

.filter-more {
  flex-basis: 100%;
}
.filter-more > summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 700;
  color: var(--plum);
  font-size: 14px;
}
.filter-more[open] > summary {
  margin-block-end: 10px;
}
.filter-more .filters {
  margin: 0;
}

/* Names in tables are links to their page: weight, not underlines. */
td > a:first-child {
  font-weight: 700;
  text-decoration: none;
}
td > a:first-child:hover {
  text-decoration: underline;
}

/* Undoing a payment: tucked away behind a small toggle on its row. */
.undo > summary {
  cursor: pointer;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}
.undo[open] {
  min-width: 220px;
}
.undo[open] > summary {
  margin-block-end: 8px;
}
.struck {
  text-decoration: line-through;
  color: var(--ink-3);
}

/* ------------------------------------------------------------- photos */

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) {
  border-color: var(--plum);
  color: var(--plum);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.photos {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.photo {
  display: grid;
  gap: 8px;
  align-content: start;
}
.photo-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--r-m);
  border: 1.5px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.photo.is-main .photo-img {
  border: 2.5px solid var(--plum);
}
.photo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.photo-main {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--plum);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.photo-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 36px;
}
.photo-tools form {
  margin: 0;
}
.photo-tools .plain-btn {
  font-size: 13px;
}
.photo-move {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
}
.photo-more > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.photo-more[open] {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-m);
  background: var(--plum-wash);
}
.upload {
  display: grid;
  gap: 12px;
}
.upload-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 2px dashed #d6b5d3;
  border-radius: var(--r-m);
  background: var(--plum-wash);
  color: var(--plum);
  cursor: pointer;
}
.upload-drop:hover,
.upload-drop:focus-within {
  border-color: var(--plum);
}
.upload-drop b {
  display: block;
  color: var(--ink);
}
.upload-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-drop.has-files {
  border-style: solid;
  border-color: var(--plum);
}

/* Product photos on orders. */
.thumbs {
  display: flex;
  align-items: center;
}
.thumbs img {
  width: 36px;
  height: 36px;
  border-radius: var(--r-s);
  border: 2px solid var(--surface);
  background: #fff;
  object-fit: contain;
  box-shadow: 0 0 0 1px var(--line);
}
.thumbs img + img {
  margin-inline-start: -14px;
}
.thumbs.empty {
  min-height: 36px;
}
.item-line {
  display: flex;
  align-items: center;
  gap: 12px;
}
.item-thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--plum-wash);
  object-fit: contain;
}
img.item-thumb {
  background: #fff;
}
@media print {
  .item-thumb {
    display: none;
  }
}
.item-line a {
  font-weight: 700;
  text-decoration: none;
}
.item-line a:hover {
  text-decoration: underline;
}
