/* ── Leaption — responsive.css — media queries and responsive overrides ─────── */

/* ============================================================
   MOBILE RESPONSIVENESS
   Below 768px: sidebar becomes a bottom tab bar.
   Below 480px: compact single-column layout.
/*
   ============================================================ */

/* ── Hamburger / mobile nav toggle ─────────────────────────── */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--panel-strong);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  display: none;
  justify-content: space-around;
  align-items: center;
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: color 150ms ease, background 150ms ease;
}

.mobile-tab.active,
.mobile-tab:hover {
  color: var(--accent);
}

.mobile-tab svg {
  display: block;
}

@media (max-width: 768px) {
  /* Show mobile bottom bar, hide desktop sidebar */
  .mobile-nav-toggle {
    display: flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .sidebar {
    display: none;
  }

  /* Stack auth panels vertically */
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-brand-panel {
    padding: 32px 28px;
    min-height: unset;
  }

  .auth-tagline {
    margin: 16px 0 24px;
    font-size: 1.1rem;
  }

  .auth-feature-list {
    display: none; /* hide feature list on small auth screens */
  }

  /* Flatten dashboard layout */
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-management-stack {
    grid-column: 1;
  }

  /* Orders table on tablet/phone — keep horizontal scroll as a fallback,
     but drop the 700px min-width so the layout can reflow into a portrait
     phone once the column trims at the 480px breakpoint below kick in. */
  .orders-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 0;
  }

  /* Campaigns: stack columns */
  .campaign-layout {
    grid-template-columns: 1fr;
  }

  .campaign-side-stack {
    grid-column: 1;
  }

  /* Credits: single column pack grid */
  .credit-pack-grid {
    grid-template-columns: 1fr;
  }

  /* Pricing: single column */
  .plan-stack {
    grid-template-columns: 1fr;
  }

  /* Drawers: full width */
  .side-drawer {
    width: 100% !important;
    max-width: 100vw;
  }

  /* Settings: stack nav above content */
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
    white-space: nowrap;
  }

  .settings-nav-link {
    flex-shrink: 0;
  }

  /* Pricing window: no fixed height */
  .pricing-window {
    max-height: unset;
    overflow-y: unset;
  }
}

@media (max-width: 480px) {
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .dashboard-glance-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .drawer-two-col {
    grid-template-columns: 1fr;
  }

  .main-store-bar {
    display: none; /* save space — store name visible in mobile tab */
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .dashboard-card-actions,
  .dashboard-header-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .dashboard-card-actions .primary-button,
  .dashboard-header-actions .primary-button {
    flex: 1;
  }
}


/* ============================================================
   FORM VALIDATION FEEDBACK
   Inline icons alongside colour for accessible error/success.
/*
   ============================================================ */

/* Base message reset */
.auth-error,
.form-message,
[id$="-message"],
[id$="-error"],
[id$="-warning"] {
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 200ms ease;
}

/* Error state — shown when content is not empty */
.auth-error:not(:empty),
[id$="-message"]:not(:empty),
[id$="-error"]:not(:empty) {
  color: var(--warn);
}

.auth-error:not(:empty)::before,
[id$="-message"]:not(:empty)::before,
[id$="-error"]:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-color: var(--warn);
  border-radius: 50%;
  /* X icon via mask */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Success state — add class "form-success" to show green check */
.form-success:not(:empty) {
  color: var(--highlight);
}

.form-success:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-color: var(--highlight);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='9 12 11 14 15 10'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='9 12 11 14 15 10'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Warning — orange variant for non-fatal notices */
.form-warning:not(:empty) {
  color: #9a6000;
}

.form-warning:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-color: #9a6000;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Input error state — red border when sibling error is shown */
input.input-error,
select.input-error,
textarea.input-error {
  border-color: var(--warn) !important;
  box-shadow: 0 0 0 3px rgba(171, 59, 45, 0.14);
}

input.input-success,
select.input-success,
textarea.input-success {
  border-color: var(--highlight) !important;
  box-shadow: 0 0 0 3px rgba(14, 96, 85, 0.12);
}

/* Password rule list — each rule gets a ✓ when met */
.password-rules {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 4px;
}

.password-rules li {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 20px;
  position: relative;
  transition: color 200ms ease;
}

.password-rules li::before {
  content: "○";
  position: absolute;
  left: 0;
  color: var(--muted);
  transition: color 200ms ease, content 200ms ease;
}

.password-rules li.rule-met {
  color: var(--highlight);
}

.password-rules li.rule-met::before {
  content: "✓";
  color: var(--highlight);
}


/* ============================================================
   TRANSITION CONSISTENCY
   Every interactive surface gets smooth hover/focus feedback.
/*
   ============================================================ */

/* Nav links */
.nav-link {
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

/* Sidebar user menu items */
.sidebar-user-menu-item {
  transition: background 150ms ease, color 150ms ease;
}

/* Settings nav links */
.settings-nav-link {
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

/* History / audience tabs */
.history-tab,
.audience-group-tabs .history-tab {
  transition: color 150ms ease, border-color 150ms ease;
}

/* Mode toggle buttons */
.mode-toggle-button {
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

/* Plan cards */
.plan-card > div {
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}
/* Credit pack buttons */
.credit-pack {
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

/* Inputs, selects, textareas — smooth focus */
input,
select,
textarea {
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

/* Checkboxes */
input[type="checkbox"] {
  transition: background 150ms ease, border-color 150ms ease;
}

/* Drawer close button */
.drawer-close-button {
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.drawer-close-button:hover {
  transform: rotate(90deg);
}

/* Store selector */
.store-selector {
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

/* Sidebar brand toggle */
.sidebar-brand-toggle {
  transition: background 150ms ease, color 150ms ease;
}

/* Campaign metric cards */
.campaign-metric-card {
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

/* Dashboard stat buttons */
.dashboard-stat-button {
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

/* Priority order cards */
.priority-card {
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.priority-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Table row hover */
tbody tr {
  transition: background 120ms ease;
}

/* Toast entry animation */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.toast {
  animation: toast-in 220ms ease forwards;
}

/* Smooth view transitions */
.view.active {
  animation: fade-in 250ms ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sidebar collapse/expand */
.sidebar {
  transition: width 220ms ease;
}

/* Side drawer open animation */
.side-drawer:not(.hidden) {
  animation: drawer-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes drawer-in {
  from { transform: translateX(100%); opacity: 0.6; }
  to   { transform: translateX(0);    opacity: 1; }
}


/* ── Messaging settings panel ────────────────────────────────────────────── */

.msg-panel {
  margin-bottom: 18px;
}

.msg-master-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.msg-master-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-master-info strong {
  font-size: 0.9rem;
}

.msg-notif-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.msg-notif-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.msg-notif-label > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-notif-label strong {
  font-size: 0.9rem;
}

.msg-always-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--highlight);
  background: rgba(14, 96, 85, 0.1);
  border: 1px solid rgba(14, 96, 85, 0.2);
  border-radius: 99px;
  padding: 3px 10px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
}

.msg-days-input {
  display: inline-block;
  width: 52px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 600;
  text-align: center;
  margin: 0 4px;
}

.msg-days-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 96, 85, 0.15);
}

.msg-channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 680px) {
  .msg-channel-grid {
    grid-template-columns: 1fr;
  }
}

.msg-channel-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.msg-channel-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.msg-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}

.msg-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.875rem;
  font-family: inherit;
}

.msg-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 96, 85, 0.15);
}

.msg-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}

.msg-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 96, 85, 0.15);
}

.msg-vars-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.msg-vars-hint code {
  background: rgba(111, 98, 87, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.72rem;
  color: var(--ink);
}

.msg-optout-note {
  font-size: 0.75rem;
  color: var(--highlight);
  font-style: italic;
}

.msg-sms-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 18px;
}

.msg-sms-counter.over {
  color: #c0392b;
}

/* Disabled state when chaser toggle is off */
.msg-panel.msg-disabled .msg-channel-grid {
  opacity: 0.4;
  pointer-events: none;
}

.msg-panel.msg-disabled .msg-days-input {
  pointer-events: none;
}

/* SMS warning box */
.msg-sms-warning {
  background: rgba(192, 57, 43, 0.06);
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 4px;
}

.msg-sms-warning.hidden {
  display: none;
}

.msg-sms-warning strong {
  font-size: 0.9rem;
  color: #c0392b;
}

.msg-sms-warning p {
  font-size: 0.85rem;
  color: var(--ink);
  margin: 8px 0 14px;
  line-height: 1.5;
}

.msg-sms-warning-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── To-Do feature ─────────────────────────────────────────────────────────── */

/* Toolbar */
.todo-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.todo-search-input {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.875rem;
  font-family: inherit;
}

.todo-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.todo-show-completed-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

/* Bulk action bar */
.todo-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(14, 96, 85, 0.06);
  border: 1px solid rgba(14, 96, 85, 0.2);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
}

.todo-bulk-bar.hidden { display: none; }

.todo-bulk-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
}

.todo-bulk-delete-btn {
  color: #c0392b !important;
  border-color: rgba(192,57,43,0.25) !important;
}

/* Table */
.todo-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.todo-check-col { width: 40px; }
.todo-done-col  { width: 40px; }

/* Col widths: checkbox | tick | task | linked | owner | due | status */
.todo-table th:nth-child(1) { width: 40px; }
.todo-table th:nth-child(2) { width: 40px; }
.todo-table th:nth-child(3) { width: 30%; }
.todo-table th:nth-child(4) { width: 22%; }
.todo-table th:nth-child(5) { width: 12%; }
.todo-table th:nth-child(6) { width: 12%; }
.todo-table th:nth-child(7) { width: 10%; }

.todo-table td {
  vertical-align: middle;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

.todo-table th {
  padding: 10px 10px 8px;
  border-bottom: 2px solid var(--line);
}

.todo-check-cell,
.todo-done-cell {
  text-align: center;
  vertical-align: middle;
  padding: 12px 4px !important;
}

.todo-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.todo-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.todo-complete-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.todo-complete-btn:hover {
  border-color: var(--highlight);
  color: var(--highlight);
}

.todo-complete-btn.is-complete {
  background: var(--highlight);
  border-color: var(--highlight);
  color: white;
}

.todo-name-cell {
  max-width: 260px;
}

.todo-name {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
}

.todo-name-done {
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 400;
}

.todo-detail-preview {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.todo-owner-cell { font-size: 0.85rem; }

.todo-due-cell {
  font-size: 0.82rem;
  white-space: nowrap;
  vertical-align: middle !important;
  color: var(--ink);
}

.todo-due-overdue {
  color: #c0392b;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.todo-linked-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--teal);
  background: rgba(14,96,85,0.07);
  border: 1px solid rgba(14,96,85,0.2);
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}

.todo-linked-btn:hover {
  background: rgba(14,96,85,0.14);
}

/* Row states */
.todo-row { cursor: default; }

.todo-name-cell { cursor: pointer; }
.todo-name-cell:hover { text-decoration: underline; color: var(--accent); }

.todo-row:hover td { background: rgba(14,96,85,0.03); }

.todo-overdue td {
  background: rgba(192, 57, 43, 0.04) !important;
}

.todo-overdue:hover td {
  background: rgba(192, 57, 43, 0.08) !important;
}

.todo-overdue {
  box-shadow: inset 3px 0 0 #e74c3c;
}

.todo-completed-row td {
  opacity: 0.65;
}

.todo-selected td {
  background: rgba(14,96,85,0.07) !important;
}

.todo-empty-row {
  text-align: center;
  color: var(--muted);
  padding: 32px !important;
  font-size: 0.875rem;
}

/* Inline section inside entity drawers */
.todo-inline-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 8px;
}

.todo-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.todo-inline-header strong {
  font-size: 0.85rem;
}

.todo-inline-add-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(14,96,85,0.07);
  border: 1px solid rgba(14,96,85,0.2);
  border-radius: 8px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.12s;
}

.todo-inline-add-btn:hover { background: rgba(188,95,50,0.15); }

.todo-inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.todo-inline-form.hidden { display: none; }

.todo-inline-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.85rem;
  font-family: inherit;
}

.todo-inline-input:focus {
  outline: none;
  border-color: var(--accent);
}

.todo-inline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.todo-inline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.todo-inline-item:last-child { border-bottom: none; }

.todo-inline-done {
  opacity: 0.6;
}

.todo-inline-overdue .todo-inline-name {
  color: #c0392b;
}

.todo-inline-name {
  flex: 1;
  font-weight: 500;
}

.todo-inline-due {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.todo-inline-open {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.todo-inline-open:hover { color: var(--accent); }

.todo-inline-empty {
  font-size: 0.8rem;
  padding: 8px 0;
}

/* Drawer form */
.todo-delete-btn {
  color: #c0392b !important;
}

.todo-created-by {
  font-size: 0.78rem;
}

.todo-drawer-meta { padding-top: 0; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.form-actions-left { margin-right: auto; }

.readonly-input {
  background: var(--bg) !important;
  color: var(--muted) !important;
  cursor: default;
}

.required-star { color: #c0392b; }

/* Bulk modal backdrop */
.todo-bulk-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo-bulk-modal.hidden { display: none; }

.todo-bulk-modal-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  width: 320px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

.todo-bulk-modal-title {
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.todo-bulk-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ── Today's Actions widget ─────────────────────────────────────────────────── */

.todays-actions-panel {
  margin-bottom: 0;
}

.todays-actions-title {
  font-size: 1rem;
  font-weight: 700;
}

/* All done state */
.todays-actions-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 16px;
  gap: 8px;
}

.todays-actions-done.hidden { display: none; }

.todays-actions-done-icon {
  color: var(--highlight);
  margin-bottom: 4px;
}

.todays-actions-done strong {
  font-size: 1rem;
}

/* Section within the widget */
.ta-section {
  margin-bottom: 16px;
}

.ta-section:last-child { margin-bottom: 0; }

.ta-section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.ta-count {
  margin-left: auto;
  background: rgba(188,95,50,0.1);
  color: var(--accent);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.ta-empty {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 6px 0;
}

.ta-overflow {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Action row */
.ta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background 0.12s;
  margin-bottom: 4px;
}

.ta-row:hover {
  background: rgba(188,95,50,0.05);
}

.ta-todo-row {
  cursor: pointer;
}

.ta-row-info {
  flex: 1;
  min-width: 0;
}

.ta-row-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ta-row-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Send now button */
.ta-send-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--highlight);
  background: rgba(14, 96, 85, 0.1);
  border: 1px solid rgba(14, 96, 85, 0.2);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}

.ta-send-btn:hover {
  background: rgba(14, 96, 85, 0.2);
}

.ta-send-btn.ta-sent {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  pointer-events: none;
}

/* Full list drawer sections */
#todays-actions-drawer-content .ta-section {
  margin-bottom: 20px;
}

/* ── Help button & drawer ───────────────────────────────────────────────────── */

/* Help trigger button in top banner */
.help-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(14,96,85,0.20);
  border-radius: 10px;
  background: transparent;
  color: var(--teal, #0e6055);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.help-trigger-btn:hover {
  background: rgba(14,96,85,0.08);
  color: var(--teal, #0e6055);
  border-color: rgba(14,96,85,0.35);
}

.help-trigger-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Help drawer — wider than typical drawers */
.help-drawer {
  width: 800px !important;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
}

.help-drawer-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-drawer-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(14, 96, 85, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Scrollable body */
.help-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
}

/* Sections */
.help-section {
  margin-bottom: 24px;
}

.help-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.help-what {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink);
}

/* Steps */
.help-steps {
  list-style: none;
  counter-reset: help-step;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  margin: 0;
}

.help-step {
  counter-increment: help-step;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.help-step::before {
  content: counter(help-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(14, 96, 85, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 2px;
}

.help-step strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 3px;
}

.help-step p {
  font-size: 0.825rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* Tips */
.help-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-tips li {
  font-size: 0.825rem;
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
  color: var(--ink);
}

.help-tips li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 1px;
}

/* Video placeholder */
.help-video-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Footer feedback */
.help-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.help-feedback-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 4px;
  white-space: nowrap;
}

.help-feedback-buttons {
  display: flex;
  gap: 8px;
}

.help-feedback-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.help-feedback-btn:hover {
  background: rgba(14, 96, 85, 0.08);
  color: var(--accent);
  border-color: rgba(14, 96, 85, 0.3);
}

.help-feedback-btn.active-yes {
  background: rgba(14, 96, 85, 0.12);
  color: var(--highlight);
  border-color: rgba(14, 96, 85, 0.3);
}

.help-feedback-btn.active-no {
  background: rgba(192, 57, 43, 0.08);
  color: #c0392b;
  border-color: rgba(192, 57, 43, 0.25);
}

.help-feedback-thanks {
  font-size: 0.78rem;
  color: var(--highlight);
  margin-left: auto;
}

.help-feedback-thanks.hidden { display: none; }

/* ── Scan Delivery trigger button ───────────────────────────────────────────── */
.scan-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(14,96,85,0.20);
  border-radius: 10px;
  background: transparent;
  color: var(--teal, #0e6055);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.scan-trigger-btn:hover {
  background: rgba(14,96,85,0.08);
  color: var(--teal, #0e6055);
  border-color: rgba(14,96,85,0.35);
}
.scan-trigger-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Scanner overlay ────────────────────────────────────────────────────────── */
.scanner-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: white;
  display: flex; flex-direction: column;
  animation: scannerFadeIn 0.2s ease;
}
.scanner-overlay.hidden { display: none; }
@keyframes scannerFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.scanner-shell {
  display: flex; flex-direction: column;
  height: 100%; max-width: 800px;
  margin: 0 auto; width: 100%;
  padding: 0 20px;
}

/* Header */
.scanner-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.scanner-header-left { display: flex; align-items: center; gap: 14px; }
.scanner-logo-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(14,96,85,0.1); color: var(--highlight);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.scanner-title  { font-size: 1.1rem; font-weight: 700; margin: 0; }
.scanner-subtitle { font-size: 0.8rem; margin: 0; }
.scanner-close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.12s;
}
.scanner-close-btn:hover { background: var(--line); }

/* Progress bar */
.scanner-progress {
  display: flex; align-items: center; gap: 0;
  padding: 20px 0 16px; flex-shrink: 0;
}
.scanner-progress-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--muted); flex-shrink: 0;
}
.scanner-progress-step.active   { color: var(--highlight); }
.scanner-progress-step.complete { color: var(--muted); }
.scanner-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.scanner-progress-step.active   .scanner-step-num { border-color: var(--highlight); color: var(--highlight); background: rgba(14,96,85,0.1); }
.scanner-progress-step.complete .scanner-step-num { border-color: var(--highlight); background: var(--highlight); color: white; }
.scanner-progress-line { flex: 1; height: 1px; background: var(--line); margin: 0 10px; }
.scanner-step-label { font-weight: 600; }
@media (max-width: 480px) { .scanner-step-label { display: none; } }

/* Content area */
.scanner-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

/* Step body/footer pattern */
.scan-step-body  { flex: 1; overflow-y: auto; padding: 16px 0; }
.scan-step-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); flex-shrink: 0;
}

/* Saved sessions */
.scan-sessions-header {
  text-align: center; padding: 32px 0 24px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scan-sessions-icon { color: var(--highlight); margin-bottom: 4px; }
.scan-sessions-header h2 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.scan-sessions-table-wrap { overflow-x: auto; }
.scan-sessions-table { width: 100%; border-collapse: collapse; }
.scan-sessions-table th { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.scan-sessions-table td { padding: 12px 12px; border-bottom: 1px solid var(--line); font-size: 0.875rem; vertical-align: middle; }
.scan-session-actions { display: flex; gap: 8px; }
.scan-btn-sm { padding: 5px 12px !important; font-size: 0.78rem !important; }
.scan-delete-btn { color: #c0392b !important; border-color: rgba(192,57,43,0.3) !important; }
.scan-sessions-footer { padding: 20px 0; display: flex; justify-content: center; }
.scan-step-badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.scan-step-1 { background: rgba(188,95,50,0.1); color: var(--accent); }
.scan-step-2 { background: rgba(14,96,85,0.1); color: var(--highlight); }
.scan-step-3 { background: rgba(168,85,247,0.1); color: #a855f7; }

/* Step 1 — scan input */
.scan-input-area { background: rgba(14,96,85,0.04); border: 1px solid rgba(14,96,85,0.15); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.scan-input-wrap { display: flex; gap: 10px; align-items: center; }
.scan-input-icon { color: var(--highlight); flex-shrink: 0; }
.scan-barcode-input {
  flex: 1; padding: 11px 14px; border: 2px solid rgba(14,96,85,0.3);
  border-radius: 10px; background: var(--bg); color: var(--ink);
  font-size: 1rem; font-family: var(--font, inherit);
  transition: border-color 0.15s; font-weight: 600; letter-spacing: 0.05em;
}
.scan-barcode-input:focus { outline: none; border-color: var(--highlight); box-shadow: 0 0 0 3px rgba(14,96,85,0.12); }
.scan-btn-submit { flex-shrink: 0; }
.scan-input-hint { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.scan-camera-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 0.78rem; color: var(--muted); background: transparent; border: none; cursor: not-allowed; opacity: 0.5; font-family: inherit;
}

/* Feedback */
.scan-feedback-area { min-height: 36px; margin-bottom: 12px; }
.scan-feedback-success {
  display: flex; align-items: center; gap: 8px;
  background: rgba(14,96,85,0.1); border: 1px solid rgba(14,96,85,0.25);
  border-radius: 8px; padding: 8px 14px; font-size: 0.85rem; color: var(--highlight);
  animation: scanFeedback 0.3s ease;
}
.scan-feedback-warn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px; padding: 8px 14px; font-size: 0.85rem; color: #b45309;
}
@keyframes scanFeedback { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Scanned items list */
.scan-items-area { }
.scan-items-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 0.875rem; }
.scan-items-count { font-size: 0.78rem; color: var(--muted); }
.scan-empty-state { text-align: center; padding: 40px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scan-item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px; background: rgba(255,255,255,0.5);
  transition: border-color 0.2s;
}
.scan-item-fresh { border-color: var(--highlight); background: rgba(14,96,85,0.05); }
.scan-item-info  { flex: 1; min-width: 0; }
.scan-item-name  { display: block; font-size: 0.875rem; font-weight: 600; }
.scan-item-barcode { display: block; font-size: 0.72rem; color: var(--muted); font-family: monospace; margin-top: 2px; }
.scan-item-qty-controls { display: flex; align-items: center; gap: 8px; }
.scan-qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.12s;
}
.scan-qty-btn:hover { background: var(--line); }
.scan-qty-val { font-size: 1rem; font-weight: 700; min-width: 24px; text-align: center; }
.scan-remove-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; }
.scan-remove-btn:hover { color: #c0392b; }

/* Step 2 — match orders */
.scan-unmatched-banner {
  display: flex; gap: 12px; background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 16px; color: #92400e; font-size: 0.85rem;
}
.scan-unmatched-list { margin: 6px 0 0 0; padding: 0 0 0 16px; }
.scan-unmatched-list li { margin-bottom: 4px; }
.scan-unmatched-list code { font-family: monospace; font-size: 0.8rem; background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px; }
.scan-match-intro { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.875rem; flex-wrap: wrap; }
.scan-select-all-label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; cursor: pointer; margin-left: auto; }
.scan-match-list { display: flex; flex-direction: column; gap: 8px; }
.scan-match-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 2px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  background: rgba(255,255,255,0.5);
}
.scan-match-row:hover   { border-color: rgba(188,95,50,0.3); }
.scan-match-selected    { border-color: var(--highlight) !important; background: rgba(14,96,85,0.04) !important; }
.scan-match-info        { flex: 1; min-width: 0; }
.scan-match-info strong { display: block; font-size: 0.9rem; }
.scan-match-product     { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-match-meta        { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.scan-alloc-qty         { color: var(--highlight); }
.scan-arrival-badge     { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.scan-full    { background: rgba(14,96,85,0.12); color: var(--highlight); }
.scan-partial { background: rgba(245,158,11,0.12); color: #92400e; }

/* Step 3 */
.scan-step3-summary { display: flex; gap: 16px; margin-bottom: 16px; }
.scan-step3-stat {
  flex: 1; background: rgba(255,255,255,0.5); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; text-align: center;
}
.scan-step3-stat span { font-size: 1.8rem; font-weight: 700; display: block; line-height: 1; }
.scan-step3-stat small { font-size: 0.75rem; color: var(--muted); margin-top: 4px; display: block; }
.scan-credit-box {
  background: rgba(255,255,255,0.5); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.scan-credit-box.scan-credit-warning { border-color: rgba(192,57,43,0.35); background: rgba(192,57,43,0.04); }
.scan-credit-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.scan-credit-row strong { display: block; font-size: 0.875rem; }
.scan-credit-row .muted { font-size: 0.78rem; }
.scan-credit-balance { text-align: right; }
.scan-credit-label { font-size: 0.72rem; color: var(--muted); display: block; }
.scan-credit-balance strong { font-size: 1.1rem; font-family: monospace; }
.scan-credit-low { color: #c0392b !important; }
.scan-credit-alert {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(192,57,43,0.15);
  font-size: 0.82rem; color: #c0392b;
}
.scan-auto-notice {
  display: flex; align-items: center; gap: 8px;
  background: rgba(14,96,85,0.07); border: 1px solid rgba(14,96,85,0.2);
  border-radius: 10px; padding: 10px 14px; font-size: 0.82rem; color: var(--highlight);
  margin-bottom: 14px;
}
.scan-notif-list-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.875rem; margin-bottom: 10px; font-weight: 600;
}
.scan-notif-list { display: flex; flex-direction: column; gap: 6px; }
.scan-notif-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,0.5);
}
.scan-notif-info  { flex: 1; min-width: 0; }
.scan-notif-info strong { display: block; font-size: 0.875rem; }
.scan-notif-info .muted { font-size: 0.78rem; }
.scan-notif-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.scan-notif-cost  { font-size: 0.75rem; color: var(--muted); font-family: monospace; }
.scan-notif-check { color: var(--highlight); flex-shrink: 0; }
.scan-btn-warn    { background: rgba(245,158,11,0.15) !important; color: #92400e !important; border: 1px solid rgba(245,158,11,0.4) !important; }

/* Completion */
.scan-complete-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 12px; padding: 40px 20px;
}
.scan-complete-icon { color: var(--highlight); margin-bottom: 8px; }
.scan-complete-screen h2 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.scan-start-another { margin-top: 8px; }
.disabled-btn { opacity: 0.45; cursor: not-allowed; }

/* Top-up panel inside scanner */
.scanner-topup-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 100vw;
  background: var(--bg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 10;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  animation: slideInRight 0.25s ease;
}
.scanner-topup-panel.hidden { display: none; }
@keyframes slideInRight { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.scanner-topup-inner { padding: 24px; flex: 1; overflow-y: auto; }
.scanner-topup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.scanner-topup-header strong { font-size: 1rem; }
.credits-pack-grid { display: grid; gap: 12px; }
/* ── Credit purchase history table ─────────────────────────────────────────── */

.credits-history-panel {
  padding: 0;
  overflow: hidden;
}

.credits-history-panel .panel-header {
  padding: 18px 20px 14px;
}

.credits-history-table-wrap {
  overflow-x: auto;
}

.credits-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.credits-history-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 20px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.credits-history-table thead th:nth-child(3),
.credits-history-table thead th:nth-child(4),
.credits-history-table thead th:nth-child(5),
.credits-history-table thead th:nth-child(6) {
  text-align: right;
}

.credits-history-table tbody tr {
  transition: background 0.1s;
}

.credits-history-table tbody tr:hover td {
  background: rgba(14, 96, 85, 0.03);
}

.credits-history-table tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.credits-history-table tbody tr:last-child td {
  border-bottom: none;
}

.credits-history-table td:nth-child(3),
.credits-history-table td:nth-child(4),
.credits-history-table td:nth-child(5),
.credits-history-table td:nth-child(6) {
  text-align: right;
  font-family: var(--font-mono, monospace);
}

.credits-history-date {
  color: var(--muted);
  font-size: 0.82rem;
}

.credits-history-pack {
  font-weight: 600;
}

.credits-history-price {
  font-weight: 600;
  color: var(--ink);
}

.credits-history-qty {
  color: var(--highlight);
  font-weight: 700;
}

.credits-history-before {
  color: var(--muted);
}

.credits-history-after {
  font-weight: 600;
  color: var(--ink);
}

.credits-history-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* New purchase row highlight (fades out) */
@keyframes creditRowFlash {
  0%   { background: rgba(14, 96, 85, 0.12); }
  100% { background: transparent; }
}

.credits-history-table tbody tr.credit-row-new td {
  animation: creditRowFlash 2s ease forwards;
}

/* ── Dashboard layout fixes ─────────────────────────────────────────────────── */

.dashboard-left-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  align-self: start;
}

/* ── Banner action buttons ──────────────────────────────────────────────────── */

.main-store-bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Integrations page ──────────────────────────────────────────────────────── */

.integrations-page { display: flex; flex-direction: column; gap: 20px; }

.integrations-page-header { margin-bottom: 4px; }

.integration-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.integration-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: rgba(255,255,255,0.56);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s;
}

.integration-card-connected { border-color: rgba(14,96,85,0.3); }
.integration-card-soon { opacity: 0.65; }

.integration-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.integration-card-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.shopify-logo    { background: rgba(149,191,71,0.15);  color: #5a8a00; }
.shopify-logo-lg { background: rgba(149,191,71,0.15);  color: #5a8a00; }
.square-logo     { background: rgba(0,0,0,0.06);        color: var(--ink); }
.woo-logo        { background: rgba(150,88,166,0.12);   color: #7b4d8a; }

.integration-card-meta { flex: 1; }
.integration-card-meta strong { display: block; font-size: 0.95rem; }
.integration-card-meta span   { font-size: 0.78rem; color: var(--muted); }

.integration-status-badge {
  font-size: 0.72rem; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.integration-status-badge.connected    { background: rgba(14,96,85,0.1); color: var(--highlight); }
.integration-status-badge.not-connected { background: rgba(111,98,87,0.1); color: var(--muted); }
.integration-status-badge.coming-soon  { background: rgba(245,158,11,0.1); color: #92400e; }

.integration-card-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.55; }

.integration-details { display: flex; flex-direction: column; gap: 8px; }
.integration-detail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.82rem; gap: 12px;
}
.integration-detail-row .muted { flex-shrink: 0; }
.integration-detail-row strong, .integration-detail-row span:last-child { text-align: right; }

.text-green { color: var(--highlight); font-weight: 600; }
.text-amber { color: #92400e; font-weight: 600; }

.integration-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.shopify-disconnect-btn { color: #c0392b !important; }

.integration-help-box {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(188,95,50,0.04); border: 1px solid rgba(188,95,50,0.15);
  border-radius: 14px; padding: 16px 18px;
}
.integration-help-icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.integration-help-box strong { font-size: 0.875rem; display: block; margin-bottom: 6px; }
.integration-help-box p { font-size: 0.82rem; line-height: 1.6; margin: 0; }

/* ── Shopify Wizard Overlay ─────────────────────────────────────────────────── */

.shopify-wizard-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: var(--bg); display: flex; flex-direction: column;
  animation: scannerFadeIn 0.2s ease;
}
.shopify-wizard-overlay.hidden { display: none; }

.shopify-wizard-shell {
  display: flex; flex-direction: column;
  height: 100%; max-width: 680px; margin: 0 auto; width: 100%; padding: 0 24px;
}

.shopify-wizard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.shopify-wizard-header-left { display: flex; align-items: center; gap: 14px; }
.shopify-wizard-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(149,191,71,0.15); color: #5a8a00;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.shopify-wizard-title    { font-size: 1.1rem; font-weight: 700; margin: 0; }
.shopify-wizard-subtitle { font-size: 0.8rem; margin: 0; }

/* Step indicators */
.shopify-wizard-steps {
  display: flex; align-items: center; padding: 18px 0 14px; flex-shrink: 0;
}
.sw-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--muted); font-weight: 600; flex-shrink: 0;
}
.sw-step.active   { color: #5a8a00; }
.sw-step.complete { color: var(--muted); }
.sw-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.sw-step.active   .sw-step-num { border-color: #5a8a00; color: #5a8a00; background: rgba(149,191,71,0.1); }
.sw-step.complete .sw-step-num { border-color: #5a8a00; background: #5a8a00; color: white; }
.sw-step-line { flex: 1; height: 1px; background: var(--line); margin: 0 10px; }
@media (max-width: 480px) { .sw-step-label { display: none; } }

/* Content and footer */
.shopify-wizard-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.sw-body   { flex: 1; overflow-y: auto; padding: 20px 0; }
.sw-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); flex-shrink: 0;
}

/* Step 1 — connect */
.sw-step-intro { text-align: center; padding: 8px 0 24px; }
.sw-intro-icon {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.sw-step-intro h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.sw-form { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.sw-field { display: flex; flex-direction: column; gap: 6px; }
.sw-field label { font-size: 0.82rem; font-weight: 600; }
.sw-field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.9rem;
  transition: border-color 0.15s;
}
.sw-field input:focus { outline: none; border-color: #5a8a00; box-shadow: 0 0 0 3px rgba(149,191,71,0.12); }
.sw-input-with-suffix { display: flex; align-items: stretch; }
.sw-input-with-suffix input { border-radius: 10px 0 0 10px; border-right: none; }
.sw-input-suffix {
  display: flex; align-items: center; padding: 0 12px;
  background: rgba(111,98,87,0.08); border: 1px solid var(--line); border-radius: 0 10px 10px 0;
  font-size: 0.82rem; color: var(--muted); white-space: nowrap; flex-shrink: 0;
}
.sw-field-hint { font-size: 0.78rem; color: var(--muted); }
.sw-field-hint code { font-family: monospace; background: rgba(111,98,87,0.1); padding: 1px 5px; border-radius: 4px; }
.sw-field-error {
  background: rgba(192,57,43,0.08); border: 1px solid rgba(192,57,43,0.25);
  color: #c0392b; border-radius: 8px; padding: 9px 12px; font-size: 0.83rem;
}
.sw-how-to {
  background: rgba(255,255,255,0.5); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; font-size: 0.82rem;
}
.sw-how-to strong { display: block; margin-bottom: 10px; }
.sw-how-to ol { padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.sw-how-to code { font-family: monospace; background: rgba(111,98,87,0.1); padding: 1px 5px; border-radius: 4px; }

/* Testing animation */
.sw-testing-body { display: flex; align-items: center; justify-content: center; }
.sw-testing-animation { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.sw-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(149,191,71,0.2); border-top-color: #5a8a00;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sw-mini-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: currentColor;
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* Step 1 result */
.sw-success-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(14,96,85,0.1); border: 1px solid rgba(14,96,85,0.25);
  color: var(--highlight); border-radius: 10px; padding: 12px 16px;
  font-size: 0.9rem; font-weight: 600; margin-bottom: 20px;
}
.sw-shop-info { display: flex; flex-direction: column; gap: 12px; }
.sw-shop-info-row {
  display: flex; justify-content: space-between;
  font-size: 0.875rem; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.sw-shop-info-row:last-child { border-bottom: none; }

/* Step 2 */
.sw-section-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 10px; }
.sw-section-desc  { font-size: 0.82rem; color: var(--muted); margin-bottom: 14px; }
.sw-mapping-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 8px; }
.sw-mapping-table th { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 6px 0 8px; border-bottom: 1px solid var(--line); text-align: left; }
.sw-mapping-table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sw-mapping-table tr:last-child td { border-bottom: none; }
.sw-shopify-badge { background: rgba(149,191,71,0.12); color: #5a8a00; font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.sw-option-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.sw-option-row > div { flex: 1; }
.sw-option-row strong { font-size: 0.875rem; display: block; margin-bottom: 4px; }

/* Step 3 */
.sw-activate-list { display: flex; flex-direction: column; gap: 14px; }
.sw-activate-item { display: flex; align-items: flex-start; gap: 14px; }
.sw-activate-check {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.sw-activate-check.pending { background: rgba(111,98,87,0.1); color: var(--muted); border: 2px solid var(--line); }
.sw-activate-check.loading { background: rgba(149,191,71,0.1); color: #5a8a00; border: 2px solid #5a8a00; }
.sw-activate-check.done    { background: #5a8a00; color: white; border: 2px solid #5a8a00; }
.sw-activate-check.error   { background: rgba(192,57,43,0.1); color: #c0392b; border: 2px solid #c0392b; }
.sw-activate-item strong   { display: block; font-size: 0.9rem; margin-bottom: 4px; }

/* Completion */
.sw-complete-body {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px;
}
.sw-complete-icon { color: #5a8a00; margin-bottom: 4px; }
.sw-complete-body h2 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.sw-complete-stats { display: flex; gap: 20px; margin-top: 8px; }
.sw-stat { text-align: center; }
.sw-stat span { font-size: 1.8rem; font-weight: 700; display: block; }
.sw-stat small { font-size: 0.75rem; color: var(--muted); }
.sw-next-btn { display: inline-flex; align-items: center; gap: 6px; }
/* ── Quick Capture view ─────────────────────────────────────────────────────── */

#quick-capture-view {
  padding: 0;
  min-height: calc(100vh - 66px); /* full height minus top banner */
  display: none; /* hidden by default — shown only when .active */
  flex-direction: column;
}

.qc-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

/* Header */
.qc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.qc-header-brand strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.qc-header-brand span {
  font-size: 0.78rem;
}

.qc-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}

.qc-switch-btn:hover {
  background: rgba(14, 96, 85, 0.06);
  color: var(--accent);
  border-color: rgba(14, 96, 85, 0.3);
}

/* Form wrap — centred vertically */
.qc-form-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 24px 0 40px;
  overflow-y: auto;
}

/* Step blocks */
.qc-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qc-step.hidden { display: none; }

.qc-step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qc-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(14, 96, 85, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Search */
.qc-search-row {
  display: flex;
  gap: 10px;
}

.qc-search-input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s;
}

.qc-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 96, 85, 0.1);
}

.qc-search-btn { padding: 14px 22px; font-size: 0.95rem; border-radius: 12px; }

.qc-search-feedback {
  min-height: 22px;
  font-size: 0.83rem;
}

.qc-feedback-hint { color: var(--muted); }

/* Found customer card */
.qc-found-customer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(14, 96, 85, 0.05);
  border: 1.5px solid rgba(14, 96, 85, 0.25);
  border-radius: 14px;
}

.qc-found-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(14, 96, 85, 0.15);
  color: var(--highlight);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qc-found-info { flex: 1; min-width: 0; }
.qc-found-info strong { display: block; font-size: 0.95rem; }
.qc-found-info span   { font-size: 0.8rem; }

.qc-change-btn { font-size: 0.78rem; flex-shrink: 0; }

/* Open orders list */
.qc-open-orders {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qc-open-orders-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}

.qc-open-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
}

.qc-open-order-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qc-no-orders { font-size: 0.82rem; padding: 4px 0; }

/* New customer fields */
.qc-new-customer-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Order fields */
.qc-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s;
}

.qc-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 96, 85, 0.1);
}

.qc-order-fields { display: flex; flex-direction: column; gap: 12px; }

/* Qty row */
.qc-qty-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qc-qty-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  width: 28px;
  flex-shrink: 0;
}

.qc-qty-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.qc-qty-btn:hover {
  background: rgba(14, 96, 85, 0.08);
  border-color: var(--accent);
}

.qc-qty-val {
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}

.qc-field-error {
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.25);
  color: #c0392b;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.83rem;
}

/* Save row */
.qc-save-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.qc-save-row.hidden { display: none; }

.qc-save-btn {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.qc-reset-btn {
  padding: 14px 18px;
  font-size: 0.875rem;
  border-radius: 12px;
}

/* Confirmation */
.qc-confirmation {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
  animation: qcConfirmIn 0.3s ease;
}

.qc-confirmation.hidden { display: none; }

@keyframes qcConfirmIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.qc-confirmation-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(14, 96, 85, 0.08);
  border: 1.5px solid rgba(14, 96, 85, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  width: 100%;
}

.qc-confirmation-icon { color: var(--highlight); flex-shrink: 0; }

.qc-confirmation-inner strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--highlight);
  margin-bottom: 4px;
}

.qc-confirmation-inner p { font-size: 0.85rem; margin: 0; }

/* Team home screen toggle */
.team-home-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  flex-wrap: wrap;
}

.team-home-info strong { font-size: 0.875rem; display: block; margin-bottom: 3px; }
.team-home-info span   { font-size: 0.78rem; }

.team-home-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.home-opt {
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.home-opt:hover { background: rgba(14, 96, 85, 0.06); color: var(--accent); }

.home-opt.active {
  background: var(--accent);
  color: white;
}
/* ── New 3-stage order drawer ────────────────────────────────────────────────── */

/* Stage progress */
.order-drawer-stages {
  display: flex; align-items: center;
  padding: 14px 26px 10px; border-bottom: 1px solid var(--line);
  flex-shrink: 0; gap: 0;
}
.od-stage {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.78rem; font-weight: 600; color: var(--muted); flex-shrink: 0;
}
.od-stage.active   { color: var(--accent); }
.od-stage.complete { color: var(--muted); }
.od-stage-num {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800;
}
.od-stage.active   .od-stage-num { border-color: var(--accent); color: var(--accent); background: rgba(188,95,50,0.08); }
.od-stage.complete .od-stage-num { border-color: var(--accent); background: var(--accent); color: white; }
.od-stage-line { flex: 1; height: 1px; background: var(--line); margin: 0 8px; }

/* Stage panels */
.od-stage-panel { padding: 20px 26px; display: flex; flex-direction: column; gap: 16px; }
.od-stage-panel.hidden { display: none; }
.od-stage-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto;
}
.od-stage-error {
  background: rgba(192,57,43,0.08); border: 1px solid rgba(192,57,43,0.25);
  color: #c0392b; border-radius: 8px; padding: 8px 12px; font-size: 0.82rem;
}
.od-field { display: flex; flex-direction: column; gap: 5px; }
.od-field label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.od-field input, .od-field textarea, .od-field select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.875rem;
  transition: border-color 0.15s;
}
.od-field input:focus, .od-field textarea:focus, .od-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(188,95,50,0.08);
}
.od-field-error {
  background: rgba(192,57,43,0.08); border: 1px solid rgba(192,57,43,0.25);
  color: #c0392b; border-radius: 8px; padding: 7px 11px; font-size: 0.8rem;
}

/* Stage 1 — customer search */
.od-search-row { display: flex; gap: 8px; }
.od-search-row input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.875rem;
}
.od-search-row input:focus { outline: none; border-color: var(--accent); }
.od-customer-results {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: -6px;
}
.od-customer-results.hidden { display: none; }
.od-selected-customer.hidden { display: none; }
.od-customer-selected-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: rgba(14,96,85,0.05);
  border: 1.5px solid rgba(14,96,85,0.25); border-radius: 12px;
}
.od-cust-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(14,96,85,0.15); color: var(--highlight);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 800; flex-shrink: 0;
}
.od-cust-info { flex: 1; min-width: 0; }
.od-cust-info strong { display: block; font-size: 0.9rem; }
.od-cust-info span   { font-size: 0.78rem; }
.od-new-customer { display: flex; flex-direction: column; gap: 12px; }
.od-new-customer.hidden { display: none; }
.od-new-customer-header { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; }
.od-save-new-customer-btn { align-self: flex-start; }
.lookup-option-new { background: rgba(188,95,50,0.04); font-style: italic; }

/* Stage 2 — items */
.od-items-list { display: flex; flex-direction: column; gap: 8px; }
.od-items-empty p { font-size: 0.83rem; color: var(--muted); text-align: center; padding: 12px 0; }
.od-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,0.5);
}
.od-item-row-info { flex: 1; min-width: 0; }
.od-item-row-info strong { display: block; font-size: 0.875rem; }
.od-item-row-info span   { font-size: 0.75rem; }
.od-item-row-actions { display: flex; align-items: center; gap: 8px; }
.od-item-remove-btn {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(192,57,43,0.3);
  background: transparent; color: #c0392b; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.od-add-item-form {
  background: rgba(255,255,255,0.4); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px;
}
.od-add-item-header strong { font-size: 0.875rem; }
.od-qty-row { display: flex; align-items: center; gap: 10px; }
.od-qty-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.od-qty-btn:hover { background: var(--line); }
.od-qty-val { font-size: 1rem; font-weight: 700; min-width: 24px; text-align: center; }

/* Group picker */
.od-group-picker { border-top: 1px solid var(--line); padding-top: 12px; }
.od-group-toggle {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: var(--muted);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.od-group-toggle:hover { color: var(--accent); }
.od-group-panel { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.od-group-panel.hidden { display: none; }
.od-group-select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.875rem;
}
.od-group-checklist { display: flex; flex-direction: column; gap: 8px; }
.od-group-checklist.hidden { display: none; }
.od-group-item-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; }
.od-group-add-btn.hidden { display: none; }

/* Stage 3 — review */
.od-review-section { display: flex; flex-direction: column; gap: 6px; }
.od-review-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.od-review-label-row { display: flex; justify-content: space-between; align-items: center; }
.od-review-customer { }
.od-review-customer-row strong { display: block; font-size: 0.9rem; }
.od-review-customer-row span   { font-size: 0.8rem; }
.od-review-items { display: flex; flex-direction: column; gap: 6px; }
.od-review-item-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.875rem; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.od-review-item-row:last-child { border-bottom: none; }
.od-description-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.875rem; resize: vertical;
}
.od-description-input:focus { outline: none; border-color: var(--accent); }
.od-review-id {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; padding: 10px 0; border-top: 1px solid var(--line);
}
.od-review-id-val { font-family: monospace; font-weight: 700; color: var(--accent); }

/* Edit mode */
.od-edit-section { display: flex; flex-direction: column; gap: 8px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.od-edit-section:last-of-type { border-bottom: none; }
.od-edit-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.od-edit-label-row { display: flex; justify-content: space-between; align-items: center; }
.od-edit-select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.82rem;
}
.od-edit-status-row { display: flex; align-items: center; gap: 12px; }
.od-edit-item-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
}
.od-edit-item-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.od-edit-item-fields input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.82rem;
}
.od-edit-item-qty-row { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.od-edit-qty-val { min-width: 20px; text-align: center; font-weight: 700; }
.od-edit-arrived-label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; cursor: pointer; }
.od-edit-remove { align-self: flex-start; margin-top: 4px; }
/* ── API Access Settings Panel ──────────────────────────────────────────────── */

.api-key-form {
  background: rgba(255,255,255,0.5); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; margin: 16px 0;
}
.api-key-form.hidden { display: none; }
.api-key-form-inner { display: flex; flex-direction: column; gap: 14px; }
.api-key-form-inner label { font-size: 0.8rem; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; }
.api-key-form-inner input,
.api-key-form-inner select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.875rem;
}
.api-key-form-actions { display: flex; gap: 10px; }

.api-key-reveal { margin: 16px 0; }
.api-key-reveal.hidden { display: none; }
.api-key-reveal-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3);
  color: #92400e; border-radius: 10px; padding: 10px 14px;
  font-size: 0.83rem; font-weight: 600; margin-bottom: 10px;
}
.api-key-display-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.api-key-value {
  flex: 1; font-family: monospace; font-size: 0.82rem;
  word-break: break-all; color: var(--ink);
}

.api-keys-table-wrap { overflow-x: auto; margin-top: 16px; }
.api-keys-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.api-keys-table th {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); padding: 8px 12px;
  border-bottom: 1px solid var(--line); text-align: left;
}
.api-keys-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.api-keys-table tr:last-child td { border-bottom: none; }
.api-keys-empty { text-align: center; padding: 24px; color: var(--muted); }

.scope-badge {
  font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  display: inline-block;
}
.scope-read       { background: rgba(14,96,85,0.1);  color: var(--highlight); }
.scope-read_write { background: rgba(59,130,246,0.1);  color: #1d4ed8; }
.scope-full       { background: rgba(188,95,50,0.1);   color: var(--accent); }

.api-limits-panel { margin-top: 0; }
.api-limits-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.api-limits-table th {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); padding: 8px 0 6px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.api-limits-table td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.api-limits-table tr:last-child td { border-bottom: none; }

/* ── API Docs page ───────────────────────────────────────────────────────────── */

.api-docs-content { display: flex; flex-direction: column; gap: 0; }

.api-doc-shell { max-width: 800px; }

.api-doc-header { margin-bottom: 20px; }
.api-doc-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.api-doc-header p  { color: var(--muted); }

.section-card {
  background: var(--surface, rgba(255,255,255,0.6));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; margin-bottom: 18px;
}

.section-card h2 {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.section-card h3 { font-size: 0.875rem; font-weight: 700; margin: 16px 0 8px; }
.section-card p  { font-size: 0.875rem; line-height: 1.6; color: var(--muted); margin-bottom: 10px; }

.section-card pre {
  background: #1e1e2e; color: #cdd6f4; padding: 16px 18px;
  border-radius: 12px; overflow-x: auto; font-size: 0.8rem; line-height: 1.65;
  margin: 8px 0; tab-size: 2;
}
.section-card pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.section-card table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 8px 0; }
.section-card th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left;
}
.section-card td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.section-card tr:last-child td { border-bottom: none; }

.method {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 800; margin-right: 6px; flex-shrink: 0;
}
.get    { background: rgba(14,96,85,0.12); color: #0e6055; }
.post   { background: rgba(188,95,50,0.12);  color: var(--accent); }
.put    { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.patch  { background: rgba(168,85,247,0.12); color: #7c3aed; }
.delete { background: rgba(239,68,68,0.12);  color: #b91c1c; }

.endpoint-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.endpoint-row:last-of-type { border-bottom: none; }
.endpoint-path { font-family: monospace; font-size: 0.875rem; font-weight: 600; }
.endpoint-desc { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.scope-pill {
  display: inline-block; padding: 1px 7px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 700; background: rgba(188,95,50,0.08); color: var(--accent);
  margin-left: 6px;
}
/* ── Leaption sidebar logo ──────────────────────────────────────────────────── */

.sidebar-logo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  color: var(--accent);
}

.sidebar-logo-btn svg {
  flex-shrink: 0;
  color: var(--accent);
}

.sidebar-brand-wordmark {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Hide wordmark when sidebar collapsed */
.sidebar-collapsed .sidebar-brand-wordmark { display: none; }

/* ── Auth form field styling — matches marketing site modal ─────────────────── */

.sign-in-form input,
.sign-up-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(28,42,43,0.14);
  background: white;
  color: var(--ink);
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sign-in-form input:focus,
.sign-up-form input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14,96,85,0.1);
}

.sign-in-form label,
.sign-up-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0;
}

/* Auth responsive */
@media (max-width: 768px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { padding: 32px 20px; }
}

/* ── Leaption primary button — teal instead of terracotta ───────────────────── */

.primary-button {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)) !important;
  color: white !important;
  border: none !important;
}

.primary-button:hover {
  background: var(--accent-light) !important;
  transform: translateY(-1px);
}

.auth-submit {
  margin-top: 8px;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 8px;
  width: 100%;
}

/* ── Leaption "Cozy" renamed — kept as alternative theme ────────────────────── */
/* The root tokens above ARE the Leaption default theme.                       */


/* Cozy theme rules moved to themes.css */

/* ── Demo card — updated for Leaption palette ───────────────────────────────── */

.demo-card {
  margin-bottom: 24px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(14,96,85,0.15);
  background: rgba(14,96,85,0.06);
  color: var(--ink);
  font-size: 0.85rem;
}

.demo-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
}

.demo-card code {
  font-family: monospace;
  font-size: 0.82rem;
  background: rgba(14,96,85,0.1);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--teal-dark);
}
/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE UI ADDITIONS
   Paste this block at the bottom of responsive.css.
   Adds: mobile top bar, FAB, action sheet, and enhanced mobile layout overrides.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Mobile top bar ─────────────────────────────────────────────────────────── */

.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 60px;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-top-bar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mobile-top-bar-wordmark {
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--teal, #0e6055);
  letter-spacing: -0.3px;
}

.mobile-top-bar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal, #0e6055);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14,96,85,0.28);
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.mobile-top-bar-avatar:active {
  transform: scale(0.92);
}

/* ── Mobile FAB ─────────────────────────────────────────────────────────────── */

.mobile-fab-area {
  display: none;
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom));
  right: 20px;
  z-index: 210;
}

.mobile-fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--teal, #0e6055);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(14,96,85,0.42);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}

.mobile-fab:active { transform: scale(0.9); }

.mobile-fab.is-open {
  transform: rotate(45deg);
  background: var(--ink, #1c2a2b);
  box-shadow: 0 4px 16px rgba(28,42,43,0.35);
}

/* Action sheet */
.mobile-fab-sheet {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-fab-sheet:not(.hidden) { pointer-events: all; }
.mobile-fab-sheet.hidden { opacity: 0; }

.mobile-fab-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28,42,43,0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mobile-fab-sheet.hidden .mobile-fab-sheet-overlay { opacity: 0; }

.mobile-fab-sheet-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--cream, #ffffff);
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(28,42,43,0.14);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.mobile-fab-sheet.hidden .mobile-fab-sheet-panel { transform: translateY(100%); }

.mobile-fab-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 0 auto 20px;
}

.mobile-fab-sheet-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text, #1c2a2b);
  margin: 0 0 16px;
}

.mobile-fab-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-fab-action {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel, #fff);
  border: none;
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 10px rgba(28,42,43,0.07);
  transition: transform 0.15s;
  width: 100%;
}

.mobile-fab-action:active { transform: scale(0.97); }

.mobile-fab-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-fab-action-icon--teal  { background: rgba(14,96,85,0.1);    color: var(--teal, #0e6055); }
.mobile-fab-action-icon--gold  { background: rgba(207,159,82,0.12); color: #9a7022; }
.mobile-fab-action-icon--sage  { background: rgba(74,140,122,0.12); color: #3a7060; }

.mobile-fab-action-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-fab-action-body strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #1c2a2b);
}

.mobile-fab-action-body span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.mobile-fab-action-arrow { color: var(--muted); flex-shrink: 0; }

/* ── Mobile media query additions ───────────────────────────────────────────── */

@media (max-width: 768px) {

  /* Show new mobile chrome */
  .mobile-top-bar  { display: flex; }
  .mobile-fab-area { display: flex; }

  /* Offset main content for the top bar */
  .app-shell {
    padding-top: 60px;
  }

  /* Hide desktop-only top bar */
  .main-store-bar { display: none; }

  /* Tighten main content padding on mobile */
  .main {
    padding: 16px 14px !important;
  }

  /* Reposition sidebar user menu to appear under mobile avatar button */
  #sidebar-user-menu {
    bottom: auto;
    top: 54px;
    right: 12px;
    left: auto;
    transform: none !important;
  }

  /* Make panels rounder and more card-like */
  .panel { border-radius: 16px !important; }

  /* Glance chips: horizontally scrollable */
  .command-glance-row {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .command-glance-row::-webkit-scrollbar { display: none; }
  .command-glance-chip { flex-shrink: 0; }

  /* Full-screen drawers */
  .side-drawer {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }
}

@media (max-width: 480px) {
  .main { padding: 12px !important; }
  .panel { padding: 14px !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE PROFILE PANEL
   Full-screen slide-up triggered by avatar button on mobile.
   ══════════════════════════════════════════════════════════════════════════════ */

.mobile-profile-panel {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}
.mobile-profile-panel:not(.hidden) { pointer-events: all; }
.mobile-profile-panel.hidden { opacity: 0; }

.mobile-profile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28,42,43,0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.25s;
}
.mobile-profile-panel.hidden .mobile-profile-overlay { opacity: 0; }

.mobile-profile-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--panel-strong, #fff);
  border-radius: 24px 24px 0 0;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-profile-panel.hidden .mobile-profile-sheet { transform: translateY(100%); }

/* Header */
.mobile-profile-header {
  background: var(--teal, #0e6055);
  padding: 20px 20px 24px;
  position: relative;
}

.mobile-profile-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.mobile-profile-close:active { background: rgba(255,255,255,0.25); }

.mobile-profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.mobile-profile-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.mobile-profile-name {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.mobile-profile-role {
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem;
  margin-top: 2px;
}

/* Wallet summary in header */
.mobile-profile-wallet {
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 14px;
}

.mobile-profile-wallet-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.6);
  display: block;
  margin-bottom: 6px;
}

.mobile-profile-wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-profile-wallet-balance {
  color: white;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.mobile-profile-wallet-btn {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.mobile-profile-wallet-btn:active { background: rgba(255,255,255,0.28); }

/* Menu items */
.mobile-profile-menu {
  padding: 8px 0 16px;
}

.mobile-profile-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  font-family: inherit;
}
.mobile-profile-item:active { background: rgba(14,96,85,0.06); }

.mobile-profile-item-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(14,96,85,0.08);
  color: var(--teal, #0e6055);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.mobile-profile-item-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #1c2a2b);
}

.mobile-profile-item-arrow {
  color: var(--muted, #aaa);
  font-size: 1.1rem;
}

.mobile-profile-item--danger .mobile-profile-item-icon {
  background: rgba(192,57,43,0.08);
  color: #c0392b;
}
.mobile-profile-item--danger .mobile-profile-item-label { color: #c0392b; }

.mobile-profile-divider {
  height: 1px;
  background: var(--line, rgba(0,0,0,0.07));
  margin: 6px 20px;
}


/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE MEDIA QUERY — all remaining fixes
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Dashboard: hide widgets and controls ── */
  #dashboard-credits-card,
  #dashboard-campaigns-card,
  #dashboard-customers-card { display: none; }

  .dashboard-header-actions,
  .command-glance-row,
  .command-controls-row,
  .command-bulk-bar { display: none !important; }

  /* ── Compact action buttons in order list ── */
  .ta-send-btn,
  .command-stack .secondary-button,
  .command-stack .ghost-button {
    font-size: 0.72rem !important;
    padding: 5px 10px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .ta-row-name { font-size: 0.82rem; }
  .ta-row-meta { font-size: 0.7rem; }

  /* ── All tables: horizontal scroll ── */
  .clients-panel,
  .product-groups-panel,
  .orders-panel,
  .scan-sessions-table-wrap,
  .credits-history-table-wrap,
  .credits-history-panel,
  .audit-list,
  .todo-table-wrap,
  .api-keys-table-wrap,
  .api-limits-table {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure all tables have a minimum width so they scroll rather than squash */
  .clients-panel table,
  .product-groups-panel table,
  .orders-panel table,
  .scan-sessions-table,
  .credits-history-table,
  .audit-list table,
  .todo-table,
  .api-keys-table {
    min-width: 600px;
  }

  /* ── Hide desktop sidebar wallet (accessible via profile panel) ── */
  .wallet-card { display: none; }

}

@media (max-width: 480px) {
  .main { padding: 12px !important; }
  .panel { padding: 14px !important; }
}

@media (max-width: 768px) {

  /* Drawer: push content below mobile top bar */
  .side-drawer {
    padding-top: 60px !important;
  }

  /* Drawer close button: ensure it's visible below top bar */
  .drawer-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--panel, #fff);
  }

  /* Drawer footer: clear the bottom nav */
  .drawer-footer,
  .form-actions,
  .od-stage-footer,
  .scan-step-footer,
  .sw-footer,
  .qc-save-row {
    padding-bottom: calc(16px + 64px + env(safe-area-inset-bottom)) !important;
  }

  /* Ensure drawer body doesn't get clipped by bottom nav */
  .side-drawer .drawer-body,
  .side-drawer .od-stage-panel,
  .side-drawer .scan-step-body,
  .side-drawer .sw-body,
  .side-drawer .help-drawer-body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
  }

  /* Hide global mobile chrome whenever a side drawer is open. Best-practice
     full-screen modal pattern: the drawer becomes the focal task, the X
     close button is the canonical exit, and the user can't accidentally
     tap a different tab and lose unsaved work. Affected on mobile only:
       - .mobile-top-bar       (logo + profile avatar at the top)
       - .mobile-fab-area      (floating + button bottom-right)
       - .mobile-nav-toggle    (bottom tab bar: Dashboard / Customers / etc.)
     :has() selector removes the DOM-order dependency that broke earlier
     attempts (FAB sat before drawers in the DOM, sibling combinator
     never matched). */
  body:has(aside.side-drawer:not(.hidden)) .mobile-top-bar,
  body:has(aside.side-drawer:not(.hidden)) .mobile-fab-area,
  body:has(aside.side-drawer:not(.hidden)) .mobile-nav-toggle,
  /* Phase B — extend the same chrome-hide rule to the Full Capture stepper
     so opening the new-order flow gives the user the same focused full-screen
     surface they get from the Edit drawer. */
  body:has(aside.full-capture-stepper:not(.hidden)) .mobile-top-bar,
  body:has(aside.full-capture-stepper:not(.hidden)) .mobile-fab-area,
  body:has(aside.full-capture-stepper:not(.hidden)) .mobile-nav-toggle {
    display: none !important;
  }

}

/* ══════════════════════════════════════════════════════════════════════════════
   QUICK ADD ORDER WIDGET
   Append to responsive.css (or components.css — either works)
   ══════════════════════════════════════════════════════════════════════════════ */

.quick-add-panel {
  position: relative;
  overflow: visible;
}

.qa-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Step dots */
.qa-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-top: 4px;
  flex-shrink: 0;
}

.qa-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line, rgba(0,0,0,0.1));
  transition: background 0.2s, transform 0.2s;
}

.qa-dot--active {
  background: var(--teal, #0e6055);
  transform: scale(1.3);
}

.qa-dot--done {
  background: var(--highlight, #2d9e6b);
}

/* Step hint */
.qa-step-hint {
  font-size: 0.78rem;
  margin-top: 2px;
  transition: opacity 0.2s;
}

/* Steps */
.qa-step {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-step.hidden { display: none; }

/* Input */
.qa-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--line, rgba(0,0,0,0.1));
  border-radius: 12px;
  background: var(--bg, #fff);
  color: var(--text, #1c2a2b);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.qa-input:focus {
  border-color: var(--teal, #0e6055);
  box-shadow: 0 0 0 3px rgba(14,96,85,0.1);
}

/* Search results dropdown */
.qa-search-wrap {
  position: relative;
}

.qa-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--panel, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(28,42,43,0.12);
  z-index: 50;
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
}

.qa-results.hidden { display: none; }

.qa-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.qa-result-item:hover,
.qa-result-item:focus { background: rgba(14,96,85,0.06); outline: none; }

.qa-result-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(14,96,85,0.12);
  color: var(--teal, #0e6055);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.qa-result-info { flex: 1; min-width: 0; }
.qa-result-name { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text); }
.qa-result-sub  { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 1px; }

.qa-result-new {
  color: var(--teal, #0e6055);
  font-style: italic;
  background: rgba(14,96,85,0.04);
}

/* New customer fields */
.qa-new-customer { display: flex; flex-direction: column; gap: 8px; }
.qa-new-customer.hidden { display: none; }
.qa-new-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

/* Field hint */
.qa-field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

/* Quick Add — field label / required marker / radio group / error highlight.
   Added for Fix #2 (Title + Barcode/ISBN inputs share a step) and
   Fix #4 (new-customer contact step with preferred-method radios). */
.qa-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 8px 0 4px;
  display: block;
}
.qa-step .qa-field-label:first-child { margin-top: 0; }

.qa-req {
  color: var(--accent, #0e6055);
  margin-left: 2px;
}

.qa-radio-row {
  display: flex;
  gap: 10px;
  margin: 4px 0 0;
}
.qa-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(14, 96, 85, 0.18);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.qa-radio:hover { background: rgba(14, 96, 85, 0.08); }
.qa-radio input[type="radio"] {
  accent-color: var(--accent, #0e6055);
  margin: 0;
}
.qa-radio:has(input[type="radio"]:checked) {
  background: rgba(14, 96, 85, 0.08);
  border-color: var(--accent, #0e6055);
}

.input-error {
  border-color: var(--warn, #ab3b2d) !important;
  box-shadow: 0 0 0 3px rgba(171, 59, 45, 0.12) !important;
}

/* Confirm card */
.qa-confirm-card {
  background: rgba(14,96,85,0.04);
  border: 1px solid rgba(14,96,85,0.15);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.875rem;
}

.qa-confirm-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.qa-confirm-value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* Success */
.qa-success-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 8px;
  text-align: center;
  color: var(--highlight, #2d9e6b);
}

.qa-success-inner strong {
  font-size: 1rem;
  font-weight: 700;
}

/* Footer */
.qa-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.qa-next-btn { min-width: 100px; }

/* ── Mobile full-screen quick add ─────────────────────────────────────────── */

.mobile-quick-add-screen {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: var(--cream, #ffffff);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
}

.mobile-quick-add-screen:not(.hidden) {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}

.mobile-quick-add-screen.hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
}

.mobile-qa-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  padding-top: calc(16px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong, #fff);
  flex-shrink: 0;
}

.mobile-qa-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cream, #ffffff);
  border: none;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-qa-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.mobile-qa-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mobile-qa-body {
  flex: 1;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.mobile-qa-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.mobile-qa-big-input {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 500;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--panel, #fff);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mobile-qa-big-input:focus {
  border-color: var(--teal, #0e6055);
  box-shadow: 0 0 0 3px rgba(14,96,85,0.1);
}

.mobile-qa-footer {
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel-strong, #fff);
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.mobile-qa-footer .primary-button {
  flex: 1;
  padding: 15px;
  font-size: 1rem;
  border-radius: 12px;
}

.mobile-qa-footer .ghost-button {
  padding: 15px 20px;
  border-radius: 12px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE BUG FIXES
   Four scoped mobile-only corrections. Do not affect desktop (>= 768px).
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Fix #1: Quick Add Order widget first on the dashboard ─────────────────
     On mobile the dashboard is a single-column grid; promote the management
     stack (which contains the Quick Add panel) above the Order Actions column
     by giving it a lower grid order. Desktop layout is a 2-column grid and
     is unaffected because the left column sits in its own grid cell. */
  .dashboard-management-stack {
    order: -1;
  }
  .dashboard-left-col {
    order: 0;
  }

  /* ── Fix #2: Remove blank empty column at the right of the Customers table ─
     styles.css hides `th/td:nth-child(4)` and `th/td:nth-child(6)` at
     max-width 720px. Because the Customers table uses `table-layout: fixed`
     with a <colgroup>, the `.col-pending` and `.col-actions` widths stay
     reserved even when the cells are display:none, producing blank columns
     (most noticeably at the right end). Re-display those cells for the
     Customers directory table and the Orders table (Days Open + Actions
     fall on the same nth-child positions) so they fill their reserved
     widths. */
  .clients-panel .directory-table th:nth-child(4),
  .clients-panel .directory-table th:nth-child(6),
  .clients-panel .directory-table td:nth-child(4),
  .clients-panel .directory-table td:nth-child(6),
  #orders-view table th:nth-child(4),
  #orders-view table th:nth-child(6),
  #orders-view table td:nth-child(4),
  #orders-view table td:nth-child(6) {
    display: table-cell;
  }

  /* ── Fix #3: Ensure the bottom action button clears the mobile nav bar ─────
     Several side-drawers wrap their form (and bottom action row) in
     `.drawer-form`, which was not in the existing padding-bottom rule, so the
     final button sits beneath the fixed bottom nav on mobile. Add padding so
     the last button always clears the nav bar + safe-area inset. */
  .side-drawer .drawer-form {
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
  }

  /* ── Fix #4: Mobile profile menu covers full screen (including top bar) ────
     The profile sheet was anchored to the bottom at max-height 92vh, leaving
     the mobile top bar visible above it. Extend the sheet to the full
     viewport and raise the panel above the top bar (z-index: 200) so it is
     truly full-screen on mobile. Desktop is unaffected — this menu is only
     shown below 768px. */
  .mobile-profile-panel {
    z-index: 500;
  }
  .mobile-profile-sheet {
    top: 0;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE TABLE & PANEL REFACTOR — four scoped fixes for narrow-viewport bugs
   that surfaced from real-device testing. None of these affect desktop.
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Fix #1: Tables overflow horizontally instead of squishing columns ────
     The customers directory table was set to `table-layout: fixed; width:100%`
     so on phones it tried to fit six columns into ~360px and the Email value
     would visually crash into Phone. We now wrap it in a scroll container,
     give the table a sensible min-width so its columns keep breathing room,
     and force the email cell to stay on a single line with ellipsis so row
     heights stay uniform. The user can swipe horizontally to see Phone /
     Pending / Actions if the table is wider than the screen. */
  .clients-panel #customers-list-view {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .clients-panel .directory-table {
    /* table-layout auto on mobile so per-column min-widths can take effect */
    table-layout: auto;
    min-width: 720px;
  }
  .clients-panel .directory-table .col-customer { min-width: 180px; }
  .clients-panel .directory-table .col-email    { min-width: 200px; }
  .clients-panel .directory-table .col-phone    { min-width: 120px; }
  .clients-panel .directory-table .col-pending  { min-width: 90px;  }
  .clients-panel .directory-table .col-consent  { min-width: 110px; }
  .clients-panel .directory-table .col-actions  { min-width: 100px; }

  /* Belt-and-braces: keep email on one line so wrapping never re-introduces
     the collision pattern. The customer-email-text span already has
     ellipsis truncation; this rule applies the same to the cell itself
     when there's no wrapper (e.g. legacy rendering paths). */
  .clients-panel .directory-table td:nth-child(2) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
  }

  /* ── Fix #2: Section heading was floating in mid-air above the panel ──────
     `.section-heading` had a 16px margin-bottom and was a sibling of the
     white `.panel` card, which on mobile read as two disconnected boxes.
     Unify them: drop the gap, give the heading the same surface color, and
     pin the heading to full width so it visually joins the panel below it. */
  .section-heading {
    width: 100%;
    margin: 0;
    padding: 16px 16px 8px;
    background: var(--panel, #ffffff);
    border-radius: 14px 14px 0 0;
    box-sizing: border-box;
  }
  /* Remove the gap between heading and panel on mobile only — the visual
     join makes the surface continuous. */
  .section-heading + .panel,
  .section-heading + .panel.clients-panel,
  .section-heading + .panel.dashboard-management-stack {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  /* ── Fix #3: Order drawer footer Save/Cancel must clear the gesture bar ──
     The existing rule pads the form's bottom but the order drawer uses a
     SEPARATE fixed footer (`.order-drawer-footer`), not part of `.drawer-form`.
     Pad it with safe-area-inset-bottom + a 32px buffer so the buttons
     always sit above the iOS/Android home indicator and the bottom nav. */
  #order-drawer .order-drawer-footer,
  .side-drawer .order-drawer-footer {
    padding-bottom: calc(32px + 64px + env(safe-area-inset-bottom)) !important;
  }
  /* Also lift any drawer's last action row clear of the safe area. The
     existing 80px rule covers the drawer-form scroll padding; this covers
     standalone drawer-actions blocks (e.g. customer drawer footer). */
  .side-drawer .drawer-actions:last-child {
    margin-bottom: calc(env(safe-area-inset-bottom) + 8px);
  }

  /* ── Fix #4: Muted subheaders failed mobile WCAG AA on white background ──
     #5f6d69 on #ffffff is ~4.6:1 — passes desktop but borderline on glare-
     prone phone screens. Bump to a noticeably darker grey for mobile only,
     which lifts the contrast to ~7.5:1 (AAA territory) for the small
     "3 customers in your directory" / "Pending — send reminder" labels. */
  :root {
    --muted: #3f4847;
  }

  /* ── Fix #5: Scan Sessions table — same horizontal-scroll treatment as
     the customers directory table. The Scan Delivery view's history grid
     has 7 columns (Started By / Started / Items / Orders Matched / Status
     / Last Updated / Actions) which never fit on a phone. Wrap it in a
     scroll container with a sensible min-width so columns keep breathing
     room and the user can swipe sideways to reach later columns. */
  #scan-sessions-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scan-sessions-table {
    table-layout: auto;
    min-width: 760px;
  }
  /* Per-column min-widths (none of the columns have explicit classes today,
     so target by nth-child to give each one room without squishing). */
  .scan-sessions-table th:nth-child(1),
  .scan-sessions-table td:nth-child(1) { min-width: 140px; }   /* Started By */
  .scan-sessions-table th:nth-child(2),
  .scan-sessions-table td:nth-child(2) { min-width: 130px; }   /* Started */
  .scan-sessions-table th:nth-child(3),
  .scan-sessions-table td:nth-child(3) { min-width: 110px; }   /* Items Scanned */
  .scan-sessions-table th:nth-child(4),
  .scan-sessions-table td:nth-child(4) { min-width: 130px; }   /* Orders Matched */
  .scan-sessions-table th:nth-child(5),
  .scan-sessions-table td:nth-child(5) { min-width: 110px; }
  .scan-sessions-table th:nth-child(6),
  .scan-sessions-table td:nth-child(6) { min-width: 140px; }
  .scan-sessions-table th:nth-child(7),
  .scan-sessions-table td:nth-child(7) { min-width: 100px; }
}

@media (max-width: 768px) {
  /* Phase A — Add Item Manually row: stack vertically so the four inputs
     (barcode, item name, qty, button) get full width each, otherwise the
     placeholder text in barcode/item-name gets clipped at narrow widths.
     The .intake-qty + button pair is allowed to share a row at the
     bottom because they're both short. */
  #order-manual-intake.manual-intake-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  #order-manual-intake.manual-intake-row input#manual-barcode,
  #order-manual-intake.manual-intake-row input#manual-name {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }
  #order-manual-intake.manual-intake-row input.intake-qty {
    flex: 0 0 80px;
  }
  #order-manual-intake.manual-intake-row .secondary-button {
    flex: 1 1 auto;
    min-width: 88px;
  }
}
