/* Tarteeb panel: header, tabs, Needs attention, Orders, order view, New order, Settings. */

/* ----------------------------------------------------------- header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: var(--hdr-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex: none;
}
.brand h1,
.brand .brand-name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.brand .product {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  display: block;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover {
  background: var(--sand);
}
.tabs a[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.tabs a[aria-current="page"] .badge {
  background: var(--accent-ink);
  color: var(--accent);
}
/* 🔴 the courier problems that are new since Needs attention was last opened */
.tabs .badge.fresh {
  background: var(--amber);
}
.hdr-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}
.menu {
  position: relative;
}
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  min-height: 36px;
  max-width: 220px;
}
[dir="rtl"] .menu-btn {
  padding: 5px 6px 5px 12px;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sand-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.menu-btn .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  min-width: 230px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
}
.menu-list .who {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  font-size: 13px;
}
.menu-list a,
.menu-list button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 0;
  background: none;
  text-align: start;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.menu-list a:hover,
.menu-list button:hover {
  background: var(--sand);
}
.demo-chip {
  background: var(--blue-bg);
  color: var(--blue);
}
/* a visitor's private demo copy: one slim line under the header */
.demo-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 6px 16px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 13px;
}
.demo-bar .txt {
  overflow-wrap: anywhere;
}

main#main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 90px;
}
.screen-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.screen-title h1 {
  font-size: 20px;
}
.loading {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
}
.loading::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: -4px;
  margin-inline-end: 8px;
}

/* ------------------------------------------------- needs attention --- */
/* the reference panel's look: ONE white card, the sections stacked inside it, each
   under a coloured rule with a 16px heading, its count pill and one hint line, then a
   plain table of clickable rows with one small button at the end */
.count-pill {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  background: var(--sand);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-dark);
  vertical-align: 2px;
}
.att-card {
  padding: 18px 20px;
}
.att-sec {
  margin-top: 22px;
  border-top: 2px solid var(--line-strong);
  padding-top: 14px;
}
.att-sec:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.att-sec.tone-red {
  border-top-color: var(--red);
}
.att-sec.tone-amber {
  border-top-color: #d99a00;
}
.att-sec.tone-blue {
  border-top-color: var(--blue);
}
.att-sec.tone-violet {
  border-top-color: #6b3fa0;
}
.att-sec.tone-green {
  border-top-color: var(--green);
}
.att-sec > h2 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.att-sec .sec-hint {
  font-size: 13px;
  margin: 0 0 12px;
}
.att-table-wrap {
  overflow-x: auto;
}
.att-table th {
  letter-spacing: 0.4px;
}
.att-table td {
  vertical-align: middle;
}
.att-table tr.att-row[data-action] {
  cursor: pointer;
}
.att-table tbody tr:hover td {
  background: #faf8f3;
}
:root[data-theme="dark"] .att-table tbody tr:hover td {
  background: var(--card-2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .att-table tbody tr:hover td {
    background: var(--card-2);
  }
}
.att-table td.acts {
  text-align: end;
  white-space: nowrap;
  width: 1%;
}
.att-table .ord-link {
  font-weight: 800;
  text-decoration: none;
}
.att-table .ord-link:hover {
  text-decoration: underline;
}
.att-table pre,
pre.ar-text {
  margin: 0;
  font-family: var(--font-ar);
  font-size: 13.5px;
  background: var(--sand);
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: right;
  max-height: 240px;
  overflow-y: auto;
  min-width: 240px;
}
textarea.ar-text {
  font-family: var(--font-ar);
  text-align: right;
}
.nowrap {
  flex-wrap: nowrap;
}
/* the Bosta desk's complaint cards */
.att-list {
  display: grid;
  gap: 10px;
}
.att-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--card-2);
  display: grid;
  gap: 8px;
}
.att-item .top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.att-item .ord-link {
  font-weight: 800;
  text-decoration: none;
}
.att-item .reason {
  font-size: 14px;
}
.att-item .acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.flag-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--red-bg);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13.5px;
}
.flag-line .txt {
  flex: 1;
  overflow-wrap: anywhere;
}
.suggest {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.area-pick {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
}
.all-clear {
  text-align: center;
  padding: 50px 20px;
}
.all-clear .big {
  font-size: 40px;
}

/* the complaint dialog: an item per row, its photos in a big ＋ box */
.dmg-list {
  display: grid;
  gap: 8px;
}
.dmg-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.dmg-detail {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  margin-inline-start: 26px;
}
/* 📎 Send proofs: the screenshots before they are sent */
.proof-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.proof-shots img {
  width: 150px;
  height: 164px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
}
.pbox {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  border: 2.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--card-2);
}
.pbox.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pbox-thumbs {
  display: contents;
}
.pbox-thumb {
  position: relative;
  width: 88px;
  height: 88px;
}
.pbox-thumb img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.pbox-x {
  position: absolute;
  top: -8px;
  inset-inline-end: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.pbox-add {
  flex: 1 1 160px;
  min-height: 88px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
}
.pbox-add .plus {
  font-size: 28px;
  color: var(--accent-dark);
  line-height: 1;
}
.pbox.has .pbox-add {
  flex: 0 0 88px;
}
.pbox.has .pbox-add .hint {
  display: none;
}

/* Bosta desk */
.desk-groups {
  display: grid;
  gap: 8px;
}
.desk-group > summary {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  padding: 6px 0;
}
.thread {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}
.msg {
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 88%;
  font-size: 13.5px;
  background: var(--card);
  border: 1px solid var(--line);
}
.msg.out {
  justify-self: end;
  background: var(--accent-soft);
}
.msg .meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.msg .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ----------------------------------------------------------- orders --- */
.otabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.otabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}
.otabs a[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.otabs a .n {
  font-size: 12px;
  background: var(--sand);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 7px;
}
.otabs a[aria-current="true"] .n {
  background: var(--accent-ink);
  color: var(--accent);
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
}
.toolbar .search {
  flex: 1 1 260px;
  min-width: 200px;
}
.toolbar .dates {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.toolbar .dates input {
  width: 150px;
}
.selbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
  justify-content: center;
}
.selbar .count {
  background: var(--accent);
  color: var(--accent-ink);
}
.pagebar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.pagebar .pager {
  margin-inline-start: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.pagebar select {
  width: auto;
  min-height: 32px;
  padding: 4px 8px;
  font-size: 13px;
}
/* the order desk's list: every header and cell centred, the order number alone on
   the start side (so the numbers line up), 5px side padding so the row fits the card */
table.orders td,
table.orders th {
  padding-inline: 5px;
  text-align: center;
  vertical-align: middle;
}
table.orders th.c-no,
table.orders td.c-no {
  text-align: start;
  padding-inline-start: 16px;
  white-space: nowrap;
}
/* status = the desk's small pill: wraps to a second line instead of widening the row */
table.orders td[data-col="status"] .chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 11px;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  max-width: 118px;
}
table.orders td[data-col="courier"] .btn {
  white-space: nowrap;
}
table.orders th .colmove {
  border: 0;
  background: none;
  color: var(--line-strong);
  cursor: pointer;
  font-size: 10px;
  padding: 0 2px;
}
table.orders th .colmove:hover {
  color: var(--accent);
}
table.orders tbody tr {
  cursor: pointer;
}
table.orders tr.attention td {
  background: var(--red-bg);
}
table.orders tr.attention:hover td {
  background: var(--red-bg);
  filter: brightness(0.98);
}
table.orders tr.done td {
  color: var(--muted);
}
table.orders tr.done .chip {
  opacity: 0.85;
}
table.orders tr.selected td {
  background: var(--accent-soft);
}
table.orders .c-sel {
  width: 34px;
}
table.orders .c-no a {
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
table.orders .c-no .mini {
  margin-inline-start: 3px;
}
table.orders .c-customer {
  overflow-wrap: anywhere;
  min-width: 110px;
}
table.orders .c-items {
  min-width: 200px;
}
.items-inline {
  display: grid;
  gap: 2px;
  font-size: 13px;
}
.items-inline .it b {
  font-weight: 700;
}
.items-inline .opt {
  color: var(--muted);
}
.items-inline .prop {
  display: block;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
a.wa {
  color: var(--wa);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
a.wa:hover {
  text-decoration: underline;
}
/* 📋 the daily routine above the orders list */
.flow-steps {
  margin: 6px 0 0;
  padding-inline-start: 22px;
  line-height: 1.7;
}
/* 🏠 airway bills in office: one clickable line above the orders list */
.office-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  width: 100%;
  margin: 0 0 12px;
  padding: 10px 14px;
  font: inherit;
  color: inherit;
  text-align: start;
  cursor: pointer;
  border: 1.5px solid var(--line);
}
.office-bar:hover,
.office-bar.is-open {
  border-color: var(--accent);
}
.office-bar .grow {
  flex: 1 1 200px;
  min-width: 0;
}
/* 🔎 under the orders toolbar: what the search looked through, "all" was cut */
.search-note {
  margin: -4px 0 10px;
}
.search-note:empty {
  display: none;
}
/* 🔎 find a product: the product, the variants it was ordered in, an order number */
.find-box {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 12px;
}
.find-box .find-title {
  font-size: 16px;
  margin: 0 0 4px;
}
.find-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 8px;
}
.find-row .picker {
  flex: 1 1 260px;
  min-width: 200px;
}
.find-row select {
  min-width: 180px;
}
.find-row input[type="text"] {
  width: 150px;
}
/* 📲 the courier-group status strip over the unsent messages */
.group-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0 0 10px;
  line-height: 1.6;
}
.group-strip:empty {
  display: none;
}
.group-strip.up {
  background: var(--green-bg);
  border-color: var(--green);
}
.group-strip.down {
  background: var(--amber-bg);
  border-color: var(--amber);
}
.failed-card {
  border-color: var(--red);
}
.failed-card h2 {
  color: var(--red);
}
.failed-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

/* ------------------------------------------------------- order view --- */
.ord-top {
  position: sticky;
  top: var(--hdr-h);
  z-index: 40;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.ord-top::-webkit-scrollbar {
  height: 0;
}
.ord-top > * {
  flex-shrink: 0;
}
.ord-top h1 {
  font-size: 17px;
  white-space: nowrap;
}
.ord-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sand);
  border-radius: 9px;
  padding: 5px 9px;
  flex: 0 1 auto !important;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ord-chips .chip {
  background: transparent;
  padding: 0 2px;
}
.ord-acts {
  display: inline-flex;
  gap: 6px;
  margin-inline-start: auto;
}
.banner {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}
.banner.red {
  background: var(--red-bg);
}
.banner.amber {
  background: var(--amber-bg);
}
.banner.blue {
  background: var(--blue-bg);
}
.banner.green {
  background: var(--green-bg);
}
.banner .txt {
  flex: 1;
  min-width: 200px;
  overflow-wrap: anywhere;
}
.ord-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.ord-grid > div {
  min-width: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 16px;
}
.detail-grid .v {
  font-size: 14.5px;
  overflow-wrap: anywhere;
}
.flags-col {
  display: grid;
  gap: 10px;
}
.flag-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card-2);
  display: grid;
  gap: 8px;
}
.flag-box .check {
  font-weight: 600;
}
.item-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--card-2);
}
.item-card.removed {
  opacity: 0.6;
}
.item-card.removed .title {
  text-decoration: line-through;
}
.thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--sand);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 22px;
}
.item-card .title {
  font-weight: 700;
}
.item-card .opts {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.item-card .props {
  margin-top: 5px;
  font-size: 13px;
  display: grid;
  gap: 2px;
}
.item-card .props b {
  color: var(--accent-dark);
  font-weight: 700;
}
.item-card .money {
  text-align: end;
  white-space: nowrap;
  font-size: 14px;
}
.item-card .qty-edit {
  width: 80px;
}
.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 16px;
  font-size: 14px;
  max-width: 420px;
  margin-inline-start: auto;
}
.totals .sum {
  font-weight: 800;
  font-size: 15.5px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.totals dd {
  margin: 0;
  text-align: end;
}
.timeline {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.timeline .when {
  color: var(--muted);
  font-size: 12.5px;
}
.bottom-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.picker {
  position: relative;
}
.picker-list {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  margin-top: 3px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 80;
}
.picker-list .p-prod {
  padding: 8px 12px 4px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}
.picker-list button {
  display: flex;
  width: 100%;
  gap: 10px;
  justify-content: space-between;
  border: 0;
  background: none;
  padding: 8px 14px;
  cursor: pointer;
  text-align: start;
  font-size: 14px;
}
.picker-list button:hover,
.picker-list button:focus-visible {
  background: var(--sand);
}
.line-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 110px 90px auto;
  gap: 8px;
  align-items: end;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.line-row .t {
  font-weight: 600;
}

/* ---------------------------------------------------------- new order --- */
/* the order desk's page: one card, its sections under level-2 headings, fields 4 to a row on a desktop */
.nf-card {
  max-width: 1100px;
}
.nf-card h2 {
  margin: 18px 0 8px;
  font-size: 15px;
}
.nf-card h2:first-child {
  margin-top: 0;
}
.nf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}
.nf-grid > fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.nf-ticks {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}
.nf-open span {
  color: var(--blue);
  font-weight: 600;
}
.nf-hint {
  min-height: 1.2em;
  margin: 6px 0 0;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.nf-hint.ok {
  color: var(--green);
  font-weight: 600;
}
/* 🔕 Notify customer unticked: the exception looks like one */
.nf-notify-off {
  color: var(--red);
  font-weight: 700;
}
.nf-hint.warn {
  color: var(--amber);
  font-weight: 600;
}
.nf-notes {
  margin-top: 12px;
}
textarea.autogrow {
  field-sizing: content;
  min-height: 64px;
  resize: none;
  overflow: hidden;
}
.nf-line {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 80px auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.nf-props {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 6px;
}
.nf-prop-field {
  min-width: 160px;
  flex: 1 1 200px;
  margin: 0;
}
.nf-prop-field .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.nf-addon-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nf-addon-tick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.nf-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nf-multi select {
  flex: 1 1 120px;
  min-width: 0;
}
.nf-multi-one {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 120px;
  min-width: 0;
}
.nf-multi-one select {
  flex: none;
  width: 100%;
}
.nf-line-head {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding-bottom: 0;
}
.nf-addbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.nf-total {
  margin-inline-start: auto;
  font-weight: 700;
  font-size: 15px;
}
.nf-total b {
  color: var(--accent-dark);
}
.nf-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
/* the type-ahead list (typeahead.js) */
.ta-holder {
  position: relative;
}
.ta-list {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  margin-top: 3px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 80;
}
.ta-opt,
.ta-empty {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}
.ta-empty {
  color: var(--muted);
  cursor: default;
}
.ta-opt:hover,
.ta-opt.hi {
  background: var(--sand);
}
/* sold-by chip in the order's top bar (admins click it to change) */
.chip.is-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.chip.is-button:hover {
  filter: brightness(0.96);
}
/* "nobody tagged yet": a dashed outline says it is empty; the words keep full contrast (4.5:1) */
.chip.faint {
  background: transparent;
  border: 1px dashed var(--field-line);
}
.sold-by-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
}
.sold-by-list > * {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.sold-by-list > :last-child {
  border-bottom: 0;
}
.sold-by-none {
  background: none;
  border: 0;
  text-align: start;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

/* --------------------------------------------------------- settings --- */
.set-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.set-nav {
  position: sticky;
  top: calc(var(--hdr-h) + 12px);
  display: grid;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}
.set-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.set-nav a:hover {
  background: var(--sand);
}
.set-nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.set-nav .grp {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
html[lang="ar"] .set-nav .grp {
  text-transform: none;
  letter-spacing: 0;
}
.set-select {
  display: none;
  margin-bottom: 12px;
}
.set-body .card h2 {
  margin-bottom: 4px;
}
.set-body .card > .hint {
  margin-bottom: 14px;
}
.secret-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
.secret-row .state {
  flex: 1;
  min-width: 180px;
}
.save-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
  margin-inline-end: 6px;
}
.status-dot.on {
  background: var(--green);
}
.status-dot.warn {
  background: var(--amber);
}
.status-dot.off {
  background: var(--red);
}
.ph-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.ph-chips button {
  border: 1px solid var(--line);
  background: var(--sand);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--mono);
  direction: ltr;
}
.preview {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  min-height: 60px;
}
.msg-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.days .check {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
}
.list-plain {
  display: grid;
  gap: 8px;
}
.list-plain > div {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--card-2);
}
.recovery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  font-family: var(--mono);
  font-size: 15px;
  direction: ltr;
}
.recovery span {
  background: var(--sand);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
}

/* ------------------------------------------------------------ phone --- */
@media (max-width: 1000px) {
  .ord-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ord-acts .lbl {
    display: none;
  }
}
@media (max-width: 860px) {
  .set-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .set-nav {
    display: none;
  }
  .set-select {
    display: block;
  }
}
@media (max-width: 760px) {
  body {
    font-size: 15px;
  }
  .app-header {
    padding: 8px 12px 0;
    gap: 6px 8px;
    flex-wrap: wrap;
  }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }
  .brand > div {
    min-width: 0;
  }
  .brand h1,
  .brand .brand-name {
    font-size: 15.5px;
    max-width: 44vw;
  }
  .brand .product {
    display: none;
  }
  .brand .demo-chip {
    font-size: 11px;
    padding: 0 7px;
  }
  .hdr-tools {
    gap: 6px;
  }
  .hdr-tools .seg button {
    padding: 4px 9px;
    min-height: 30px;
  }
  .hdr-tools .icon-btn {
    width: 32px;
    height: 32px;
  }
  .menu-btn {
    padding: 3px;
    min-height: 32px;
  }
  .tabs {
    order: 3;
    flex-basis: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 6px 0 9px;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tabs a {
    flex: none;
    padding: 7px 13px;
    font-size: 13.5px;
  }
  .menu-btn .name {
    display: none;
  }
  main#main {
    padding: 14px 10px 80px;
  }
  .card {
    padding: 14px 12px;
  }
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px; /* no zoom on iOS */
  }
  .fields.two {
    grid-template-columns: minmax(0, 1fr);
  }
  .otabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .toolbar .dates {
    width: 100%;
  }
  .toolbar .dates .field {
    flex: 1 1 0;
    min-width: 0;
  }
  .toolbar .dates input {
    width: 100%;
  }
  .ord-top {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .ord-top .ord-chips {
    flex: 1 1 auto !important;
  }
  .ord-top .ord-acts {
    flex: 1 1 100%;
    flex-wrap: wrap;
    margin-inline-start: 0;
  }
  /* order list -> stacked cards (like the old phone skin) */
  table.orders thead {
    display: none;
  }
  table.orders,
  table.orders tbody,
  table.orders tr,
  table.orders td {
    display: block;
    width: 100%;
  }
  table.orders tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--card);
    padding: 8px 10px;
    position: relative;
  }
  table.orders td {
    border: 0;
    padding: 3px 0;
    text-align: start;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
  }
  table.orders td > .cv {
    min-width: 0;
  }
  table.orders td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    padding-top: 2px;
  }
  table.orders td.c-sel {
    position: absolute;
    inset-inline-end: 10px;
    top: 10px;
    width: auto;
    display: block;
  }
  table.orders td.c-sel::before,
  table.orders td.c-no::before {
    content: none;
  }
  table.orders td.c-no {
    display: block;
    font-size: 16px;
    padding-inline-start: 0;
  }
  table.orders tr.attention {
    border-color: var(--red);
  }
  table.orders tr.attention td {
    background: transparent;
  }
  .item-card {
    grid-template-columns: 44px 1fr;
  }
  .item-card .money {
    grid-column: 2;
    text-align: start;
  }
  .thumb {
    width: 44px;
    height: 44px;
  }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .ord-top {
    position: static;
    box-shadow: none;
  }
  .line-row {
    grid-template-columns: 1fr 1fr;
  }
  .nf-line {
    grid-template-columns: minmax(0, 1fr) 70px auto;
  }
  .nf-line > :nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .nf-line > .nf-props {
    grid-row: 3;
  }
  .nf-line-head {
    display: none;
  }
  .area-pick {
    grid-template-columns: 1fr;
  }
  /* Needs attention: every table row becomes a short stacked card (no sideways scroll) */
  .att-card {
    padding: 14px 12px;
  }
  .att-table thead {
    display: none;
  }
  .att-table,
  .att-table tbody,
  .att-table tr,
  .att-table td {
    display: block;
    width: 100%;
  }
  .att-table tr {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  .att-table td {
    border: 0;
    padding: 2px 0;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
  }
  .att-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  .att-table td:not([data-label])::before {
    content: none;
  }
  .att-table td:not([data-label]) {
    display: block;
  }
  .att-table td.acts {
    width: 100%;
    text-align: start;
    padding-top: 6px;
  }
  .att-table pre {
    min-width: 0;
  }
  .dmg-detail {
    margin-inline-start: 0;
  }
  .recovery {
    grid-template-columns: 1fr;
  }
}

@media print {
  .app-header,
  .ord-top,
  .bottom-bar,
  .toasts,
  .bar {
    display: none !important;
  }
}

/* "Pick the day…": the native date input sits invisible under the button, only its calendar shows */
.picker-anchor {
  position: relative;
}
.invisible-date {
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

/* a tickable item in the order dialogs: the tick + name, then its quantity / value when ticked */
.pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.pick-row .t {
  font-weight: 600;
}
.pick-row .qty-edit {
  width: 110px;
}

/* ------------------------------------------------ server-off lock --- */
/* lib/offline-lock.js: 45 s with no answer locks the page until the server answers */
.offline-lock {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  /* a modal <dialog>: none of the browser's dialog box (size cap, margin, border, padding) */
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  align-items: center;
  justify-content: center;
  background: rgba(12, 15, 21, 0.86);
}
.offline-lock[open] {
  display: flex;
}
.offline-lock::backdrop {
  background: transparent;
}
.offline-lock:focus {
  outline: none;
}
.offline-box {
  background: var(--card);
  color: var(--ink);
  width: min(440px, 92vw);
  padding: 28px 26px;
  border-radius: 16px;
  border: 1px solid var(--line);
  text-align: center;
  line-height: 1.6;
}
.offline-box .offline-icon {
  font-size: 44px;
  line-height: 1;
}
.offline-box h2 {
  font-size: 20px;
  margin: 10px 0 8px;
}

/* ⏰ Remind in [3] days [Set]: one line, a small number box */
.remind-row {
  flex-wrap: nowrap;
  align-items: center;
}
.remind-row input {
  width: 64px;
  min-height: 32px;
  padding: 4px 8px;
}
/* the order desk's ONE money line */
.money-line {
  margin: 0;
  line-height: 1.6;
}
.money-line .money-after {
  color: var(--amber, #9a6b00);
  font-weight: 700;
}

/* ------------------------------------------- 🛒 From WhatsApp rows (Needs attention) --- */
.att-sec.tone-wa {
  border-top-color: #25d366;
}
.att-sec .wa-sent {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 2px;
}

/* Settings → Plan (settings-plan.js) and the plan banner (main.js) */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--card-2);
  display: grid;
  gap: 6px;
  align-content: start;
}
.plan-card.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.plan-card h3 {
  font-size: 16px;
}
.plan-card .price {
  font-size: 20px;
  font-weight: 700;
}
.plan-card p {
  margin: 0;
}
.billing-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 6px 16px;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 13px;
}
.billing-bar.blocked {
  background: var(--red-bg);
  color: var(--red);
}
.billing-bar .txt {
  overflow-wrap: anywhere;
}
.app-connect {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--accent-soft);
}

/* 📦 Inventory (inventory.js) and the stock line on an order's items (order.js) */
.inv-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 2fr) minmax(0, 1.4fr) 90px minmax(0, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.inv-row > .picker {
  grid-column: 2 / -2;
}
.inv-row .inv-x {
  justify-self: end;
}
.inv-row .rownum {
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 10px;
}
.inv-picked,
.inv-novar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.inv-picked .thumb {
  width: 32px;
  height: 32px;
}
/* the inventory's product-only picker: one button per product, no variants, no prices */
.picker-list button.p-only {
  justify-content: flex-start;
  align-items: center;
}
.picker-list button.p-only .thumb {
  width: 32px;
  height: 32px;
  flex: none;
}
.picker-list button.p-only .grow {
  flex: 1;
  min-width: 0;
}
.inv-row select.needs-pick {
  border-color: var(--amber);
  background: var(--amber-bg);
}
.inv-table tr.inv-used td {
  opacity: 0.5;
  font-style: italic;
}
.stock-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.stock-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}
.stock-line .st-ok {
  color: var(--green);
  font-weight: 700;
}
.stock-line .st-used {
  color: var(--muted);
  font-weight: 600;
}
.stock-line .st-miss {
  color: var(--muted);
}
@media (max-width: 760px) {
  .inv-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  .inv-row .rownum,
  .inv-row > .picker {
    grid-column: 1 / -1;
    padding-bottom: 0;
  }
}

/* ✔ a return pickup scanned back in at our desk (order page, shipments table) */
.received-back {
  color: var(--green);
  font-size: 0.9em;
}

/* 💸 Expenses (expenses.js) */
.exp-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.exp-form .field {
  margin: 0;
}
.exp-form .exp-wide {
  flex: 1 1 200px;
  min-width: 180px;
}
.exp-newtype {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.exp-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.exp-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.exp-x {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.exp-chips {
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.exp-totals {
  width: auto;
  min-width: min(100%, 320px);
  margin-bottom: 14px;
}
.exp-totals th {
  text-align: start;
  padding-inline-end: 24px;
}
.exp-num {
  text-align: end;
}
