* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2129;
  --bg-card: #1c2129;
  --border: #30363d;
  --border-subtle: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-heading: #f0f6fc;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
  --orange: #db6d28;
  --purple: #a371f7;
  --tab-height: 56px;
  --top-bar-height: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.screen { display: none; height: 100%; }
.screen.active { display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ===== LOGIN ===== */
.login-container {
  margin: auto;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
}
.login-container h1 {
  text-align: center;
  font-size: 24px;
  color: var(--text-heading);
  margin-bottom: 32px;
}
#login-form input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}
#login-form input:focus { border-color: var(--accent); }
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:active { opacity: 0.8; }
.error-msg { color: var(--red); text-align: center; margin-top: 12px; font-size: 13px; }

/* ===== TOP BAR ===== */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--top-bar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.top-bar-logo { height: 24px; width: 24px; object-fit: contain; }
#top-bar h2 { font-size: 16px; color: var(--text-heading); position: absolute; left: 50%; transform: translateX(-50%); }
#top-bar { position: relative; }
.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.icon-btn:active { background: var(--bg-tertiary); }

/* ===== VIEWS ===== */
.view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.view.active { display: flex; }

/* ===== FILTERS BAR ===== */
.filters-bar {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.store-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.store-filters .store-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.store-filters .store-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
#order-search, #product-search, #coupons-search, #customers-search {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
#order-search:focus, #product-search:focus, #coupons-search:focus, #customers-search:focus { border-color: var(--accent); }

/* ===== CARD LIST ===== */
.ptr-indicator {
  text-align: center;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  transition: max-height 0.2s, padding 0.2s;
}
.ptr-indicator.visible {
  max-height: 40px;
  padding: 10px 0;
}
.ptr-indicator.refreshing {
  max-height: 40px;
  padding: 10px 0;
}

.card-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
}

/* ===== ORDER CARDS ===== */
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.order-card:active { background: var(--bg-tertiary); }
.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.order-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.order-date { color: var(--text-secondary); font-size: 12px; }
.order-number { font-weight: 600; font-size: 14px; }
.order-store {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.order-store.CW { background: #1a6fa8; }
.order-store.WDK { background: #1e7e4a; }
.order-store.WDL { background: #b45309; }
.order-store.YE { background: #6d28d9; }
.order-store.YEW { background: #be185d; }
.order-total { font-weight: 600; font-size: 14px; }
.order-card-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.order-customer { color: var(--text-secondary); font-size: 13px; }
.note-indicator {
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
}
.order-note-icon {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  margin: -8px -4px;
}
.order-note-icon svg {
  vertical-align: middle;
}

/* Note popup */
.note-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.note-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 340px;
  width: 100%;
}
.note-popup-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
}
.note-popup-body {
  font-size: 14px;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.status-badge.on-hold { background: #58a6ff; color: #000; }
.status-badge.processing { background: #d29922; color: #000; }
.status-badge.completed { background: #2ea043; color: #fff; }
.status-badge.cancelled { background: #da3633; color: #fff; }
.status-badge.refunded { background: #8b8fa3; color: #000; }
.status-badge.shipped { background: var(--purple); color: #fff; }
.status-badge.driver-assigned { background: var(--orange); color: #000; }
.status-badge.out-for-delivery { background: var(--orange); color: #000; }
.status-badge.failed { background: #da3633; color: #fff; }
.status-badge.pending { background: #484d56; color: #fff; }

/* ===== ORDER DETAIL ===== */
#order-detail-view {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  flex-shrink: 0;
}
#order-detail-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
}
.detail-section {
  margin-bottom: 16px;
}
.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.detail-row .label { color: var(--text-secondary); }
.detail-row .value { font-weight: 500; text-align: right; max-width: 60%; }
.address-link, .contact-link { color: var(--accent); text-decoration: none; }
.address-link:active, .contact-link:active { opacity: 0.7; }
.detail-items { margin-top: 4px; }
.detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-item:last-child { border-bottom: none; }
.detail-item img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.detail-item-info { flex: 1; min-width: 0; }
.detail-item-name { font-size: 13px; line-height: 1.3; }
.detail-item-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.detail-item-total { font-weight: 600; font-size: 13px; white-space: nowrap; }
.detail-status-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}
.detail-status-select,
.detail-driver-select {
  padding: 6px 6px 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  padding-right: 20px;
}

/* ===== PRODUCT CARDS ===== */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.product-card.parent-card {
  cursor: pointer;
}
.product-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-card-top img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.product-card-info { flex: 1; min-width: 0; }
.product-card-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-card-stores {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.product-card-stores .store-dot {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  color: #fff;
}
.store-dot.CW { background: #1a6fa8; }
.store-dot.WDK { background: #1e7e4a; }
.store-dot.WDL { background: #b45309; }
.store-dot.YE { background: #6d28d9; }
.store-dot.YEW { background: #be185d; }

.product-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.field-group {
  display: flex;
  flex-direction: column;
}
.field-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.field-value {
  font-size: 13px;
  font-weight: 500;
}
.field-input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.field-input:focus { border-color: var(--accent); }

/* Weight stock fields */
.weight-stock-fields {
  display: flex;
  gap: 4px;
  align-items: center;
}
.weight-stock-fields input {
  width: 50px;
  padding: 6px 4px;
  text-align: center;
}
.weight-stock-fields .unit {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Variation cards */
.variation-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0 4px 16px;
  border-left: 3px solid var(--border);
}
.variation-card .product-card-name {
  font-size: 12px;
  color: var(--text-secondary);
}
.variation-card .product-card-fields {
  margin-top: 6px;
}
.variations-container { display: none; }
.variations-container.open { display: block; }
.expand-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
}

/* ===== LOAD MORE ===== */
.load-more {
  padding: 12px;
  text-align: center;
}
.btn-secondary {
  padding: 10px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

/* ===== BOTTOM TABS ===== */
#bottom-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  height: var(--tab-height);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}
.tab.active { color: var(--accent); }
.tab-icon { display: flex; align-items: center; justify-content: center; }
.tab-label { font-weight: 600; }

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  white-space: nowrap;
}
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== PERIOD BUTTONS ===== */
.period-buttons {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.period-btn {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.period-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.custom-date-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0 0;
}
.custom-date-row input[type="date"] {
  flex: 1;
  padding: 6px 10px;
  height: 32px;
  min-height: 32px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 12px;
  box-sizing: border-box;
}
.custom-date-row input[type="date"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
.custom-date-row input[type="date"]::-webkit-inner-spin-button { display: none; -webkit-appearance: none; }
.custom-date-row input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.custom-date-row input[type="date"] { -webkit-appearance: none; appearance: none; }
.date-sep { color: var(--text-secondary); font-size: 11px; }
.date-go-btn {
  padding: 6px 12px;
  height: 32px;
  min-height: 32px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-sizing: border-box;
}

/* ===== ANALYTICS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 10px;
}
.kpi-card.wide { grid-column: span 2; }
.kpi-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 2px; }
.kpi-value { font-size: 17px; font-weight: 700; color: var(--text-heading); }
.kpi-value.green { color: var(--green); }
.kpi-value.red { color: var(--red); }

.analytics-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 8px;
}

/* Swipeable islands */
.islands-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 8px;
}
.islands-container::-webkit-scrollbar { display: none; }
.island {
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: start;
  padding: 0 2px;
  box-sizing: border-box;
}
.island-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 8px;
}
.island-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}
.island-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.island-dot.active { background: var(--accent); }

/* Mobile analytics table */
.m-analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}
.m-analytics-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.m-analytics-table td {
  padding: 7px 8px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.m-analytics-table tr:last-child td { border-bottom: none; }
.m-analytics-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.m-cat-section { margin-bottom: 12px; }
.m-cat-section:last-child { margin-bottom: 0; }
.m-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}
.m-cat-total { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.m-expandable { cursor: pointer; }
.m-expandable td:first-child { color: var(--accent); }
.m-expandable.expanded td:first-child { opacity: 0.8; }
.m-child-row { display: none; }
.m-child-row.visible { display: table-row; }
.m-child-row td { font-size: 11px !important; padding-top: 4px !important; padding-bottom: 4px !important; }

/* Payment list */
.payment-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.payment-list-item:last-child { border-bottom: none; }
.payment-method-name { color: var(--text-secondary); }
.payment-method-val { font-weight: 600; }

/* ===== COUPON CARDS ===== */
.coupon-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: pointer;
}
.coupon-card:active { background: var(--bg-tertiary); }
.coupon-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.coupon-code { font-weight: 700; font-size: 15px; font-family: monospace; letter-spacing: 0.5px; }
.coupon-type-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.coupon-card-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.coupon-usage { color: var(--text-secondary); }
.coupon-expiry { color: var(--text-secondary); }
.coupon-expiry.expired { color: var(--red); }
.coupon-status-draft { opacity: 0.5; }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:active { opacity: 0.8; }

/* Coupon form */
.coupon-form { padding: 12px 16px; }
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { min-height: 60px; resize: vertical; font-family: inherit; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.form-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.toggle-switch {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--accent); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.toggle-switch.on::after { transform: translateX(20px); }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn-save {
  flex: 1;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-save:active { opacity: 0.8; }
.btn-delete {
  padding: 12px 16px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-delete:active { opacity: 0.8; }

/* ===== CUSTOMER CARDS ===== */
.customer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: pointer;
}
.customer-card:active { background: var(--bg-tertiary); }
.customer-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.customer-name { font-weight: 600; font-size: 14px; }
.customer-spent { font-weight: 600; color: var(--green); font-size: 14px; }
.customer-card-bot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Order Edit Mode */
.edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.edit-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}
.edit-cancel-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 6px 12px;
  cursor: pointer;
}
.edit-save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
}
.edit-save-btn:disabled {
  opacity: 0.5;
}
.edit-order-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: auto;
}
.edit-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 6px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.edit-input:focus {
  border-color: var(--accent);
  outline: none;
}
.edit-select {
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.edit-textarea {
  min-height: 60px;
  resize: vertical;
  font-family: inherit;
}
.edit-field-row {
  display: flex;
  gap: 6px;
}
.edit-field-row .edit-input {
  flex: 1;
  min-width: 0;
}
.edit-field-label-wrap {
  flex: 1;
}
.edit-field-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  display: block;
}
.edit-product-search-wrap {
  position: relative;
  margin-bottom: 8px;
}
.edit-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.edit-search-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.edit-search-item:last-child { border-bottom: none; }
.edit-search-item:active { background: var(--bg-tertiary); }
.edit-search-info {
  min-width: 0;
}
.edit-search-name {
  font-size: 13px;
  line-height: 1.3;
  word-break: break-word;
}
.edit-search-var {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
  margin-top: 2px;
}
.edit-search-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.edit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.edit-item:last-child { border-bottom: none; }
.edit-item-info {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}
.edit-item-name {
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-item-price {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.edit-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.edit-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.edit-qty-btn:active { background: var(--border); }
.edit-qty-val {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}
.edit-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--red);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
}
.edit-remove-btn:active { opacity: 0.6; }
.edit-totals {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}
.edit-copy-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  cursor: pointer;
}
.edit-copy-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
