/* ================================================================
   Ascot London OMS — Design System
   Dark sidebar (#1a1a18) · Cream bg (#f5f2ec) · Gold (#b8975a)
   Fonts: Cormorant Garamond + DM Mono
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --sidebar-bg: #1a1a18;
  --sidebar-w: 240px;
  --cream: #f5f2ec;
  --cream-dark: #ece8e0;
  --gold: #b8975a;
  --gold-light: #d4b07a;
  --text: #1a1a18;
  --text-muted: #6b6b66;
  --border: #e0dbd0;
  --white: #ffffff;
  --red: #c0392b;
  --red-light: #fef2f2;
  --green: #27ae60;
  --green-light: #f0fdf4;
  --blue: #2980b9;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .07);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .10);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: .18s ease;
  /* System UI font stack — SF Pro on Apple, Segoe on Windows */
  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
}

html {
  font-size: 15px;
}

body {
  font-family: var(--font-ui);
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ── Layout ───────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 28px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: #f5f2ec;
  letter-spacing: .05em;
}

.brand-sub {
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255, 255, 255, .6);
  font-size: .78rem;
  letter-spacing: .06em;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  color: #f5f2ec;
  background: rgba(255, 255, 255, .05);
}

.nav-item.active {
  color: var(--gold);
  background: rgba(184, 151, 90, .12);
  border-left: 3px solid var(--gold);
}

.nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.nav-label {
  flex: 1;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 8px 0;
}

.nav-logout {
  color: rgba(255, 255, 255, .4);
}

.nav-logout:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, .08);
}

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 32px 36px;
  flex: 1;
  min-width: 0;
}

/* ── Mobile header ────────────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 99;
}

.menu-toggle {
  background: none;
  border: none;
  color: #f5f2ec;
  font-size: 1.3rem;
  cursor: pointer;
}

.mobile-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #f5f2ec;
  letter-spacing: .04em;
}

/* ── Page header ──────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.page-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Stats bar ────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Toolbar ──────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-family: var(--font-ui);
  font-size: .72rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.chip.active {
  background: var(--text);
  color: var(--cream);
  border-color: var(--text);
}

.search-input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: .82rem;
  background: var(--white);
  outline: none;
  min-width: 220px;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--gold);
}

/* ── Bulk action bar ──────────────────────────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--sidebar-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--cream);
}

/* ── Table ────────────────────────────────────────────────────── */
.table-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.data-table thead tr {
  background: var(--cream-dark);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0ede7;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #faf8f4;
}

/* Variant pills */
.pill {
  display: inline-block;
  background: var(--cream-dark);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  margin: 1px;
  white-space: nowrap;
}

.pill-gold {
  background: rgba(184, 151, 90, .15);
  color: var(--gold);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .68rem;
  letter-spacing: .05em;
  white-space: nowrap;
  font-weight: 500;
}

.badge-placed {
  background: #eef2ff;
  color: #4f46e5;
}

.badge-packed {
  background: #fefce8;
  color: #854d0e;
}

.badge-transit {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge-delivered {
  background: var(--green-light);
  color: var(--green);
}

.badge-cancelled {
  background: var(--red-light);
  color: var(--red);
}

/* Inline status select */
.status-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  background: var(--white);
  cursor: pointer;
  outline: none;
  max-width: 180px;
}

/* Row action buttons */
.action-btns {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  font-size: .8rem;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-icon:hover {
  background: var(--cream-dark);
  color: var(--text);
}

.btn-icon.danger:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red);
}

.loading-row {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  letter-spacing: .06em;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: var(--cream);
}

.btn-primary:hover {
  background: #333;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-gold:hover {
  background: var(--gold-light);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--text);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
}

.btn-danger-outline:hover {
  background: var(--red-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--cream-dark);
  color: var(--text);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #a93226;
}

.btn-sm {
  padding: 6px 14px;
  font-size: .72rem;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Cards (packing, settings) ────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* ── Packing grid ─────────────────────────────────────────────── */
.packing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.pack-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.pack-card:hover {
  box-shadow: var(--shadow-md);
}

.pack-card-head {
  padding: 14px 18px;
  background: var(--cream-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.pack-order-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
}

.pack-card-body {
  padding: 14px 18px;
}

.pack-address {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Progress bar */
.prog-wrap {
  margin-bottom: 14px;
}

.prog-track {
  background: var(--cream-dark);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.prog-fill {
  background: var(--gold);
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease;
}

.prog-label {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.prog-complete .prog-fill {
  background: var(--green);
}

/* Packing item checklist */
.pack-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0ede7;
  font-size: .8rem;
  cursor: pointer;
  transition: opacity var(--transition);
}

.pack-item:last-child {
  border-bottom: none;
}

.pack-item.done {
  opacity: .45;
  text-decoration: line-through;
}

.pack-check {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

.pack-card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Dispatch workflow checklist ─────────────────────────────── */
.workflow-strip {
  padding: 10px 18px 14px;
  background: #faf8f4;
  border-top: 1px dashed var(--border);
}

.wf-title {
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.wf-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.wf-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.wf-item:hover {
  border-color: var(--gold);
  background: #fffbf5;
}

.wf-item.wf-done {
  background: var(--green-light);
  border-color: #86efac;
  color: var(--green);
}

.wf-icon {
  font-size: .9rem;
  flex-shrink: 0;
  opacity: .35;
  transition: opacity var(--transition);
}

.wf-item.wf-done .wf-icon {
  opacity: 1;
}

.wf-label {
  font-size: .7rem;
  line-height: 1.3;
}

/* ── Progress bar (picklist top) ──────────────────────────────── */
.progress-bar-wrap {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-track {
  flex: 1;
  background: var(--cream-dark);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--gold);
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease;
}

.progress-label {
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Pick grid ────────────────────────────────────────────────── */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.pick-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.pick-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.pick-card.picked {
  border-color: var(--green);
  background: var(--green-light);
  opacity: .65;
}

.pick-qty {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  margin-bottom: 8px;
}

.pick-color {
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.pick-size {
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pick-orders {
  font-size: .65rem;
  color: var(--text-muted);
}

.pick-card.picked .pick-qty {
  color: var(--green);
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  max-width: 860px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-full {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: .85rem;
  background: var(--cream);
  outline: none;
  transition: border-color var(--transition);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  background: var(--white);
}

.form-group textarea {
  resize: vertical;
  min-height: 72px;
}

.form-group select {
  cursor: pointer;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Item rows */
.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 70px 36px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.item-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: .8rem;
  background: var(--cream);
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}

.item-row input:focus {
  border-color: var(--gold);
  background: var(--white);
}

.btn-remove-item {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-remove-item:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  margin-bottom: 18px;
}

.alert-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #fca5a5;
}

/* ── Toast ────────────────────────────────────────────────────── */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--sidebar-bg);
  color: var(--cream);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  max-width: 360px;
}

.toast.success {
  border-left: 3px solid var(--green);
}

.toast.error {
  border-left: 3px solid var(--red);
}

.toast.warning {
  border-left: 3px solid var(--gold);
}

@keyframes slideIn {
  from {
    transform: translateX(40px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 200;
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 32px;
  z-index: 201;
  min-width: 320px;
  max-width: 480px;
  box-shadow: var(--shadow-md);
}

.hidden {
  display: none !important;
}

/* ── Sync status card ─────────────────────────────────────────── */
.sync-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid;
}

.sync-ok {
  background: var(--green-light);
  border-color: #bbf7d0;
}

.sync-error {
  background: var(--red-light);
  border-color: #fca5a5;
}

.sync-status-icon {
  font-size: 1.4rem;
}

.sync-status-title {
  font-size: .82rem;
  font-weight: 500;
}

.sync-status-detail {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 72px 16px 24px;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .item-row {
    grid-template-columns: 1fr 80px 70px 36px;
  }

  .item-row .iProduct {
    grid-column: 1 / -2;
  }
}

@media (max-width: 480px) {
  .stats-bar {
    grid-template-columns: 1fr 1fr;
  }

  .pick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .packing-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.6rem;
  }

  .pick-qty {
    font-size: 2.4rem;
  }
}

/* ── Print ────────────────────────────────────────────────────── */
@media print {

  .sidebar,
  .mobile-header,
  .page-header .btn,
  .toolbar,
  .bulk-bar,
  .stats-bar,
  #toastContainer,
  #modalOverlay,
  #modalBox {
    display: none !important;
  }

  .main-content {
    margin: 0;
    padding: 0;
  }

  body {
    background: #fff;
  }
}

/* ── Customer cards ───────────────────────────────────────────── */
.cust-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.cust-card:hover {
  box-shadow: var(--shadow-md);
}

.cust-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.cust-header:hover {
  background: #faf8f4;
}

.cust-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--text);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: .04em;
}

.cust-info {
  flex: 1;
  min-width: 0;
}

.cust-name {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cust-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.cust-addr {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.cust-summary {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-shrink: 0;
}

.cust-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cust-sum-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.cust-sum-lbl {
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cust-toggle {
  font-size: .75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
  transition: color var(--transition);
}

.cust-header:hover .cust-toggle {
  color: var(--gold);
}

.cust-orders {
  border-top: 1px solid var(--border);
}

.cust-orders-list {
  padding: 0 20px 12px;
}

.cust-order-row {
  padding: 14px 0;
  border-bottom: 1px solid #f0ede7;
}

.cust-order-row:last-child {
  border-bottom: none;
}

/* Badge shorthand classes used in customers.js */
.b-placed {
  background: #eef2ff;
  color: #4f46e5;
  padding: 2px 8px;
  border-radius: 999px;
}

.b-packed {
  background: #fefce8;
  color: #854d0e;
  padding: 2px 8px;
  border-radius: 999px;
}

.b-transit {
  background: #eff6ff;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 999px;
}

.b-delivered {
  background: #f0fdf4;
  color: #166534;
  padding: 2px 8px;
  border-radius: 999px;
}

.b-cancelled {
  background: #fef2f2;
  color: #c0392b;
  padding: 2px 8px;
  border-radius: 999px;
}

@media (max-width: 700px) {
  .cust-summary {
    display: none;
  }

  .cust-addr {
    display: none;
  }
}

/* ── Customer table rows ──────────────────────────────────────── */
.cust-table-row {
  cursor: pointer;
  transition: background var(--transition);
}

.cust-table-row:hover {
  background: #faf8f4 !important;
}

.cust-row-open {
  background: #fdf9f4 !important;
  border-left: 3px solid var(--gold);
}