:root {
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Canvas & Neutral Surfaces */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  
  /* Brand & Status Accents */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-active: #064e3b;
  --primary-subtle: #ecfdf5;
  --primary-text: #065f46;
  --primary-border: #a7f3d0;
  
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-subtle: #f0f9ff;
  --accent-text: #0369a1;
  --accent-border: #bae6fd;
  
  --warning: #d97706;
  --warning-subtle: #fffbeb;
  --warning-text: #b45309;
  --warning-border: #fde68a;
  
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-subtle: #fef2f2;
  --danger-text: #b91c1c;
  --danger-border: #fecaca;
  
  --whatsapp: #10b981;
  --whatsapp-hover: #059669;
  --whatsapp-subtle: #ecfdf5;
  
  /* Pastel Card Palettes (Cute + Friendly SaaS) */
  --card-peach-bg: linear-gradient(145deg, #fff7f4 0%, #ffede7 100%);
  --card-peach-border: #fed7aa;
  --card-peach-text: #9a3412;
  --card-peach-badge: #ffedd5;
  
  --card-mint-bg: linear-gradient(145deg, #f0fdf5 0%, #e0f9eb 100%);
  --card-mint-border: #bbf7d0;
  --card-mint-text: #166534;
  --card-mint-badge: #dcfce7;
  
  --card-sky-bg: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
  --card-sky-border: #bae6fd;
  --card-sky-text: #075985;
  --card-sky-badge: #e0f2fe;
  
  --card-amber-bg: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
  --card-amber-border: #fde68a;
  --card-amber-text: #92400e;
  --card-amber-badge: #fef3c7;

  /* Sidebar Tokens */
  --sidebar-bg: #0f172a;
  --sidebar-active: #1e293b;
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #94a3b8;
  --sidebar-border: #1e293b;
  
  /* Shadows & Elevation */
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.04), 0 10px 24px -4px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 6px 16px -2px rgba(15, 23, 42, 0.06), 0 18px 36px -4px rgba(15, 23, 42, 0.08);
  --shadow-drawer: -12px 0 40px rgba(15, 23, 42, 0.14);
  --shadow-dock: 0 16px 36px -4px rgba(15, 23, 42, 0.35), 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-modal: 0 20px 48px -8px rgba(15, 23, 42, 0.22);
  
  /* Border Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-card: 20px;
  --radius-pill: 9999px;
  
  --transition-fast: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.provider-section { padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.provider-section:first-child { padding-top: 0; }
.provider-section h3 { margin: 0 0 12px; font-size: 16px; }
.provider-section .button { margin-top: 12px; }
.settings-advanced { margin: 16px 0; border: 1px solid var(--border-light); border-radius: 10px; padding: 12px; }
.settings-advanced summary { cursor: pointer; font-weight: 600; }
.settings-advanced[open] summary { margin-bottom: 14px; }
.saved-credential { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 5px; background: var(--primary-subtle); color: var(--primary-text); font-size: 10px; font-weight: 600; }
.pickup-mapping-row { display: grid; grid-template-columns: 1fr 1.2fr auto auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.pickup-mapping-row small { display: block; color: var(--text-muted); margin-top: 4px; }
@media(max-width:600px){.pickup-mapping-row{grid-template-columns:1fr auto}.pickup-mapping-row>div:nth-child(2){grid-column:1;grid-row:2}.pickup-mapping-row>.pill{grid-column:2;grid-row:1}.pickup-mapping-row>.button{grid-column:2;grid-row:2}}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TOP LOADING BAR
   ============================================================ */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #10b981, #0284c7, #f59e0b, #10b981);
  background-size: 250% 100%;
  animation: loadingAnim 1.4s infinite cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  box-shadow: 0 1px 6px rgba(16, 185, 129, 0.3);
}
@keyframes loadingAnim {
  0% { background-position: 250% 0; }
  100% { background-position: -250% 0; }
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, p {
  margin: 0 0 8px 0;
}
h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}
h2 {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--text-main);
}
h3 {
  font-size: 14px;
  font-weight: 700;
}
.eyebrow {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: inline-block;
}
.muted {
  color: var(--text-muted);
  font-size: 13px;
}
.wordmark {
  text-decoration: none;
  color: inherit;
  font-size: 19px;
  letter-spacing: 0.03em;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.wordmark-dot {
  color: #10b981;
}
.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}
.brand-icon span {
  font-size: 11px;
  margin-left: -1px;
}

/* ============================================================
   BUTTONS & CONTROLS
   ============================================================ */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}
button {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  user-select: none;
}
button:active:not(:disabled) {
  transform: scale(0.97);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button {
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  min-height: 40px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.button:hover:not(:disabled) {
  transform: translateY(-1.5px);
}

.button.primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.28);
}
.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.button.secondary {
  background: #ffffff;
  color: #334155;
  border-color: var(--border-light);
}
.button.secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: var(--border-subtle);
  color: var(--text-main);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.button.danger {
  background: var(--danger-subtle);
  color: var(--danger-text);
  border-color: var(--danger-border);
}
.button.danger:hover:not(:disabled) {
  background: #fee2e2;
  color: #991b1b;
}

.button.warning {
  background: var(--warning-subtle);
  color: var(--warning-text);
  border-color: var(--warning-border);
}
.button.warning:hover:not(:disabled) {
  background: #fef3c7;
}

.button.whatsapp {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.button.whatsapp:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.button.pill {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}

.button.small {
  padding: 6px 12px;
  min-height: 34px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.button.full {
  width: 100%;
}

.icon-button {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.icon-button:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}
.icon-button.refresh-btn:hover {
  transform: rotate(45deg);
}

.quiet-button {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.quiet-button:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.text-button {
  background: none;
  border: 0;
  padding: 4px 6px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: underline;
  cursor: pointer;
}
.text-button:hover {
  color: var(--primary-hover);
}

/* ============================================================
   STATUS BADGES / PILLS
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill::before {
  content: "";
  display: inline-block;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pill.green {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.pill.green::before {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: dotPulse 2s infinite ease-in-out;
}
.pill.amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.pill.amber::before {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
  animation: dotPulse 2s infinite ease-in-out;
}
.pill.red {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.pill.red::before {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.pill.blue {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}
.pill.blue::before {
  background: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}
.pill.gray {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
.pill.gray::before {
  background: #94a3b8;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.15); }
}

/* ============================================================
   NOTICES & TOASTS
   ============================================================ */
.notice {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 13.5px;
  font-weight: 550;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
  animation: slideDownToast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.notice.error {
  background: var(--danger-subtle);
  border-color: var(--danger-border);
  color: var(--danger-text);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.12);
}
.notice.info {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-text);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12);
}
.notice.warning {
  background: var(--warning-subtle);
  border-color: var(--warning-border);
  color: var(--warning-text);
}
@keyframes slideDownToast {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   APP SHELL & SIDEBAR
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  border-right: 1px solid var(--sidebar-border);
  z-index: 100;
  box-sizing: border-box;
}
.sidebar-top {
  margin-bottom: 24px;
}
.sidebar .wordmark {
  color: #ffffff;
  margin-bottom: 16px;
}
.workspace-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.workspace-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}
.workspace-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.workspace-info strong {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-info small {
  font-size: 11px;
  color: var(--sidebar-muted);
}
.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: dotPulse 2s infinite ease-in-out;
}

.nav-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  margin: 12px 0 8px 6px;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-list button {
  background: none;
  border: 1px solid transparent;
  color: var(--sidebar-muted);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  transition: var(--transition-fast);
}
.nav-list button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: translateX(2px);
}
.nav-list button.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.25) 100%);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.35);
  font-weight: 700;
}
.nav-icon {
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
}
.nav-list button.active .nav-icon {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-border);
}
.private-note {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.note-icon {
  font-size: 15px;
}
.private-note div {
  display: flex;
  flex-direction: column;
}
.private-note strong {
  font-size: 11.5px;
  color: #ffffff;
}
.private-note small {
  font-size: 10.5px;
  color: var(--sidebar-muted);
}
.account-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.account-button:hover {
  background: rgba(255, 255, 255, 0.09);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.account-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.account-details strong {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-details small {
  font-size: 10.5px;
  color: var(--sidebar-muted);
}
.account-dots {
  color: var(--sidebar-muted);
  font-size: 14px;
}

/* ============================================================
   MAIN SHELL & TOP BAR
   ============================================================ */
.main-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 32px;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-sizing: border-box;
  width: 100%;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1;
}
.crumb-root {
  color: var(--text-muted);
  font-weight: 550;
}
.crumb-sep {
  color: var(--border-subtle);
  font-weight: 400;
}
.crumb-active {
  color: var(--text-main);
  font-weight: 700;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
}
.date-badge {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.date-badge .date-icon {
  font-size: 14px;
}

main {
  padding: 24px 32px 48px;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.heading-text h1 {
  margin-bottom: 4px;
}

/* ============================================================
   OVERVIEW HERO & PROGRESS
   ============================================================ */
.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-card h2 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 6px;
}
.hero-card p {
  color: var(--text-muted);
  font-size: 13.5px;
  max-width: 620px;
  margin: 0;
}
.hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.overview-top-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.progress-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}
.progress-ring-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 14px 0;
}
.ring-gauge {
  width: 90px;
  height: 90px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ring-gauge svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
.ring-circle-bg {
  stroke: #e2e8f0;
}
.ring-circle-bar {
  stroke: #10b981;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.ring-number {
  position: absolute;
  font-size: 18px;
  font-weight: 850;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.ring-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ring-item {
  font-size: 12px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ring-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ring-dot.ready { background: #10b981; }
.ring-dot.pending { background: #f59e0b; }
.ring-dot.done { background: #0ea5e9; }

/* ============================================================
   PASTEL STAT CARDS
   ============================================================ */
.stats-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pastel-stat-card {
  border-radius: var(--radius-card);
  padding: 18px 20px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}
.pastel-stat-card:hover {
  transform: translateY(-2.5px);
  box-shadow: var(--shadow-hover);
}
.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.stat-card-top span {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stat-card-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}
.pastel-stat-card strong {
  font-size: 27px;
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 4px 0 2px;
}
.pastel-stat-card small {
  font-size: 11.5px;
  font-weight: 550;
  opacity: 0.85;
}

.pastel-stat-card.peach { background: var(--card-peach-bg); border-color: var(--card-peach-border); color: var(--card-peach-text); }
.pastel-stat-card.peach .stat-card-badge { background: var(--card-peach-badge); }
.pastel-stat-card.mint { background: var(--card-mint-bg); border-color: var(--card-mint-border); color: var(--card-mint-text); }
.pastel-stat-card.mint .stat-card-badge { background: var(--card-mint-badge); }
.pastel-stat-card.sky { background: var(--card-sky-bg); border-color: var(--card-sky-border); color: var(--card-sky-text); }
.pastel-stat-card.sky .stat-card-badge { background: var(--card-sky-badge); }
.pastel-stat-card.amber { background: var(--card-amber-bg); border-color: var(--card-amber-border); color: var(--card-amber-text); }
.pastel-stat-card.amber .stat-card-badge { background: var(--card-amber-badge); }

.stats-secondary-grid, .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}
.stat:hover {
  transform: translateY(-1.5px);
  border-color: var(--border-subtle);
}
.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-symbol {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-main);
}
.stat strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 2px;
}
.stat small {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   GRID COLUMNS & CARDS
   ============================================================ */
.grid-columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-top: 10px;
}
.card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}
.card-header h2 {
  font-size: 15px;
  margin: 0;
}
.card-header small {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.card-body {
  padding: 18px 22px;
}
.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.activity-row > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.activity-row p {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px 0;
}
.activity-row small {
  font-size: 11.5px;
  color: var(--text-muted);
}
.info-line {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin: 8px 0 0;
}

/* Empty State */
.empty {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.empty h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text-main);
}
.empty p {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 380px;
  margin-bottom: 8px;
}

/* ============================================================
   FILTER TABS & SEARCH
   ============================================================ */
.filter-tabs {
  display: inline-flex;
  align-items: center;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 2px;
  margin-bottom: 18px;
  max-width: 100%;
  overflow-x: auto;
}
.filter-tab {
  background: none;
  border: 0;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}
.filter-tab:hover {
  color: var(--text-main);
}
.filter-tab.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tools input[type="search"] {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 36px;
  font-size: 13.5px;
  width: 380px;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px 50%;
  background-size: 16px;
}
.tools input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ============================================================
   DATA TABLES (Desktop View)
   ============================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-card);
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 13px;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: var(--transition-fast);
}
tbody tr:hover {
  background: #f8fafc;
}
td strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}
td small {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.table-item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.table-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.table-item-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dim);
  flex-shrink: 0;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE "SHOW BESIDE" SIDE DRAWER
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  animation: fadeIn 0.2s ease-out;
}
.order-side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 540px;
  max-width: 95vw;
  background: #f8fafc;
  z-index: 210;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  animation: slideInDrawer 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid var(--border-light);
}
@keyframes slideInDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  box-sizing: border-box;
}
.drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-title-group h2 {
  font-size: 17px;
  font-weight: 750;
  margin: 0;
  color: var(--text-main);
  letter-spacing: -0.01em;
}
.drawer-title-group .eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.drawer-body {
  padding: 20px 22px 40px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}
.drawer-body > * {
  flex-shrink: 0 !important;
  min-height: min-content;
}
.order-side-drawer .card {
  flex-shrink: 0 !important;
  min-height: min-content;
  margin-bottom: 0;
}

/* Enhanced Drawer Cards */
.drawer-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0 !important;
  min-height: min-content;
}
.drawer-card-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}
.drawer-card-header h3 {
  font-size: 13.5px;
  font-weight: 750;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}
.drawer-card-header small {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.drawer-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-action-bar {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-action-bar > .button { flex:1 1 180px; min-width:0; white-space:normal; text-align:center; }
.drawer-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* ============================================================
   COURIER / TCS LOGISTICS ENHANCED TRACKER
   ============================================================ */
.courier-tracking-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0 !important;
  min-height: min-content;
}
.courier-card-header {
  padding: 15px 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.courier-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.courier-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #dc2626;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
  flex-shrink: 0;
}
.courier-brand h3 {
  font-size: 14.5px;
  font-weight: 750;
  margin: 0;
  color: var(--text-main);
  letter-spacing: -0.01em;
}
.courier-brand small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}

/* Stepper */
.tracking-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 18px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  gap: 6px;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 13px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
}
.step-item.step-done:not(:last-child)::after {
  background: var(--primary);
}
.step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
}
.step-item.step-done .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.step-item.step-active .step-circle {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}
.step-label-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.step-label-wrap strong {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}
.step-label-wrap small {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
}

/* CN Highlight Section */
.courier-cn-section {
  padding: 16px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cn-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  gap: 12px;
}
.cn-display-box small {
  display: block;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.cn-code {
  font-family: var(--font-mono);
  font-size: 15.5px;
  letter-spacing: 0.08em;
  color: var(--text-main);
  font-weight: 750;
}
.courier-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.courier-notice-box {
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  padding: 12px 14px;
  border-radius: 4px;
}
.courier-notice-box strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-main);
  margin-bottom: 3px;
}
.courier-notice-box p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Logistics Metadata Grid */
.courier-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 18px;
  background: #fafbfc;
}
.courier-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.courier-meta-item small {
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.courier-meta-item strong {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-main);
  word-break: break-word;
}

/* Hidden Orders Section in Settings */
.empty-hidden-box {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
}
.empty-hidden-box .empty-icon {
  font-size: 36px;
  color: #cbd5e1;
  margin-bottom: 10px;
}
.empty-hidden-box h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px;
}
.empty-hidden-box p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.5;
}
.hidden-orders-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

/* Timeline & Details */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}
.audit-timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: var(--border-light);
}
.timeline-item {
  position: relative;
}
.timeline-dot {
  position: absolute;
  top: 4px;
  left: -20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px #ecfdf5;
}
.timeline-content strong {
  display: block;
  font-size: 12.5px;
}
.timeline-content small {
  font-size: 11px;
  color: var(--text-muted);
}
.timeline-content p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-main);
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
}

/* ============================================================
   FORMS, FIELDS & MODALS
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
}
.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  outline: none;
}
.field small {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
  margin: 8px 0;
}
.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.detail-grid dt {
  color: var(--text-muted);
  font-weight: 600;
}
.detail-grid dd {
  color: var(--text-main);
  font-weight: 650;
  margin: 0;
  word-break: break-word;
}

.product-items-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.line-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.line-item-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.product-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
  flex-shrink: 0;
}
.line-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.line-item-info strong {
  font-size: 13.5px;
  color: var(--text-main);
}
.line-item-info span {
  font-size: 12px;
  color: var(--text-muted);
}

tr.active-row td {
  background: #ecfdf5 !important;
}

.pending-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fffbeb;
  color: #f59e0b;
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.receipt-preview {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-top: 10px;
  object-fit: contain;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

dialog {
  border: 0;
  padding: 0;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  background: #ffffff;
  max-width: 560px;
  width: 92vw;
  margin: auto;
}
dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
}
.modal-heading {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-heading h2 {
  font-size: 18px;
  margin: 0;
}
#modalBody {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-bottom-left-radius: var(--radius-card);
  border-bottom-right-radius: var(--radius-card);
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #ffffff;
}
.auth-story {
  background: #0f172a;
  color: #ffffff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-story .wordmark {
  color: #ffffff;
}
.story-body h1 {
  font-size: 38px;
  line-height: 1.15;
  color: #ffffff;
  margin: 18px 0;
}
.story-body em {
  color: #10b981;
  font-style: normal;
}
.flow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}
.flow span {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
}
.flow small {
  font-size: 10px;
  color: #94a3b8;
}
.auth-panel {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.auth-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1;
  background: none;
  border: 0;
  padding: 8px;
  font-weight: 650;
  color: var(--text-muted);
}
.auth-tabs button.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.mobile-dock {
  display: none;
}

/* ============================================================
   RESPONSIVE MOBILE OVERHAUL (Screens <= 768px)
   ============================================================ */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    padding: 12px 16px;
  }
  
  /* Generous bottom padding so floating dock NEVER covers content */
  main {
    padding: 16px 14px 110px;
  }
  
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }
  .page-heading .button-row {
    width: 100%;
  }
  .page-heading .button-row .button {
    width: 100%;
  }

  .hero-card {
    padding: 20px 16px;
    margin-bottom: 18px;
  }
  .hero-card h2 {
    font-size: 19px;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions .button {
    flex: 1;
    min-width: 130px;
  }

  /* Overview Stack */
  .overview-top-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
  }
  .progress-ring-wrap {
    justify-content: center;
  }

  /* 2x2 Grid for Pastel Stat Cards on Mobile */
  .stats-primary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .pastel-stat-card {
    padding: 14px;
    min-height: 108px;
    border-radius: 16px;
  }
  .pastel-stat-card strong {
    font-size: 24px;
  }

  /* 2x2 Grid for Secondary KPI Cards on Mobile */
  .stats-secondary-grid, .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }
  .stat {
    padding: 14px;
    border-radius: 16px;
  }
  .stat strong {
    font-size: 18px;
  }

  .grid-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Filter Tabs on Mobile: Smooth Horizontal Pill Scroll */
  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 4px;
  }
  .tools {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tools input[type="search"] {
    width: 100%;
  }

  /* ============================================================
     RESPONSIVE MOBILE ORDER CARDS (Eliminates Crammed Tables)
     ============================================================ */
  .table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .table-wrap table {
    display: block;
    width: 100%;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tbody {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .table-wrap tbody tr {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .table-wrap tbody tr:hover {
    background: #ffffff;
    box-shadow: var(--shadow-card);
  }
  .table-wrap tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border: 0;
    width: 100%;
  }
  
  /* Top card section: Thumbnail, Order # and Status Badge */
  .table-wrap tbody tr td.cell-order {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
  }
  .table-wrap tbody tr td.cell-order .table-item-cell {
    gap: 12px;
  }
  .table-wrap tbody tr td.cell-order .table-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .table-wrap tbody tr td.cell-order .order-meta-info strong {
    font-size: 15px;
    font-weight: 800;
  }

  .table-wrap tbody tr td.cell-customer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .table-wrap tbody tr td.cell-customer strong {
    font-size: 14px;
    font-weight: 750;
  }
  .table-wrap tbody tr td.cell-customer small {
    font-size: 12px;
    color: var(--text-muted);
  }

  .table-wrap tbody tr td.cell-shop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
  }

  .table-wrap tbody tr td.cell-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 2px;
  }
  .table-wrap tbody tr td.cell-amount strong {
    font-size: 16px;
    font-weight: 850;
  }

  .table-wrap tbody tr td.cell-status {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding-bottom: 2px;
  }

  /* Full-width touch-friendly actions row */
  .table-wrap tbody tr td.cell-actions {
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
  }
  .table-wrap tbody tr td.cell-actions .button-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .table-wrap tbody tr td.cell-actions .button {
    width: 100%;
    min-height: 42px;
    font-size: 13px;
    font-weight: 700;
  }

  /* Side Drawer Full Screen on Mobile */
  .order-side-drawer {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
  }
  .drawer-header {
    padding: 16px 18px;
  }
  .drawer-body {
    padding: 16px 14px 40px;
    gap: 14px;
  }

  /* Mobile Bottom Dock */
  .mobile-dock {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 420px;
    height: 62px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    z-index: 150;
    box-shadow: var(--shadow-dock);
  }
  .mobile-dock-btn {
    background: none;
    border: 0;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 750;
    transition: var(--transition-fast);
    min-width: 48px;
  }
  .mobile-dock-btn span:first-child {
    font-size: 18px;
    line-height: 1;
  }
  .mobile-dock-btn.active {
    background: rgba(16, 185, 129, 0.22);
    color: #10b981;
  }

  /* Auth on Mobile */
  .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-story {
    display: none;
  }
  .auth-panel {
    padding: 32px 18px;
  }
}
/* TCS account reporting is scoped separately from order and shop operations. */
.tcs-filters{display:grid;grid-template-columns:1fr 1fr 2fr auto;gap:16px;align-items:end;padding:20px;background:var(--surface,#fff);border:1px solid #e2e8f0;border-radius:16px;margin-bottom:18px}
.tcs-filters .field{margin:0}.tcs-filters .button{margin-bottom:2px;white-space:nowrap}
.tcs-warning{padding:14px 18px;border:1px solid #f5d18b;border-radius:12px;background:#fffbeb;color:#854d0e;font-size:13px;line-height:1.6;margin:12px 0}
.tcs-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:20px 0}
.tcs-metric{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:22px;display:flex;flex-direction:column;gap:10px}
.tcs-metric>strong{font-size:26px;color:#0f172a;letter-spacing:-.6px}.tcs-metric small{color:#64748b;font-size:12px}
.tcs-chart{padding:20px;display:grid;gap:14px}.tcs-chart-row{display:grid;grid-template-columns:190px minmax(80px,1fr) 140px 105px;align-items:center;gap:16px;font-size:12px}.tcs-chart-row strong{text-align:right;font-variant-numeric:tabular-nums}.tcs-chart-row small{color:#64748b;text-align:right}
.tcs-chart-track{background:#f1f5f9;height:12px;border-radius:8px;overflow:hidden}.tcs-chart-bar{height:100%;background:#0d9488;border-radius:8px;transition:width .2s}
.tcs-report-table{margin-top:20px}.tcs-report-table table{min-width:1900px}.tcs-report-table th{white-space:normal;min-width:110px}.tcs-report-table th:first-child{min-width:60px}.tcs-report-table td{vertical-align:middle}.tcs-report-table input[type=checkbox]{width:18px;height:18px;accent-color:#0d9488}
.tcs-amount{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.tcs-amount strong{display:block;font-size:13px}.tcs-amount small{display:block;font-size:11px;color:#64748b;margin-top:5px}.tcs-report-table tfoot{background:#eaf4f1;border-top:2px solid #99c9bc;font-weight:700}.tcs-report-table tfoot td,.tcs-report-table tfoot th{padding:18px 14px}.tcs-error-text{color:#b45309!important}.tcs-selection{margin-top:18px}
.tcs-articles{min-width:260px;max-width:340px;white-space:normal!important}.tcs-articles strong,.tcs-articles small{display:block}.tcs-articles small{line-height:1.5;margin-top:7px;color:#475569}.tcs-filters>.button:last-child{align-self:end}
.tcs-delivery{min-width:220px;white-space:normal!important}.tcs-delivery small{display:block;color:#64748b;font-size:11px;line-height:1.5;margin-top:7px}.tcs-report-table .cell-order{min-width:200px}.tcs-report-table .cell-order .button{display:block;width:max-content;margin-top:9px}.tcs-status-filter{max-width:400px;margin-top:18px}.tcs-filters .field:has(input[type=checkbox]){grid-column:1/-1}.tcs-report-table table{min-width:2350px}
.tcs-connection,.tcs-finance-details{padding:16px 20px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;margin:16px 0}.tcs-connection>summary,.tcs-finance-details>summary{font-weight:700;font-size:13px;cursor:pointer}.tcs-overview-table{margin:20px 0}.tcs-overview-table table{min-width:980px}.tcs-overview-table td{white-space:normal;vertical-align:top}.tcs-overview-table td:first-child{min-width:230px;max-width:300px}.tcs-order-summary small,.tcs-last-scan small{display:block;line-height:1.6;font-size:11px;color:#64748b;margin-top:8px}.tcs-overview-table .tcs-delivery{min-width:175px;max-width:220px}.tcs-overview-table .button-row{flex-direction:column;align-items:stretch}.tcs-overview-table .button{white-space:nowrap}.tcs-last-scan{min-width:165px;max-width:210px}.tcs-overview-table .check-label{gap:8px}.tcs-overview-table input[type=checkbox]{width:18px;height:18px;accent-color:#0d9488}
.tcs-finance-details{min-width:0;overflow:hidden}.tcs-finance-details>.tcs-report-table{max-width:100%;overflow:auto}
@media(max-width:1000px){.tcs-overview-table{overflow:visible;min-width:0}.tcs-overview-table table{min-width:0;width:100%;display:block}.tcs-overview-table thead{display:none}.tcs-overview-table tbody{display:grid;gap:16px}.tcs-overview-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr);width:100%;padding:18px;border:1px solid #e2e8f0;background:#fff;border-radius:16px;box-sizing:border-box}.tcs-overview-table tbody tr td{display:block!important;min-width:0!important;max-width:none!important;padding:10px 0!important;grid-column:1/-1!important;width:auto!important;border:none}.tcs-overview-table tbody tr td:nth-child(2)::before{content:'DELIVERY';display:block;font-size:10px;color:#64748b;letter-spacing:1px;margin-bottom:8px}.tcs-overview-table tbody tr td:nth-child(3)::before{content:'LAST TCS SCAN / LOCATION';display:block;font-size:10px;color:#64748b;letter-spacing:1px;margin-bottom:8px}.tcs-overview-table tbody tr td:nth-child(4)::before{content:'PAYMENT / NEXT STEP';display:block;font-size:10px;color:#64748b;letter-spacing:1px;margin-bottom:8px}.tcs-overview-table .button-row{flex-direction:row!important;flex-wrap:wrap}.tcs-overview-table .button-row>.button{flex:1}.tcs-report-table table{display:table!important;min-width:2350px!important}.tcs-report-table thead{display:table-header-group!important}.tcs-report-table tbody{display:table-row-group!important}.tcs-report-table tr{display:table-row!important}.tcs-report-table td,.tcs-report-table th{display:table-cell!important;padding:14px!important}.tcs-report-table tfoot{display:table-footer-group!important}}
@media(max-width:900px){.tcs-filters{grid-template-columns:1fr 1fr}.tcs-chart-row{grid-template-columns:150px 1fr 120px}.tcs-chart-row small{grid-column:3}.tcs-metrics{grid-template-columns:1fr}.tcs-metric{padding:18px}.tcs-metric>strong{font-size:24px}}
@media(max-width:520px){.tcs-filters{grid-template-columns:1fr;padding:16px}.tcs-chart{padding:16px}.tcs-chart-row{grid-template-columns:1fr 110px;gap:8px}.tcs-chart-track{grid-column:1;grid-row:auto}.tcs-chart-row strong{grid-column:2;grid-row:auto}.tcs-chart-row small{grid-column:2}.tcs-chart-row>span{grid-column:1/-1}}

/* Visible amounts and a compact mobile ledger. */
.tcs-status-metrics{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
.tcs-status-metrics .tcs-metric{padding:16px;gap:6px}
.tcs-review-note{font-size:12px;color:#64748b;margin:0 0 14px}
.tcs-money-totals,.tcs-row-money{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.tcs-money-totals{grid-template-columns:repeat(4,minmax(0,1fr));margin:14px 0}
.tcs-mini-amount{padding:9px 10px;border-radius:9px;background:#f3f7f6;border:1px solid #e2ebe7;min-width:0}
.tcs-mini-amount small,.tcs-mini-amount strong{display:block;margin:0;line-height:1.5}
.tcs-mini-amount small{font-size:10px;color:#64748b}.tcs-mini-amount strong{font-size:12px;font-variant-numeric:tabular-nums;color:#0f172a}
.tcs-row-money{margin-top:12px}.tcs-row-money .tcs-mini-amount{padding:6px}.tcs-row-money .tcs-mini-amount strong{font-size:11px}
.tcs-inline-fees{font-size:10px;line-height:1.6;margin-top:9px;color:#64748b}
.tcs-mobile-ledger,.tcs-mobile-ledger-help{display:none}
.mobile-menu-grid{display:grid;gap:10px}
.pickup-map{display:block;font-size:11px;color:#047857;margin-top:7px}
.assignment-stock-block{border:1px solid #e2e8e4;border-radius:12px;padding:12px;margin:12px 0}.assignment-stock-block h3{font-size:12px;line-height:1.6;margin-bottom:3px}
.assignment-stock-table{overflow:auto;max-width:100%;margin:8px 0}.assignment-stock-table table{width:100%;min-width:0;table-layout:fixed}.assignment-stock-table th:first-child{width:44%}.assignment-stock-table th,.assignment-stock-table td{white-space:normal!important;overflow-wrap:anywhere;font-size:11px;padding:9px 6px}.assignment-stock-table td small{font-size:9px;line-height:1.5;display:block}.assignment-stock-table td:not(:first-child),.assignment-stock-table th:not(:first-child){text-align:center}
@media(max-width:768px){.assignment-stock-block{padding:8px}.assignment-stock-table table{display:table!important;width:100%!important;min-width:0!important}.assignment-stock-table thead{display:table-header-group!important}.assignment-stock-table tbody{display:table-row-group!important}.assignment-stock-table tr{display:table-row!important;box-shadow:none!important;border-radius:0!important;padding:0!important;background:#fff!important}.assignment-stock-table tbody tr td,.assignment-stock-table th{display:table-cell!important;position:static!important;width:auto;min-width:0!important;padding:8px 3px!important;font-size:10px;white-space:normal!important;vertical-align:middle}.assignment-stock-table th{font-size:9px;background:#f4f8f6}.assignment-stock-table th:first-child{width:44%}.assignment-stock-table td strong{font-size:10px!important}.assignment-stock-table td small{font-size:8px!important}}
.tcs-order-link{border:0;background:none;padding:0;font:inherit;font-weight:750;color:#075d50;cursor:pointer;text-align:left}
@media(max-width:768px){
  html,body{max-width:100%;min-width:0}.app-shell{display:flex;flex-direction:column;min-width:0;width:100%;height:100vh;height:100dvh;min-height:0;overflow:hidden}.main-shell{width:100%;min-width:0;flex:1;min-height:0;overflow:hidden}
  .topbar{position:relative;top:auto;height:auto;min-height:0;max-height:none;display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:10px 12px;backdrop-filter:none}
  .breadcrumb{min-width:0;font-size:12px;line-height:1.3;gap:6px}.crumb-active{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .topbar-actions{width:100%;height:auto;display:flex;justify-content:flex-end;gap:8px}.date-badge{margin-right:auto;height:30px;padding:0 9px;font-size:10px;box-shadow:none}
  .topbar .icon-button{width:32px;min-width:32px;height:30px;min-height:30px;padding:0;font-size:15px}.topbar #logout{white-space:nowrap;flex-shrink:0;min-height:30px;height:30px;padding:0 9px;font-size:11px}.topbar #logout .btn-icon{display:none}
  main{padding:14px 10px calc(94px + env(safe-area-inset-bottom,0px));min-width:0;width:100%}
  .main-shell>.topbar{flex-shrink:0}.main-shell>main{min-height:0;overflow-y:auto;overflow-x:hidden;padding-bottom:20px;overscroll-behavior-y:contain}
  .page-heading{gap:10px;margin-bottom:14px}.heading-text{min-width:0}.heading-text h1{font-size:21px;line-height:1.3}.heading-text .muted{font-size:11px;line-height:1.6}.heading-text .eyebrow{font-size:9px}
  .page-heading .button-row{display:flex;gap:8px;flex-wrap:wrap}.page-heading .button-row .button{width:auto;flex:1 1 130px;min-height:35px;font-size:11px;padding:7px 10px}
  main>footer{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px;font-size:10px;line-height:1.5;white-space:normal;overflow-wrap:anywhere;margin-top:18px;padding-bottom:0}
  .mobile-dock{display:flex;position:static;flex-shrink:0;transform:none;width:100%;max-width:none;height:auto;min-height:64px;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));border:0;border-top:1px solid #dce6e2;border-radius:0;background:#fff;box-shadow:0 -4px 16px #0f172a0b;gap:3px;z-index:150;backdrop-filter:none;box-sizing:border-box}
  .mobile-dock-btn{flex:1;min-width:0;min-height:48px;padding:5px 2px;border-radius:10px;font-size:10px;font-weight:650;color:#64748b;gap:5px;white-space:nowrap}.mobile-dock-btn span:first-child{font-size:19px;line-height:1}.mobile-dock-btn.active{background:#e7f4ef;color:#047857}
  #modal{max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);margin:auto}.modal-heading h2{font-size:16px;line-height:1.4}.modal-footer{gap:8px;flex-wrap:wrap}
  .tcs-filters{grid-template-columns:repeat(2,minmax(0,1fr));padding:10px;gap:8px;border-radius:12px;margin-bottom:10px}.tcs-filters .field{min-width:0}.tcs-filters .field label{font-size:10px;margin-bottom:4px}.tcs-filters input,.tcs-filters select{min-width:0;width:100%;min-height:32px;font-size:11px;padding:6px}.tcs-filters .button{min-height:32px;font-size:11px;padding:6px}.tcs-filters input[type=checkbox]{min-height:0;width:15px}.tcs-filters .check-label{font-size:10px;gap:6px}
  .tcs-status-filter{max-width:none;margin-top:10px}.tcs-status-filter .field{margin-bottom:10px}.tcs-status-filter label{font-size:10px}.tcs-status-filter select{min-height:32px;font-size:11px;padding:6px}
  .tcs-connection{margin:10px 0;padding:10px 12px}.tcs-connection>summary{font-size:10px}.tcs-selection{margin-top:10px;gap:6px}.tcs-selection .button{min-height:30px;padding:5px 8px;font-size:10px}
  .tcs-status-metrics{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:10px 0}.tcs-status-metrics .tcs-metric{border-radius:9px;padding:8px 5px;gap:4px}.tcs-status-metrics .tcs-metric>strong{font-size:20px;letter-spacing:0}.tcs-status-metrics .tcs-metric>small{font-size:8px;line-height:1.4}.tcs-status-metrics .tcs-metric>small:last-child{display:none}
  .tcs-review-note{font-size:10px;line-height:1.5;margin-bottom:8px}.tcs-money-totals{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:10px 0}.tcs-money-totals .tcs-mini-amount{padding:7px 9px}.tcs-money-totals .tcs-mini-amount strong{font-size:13px}.tcs-money-totals .tcs-mini-amount small{font-size:9px}
  .tcs-overview-table{display:none!important}
  .tcs-mobile-ledger{display:block!important;background:#fff;border:1px solid #e2e8e4;border-radius:12px;overflow:hidden;width:100%;margin:12px 0 6px}
  .tcs-mobile-ledger table{display:table!important;table-layout:fixed!important;width:100%!important;min-width:0!important;border-collapse:collapse}
  .tcs-mobile-ledger thead{display:table-header-group!important}.tcs-mobile-ledger tbody{display:table-row-group!important}.tcs-mobile-ledger tfoot{display:table-footer-group!important}
  .tcs-mobile-ledger tr{display:table-row!important;box-shadow:none!important;border-radius:0!important;background:#fff!important;padding:0!important;border-bottom:1px solid #edf0ed}
  .tcs-mobile-ledger th,.tcs-mobile-ledger tbody tr td,.tcs-mobile-ledger tfoot td{display:table-cell!important;position:static!important;min-width:0!important;max-width:none!important;width:auto;padding:8px 3px!important;font-size:10px;line-height:1.5;white-space:normal!important;text-align:right;vertical-align:middle;border:0;overflow:hidden}
  .tcs-mobile-ledger th{background:#f8faf9;font-size:8px;font-weight:700;letter-spacing:0;color:#52665d;text-transform:none}.tcs-mobile-ledger th:nth-child(1){width:19%;text-align:left}.tcs-mobile-ledger th:nth-child(2){width:15%}.tcs-mobile-ledger th:nth-child(3),.tcs-mobile-ledger th:nth-child(4),.tcs-mobile-ledger th:nth-child(6){width:16%}.tcs-mobile-ledger th:nth-child(5){width:18%}
  .tcs-mobile-ledger .tcs-compact-ref{text-align:left}.tcs-mobile-ledger input[type=checkbox]{width:12px;height:12px;margin:0 3px 0 0;vertical-align:middle;accent-color:#0d9488}.tcs-mobile-ledger .tcs-order-link{display:inline;min-height:30px;max-width:100%;font-size:10px;white-space:normal;word-break:break-word;line-height:1.5}
  .tcs-compact-amount{font-variant-numeric:tabular-nums;white-space:nowrap!important}.tcs-compact-amount>span,.tcs-compact-amount>small{display:block}.tcs-compact-amount>small{font-size:8px;color:#64748b;margin-top:3px}
  .tcs-compact-status{font-size:8px!important}.tcs-compact-status>small{display:block;font-size:7px;color:#8a6a25;margin-top:3px}.tcs-status-dot{font-size:8px;font-weight:650;white-space:normal;color:#8a6a25}.tcs-status-dot.green{color:#047857}.tcs-status-dot.red{color:#b91c1c}
  .tcs-mobile-ledger tfoot th,.tcs-mobile-ledger tfoot td{background:#e8f1ec!important;font-weight:750;border-top:1px solid #cdded2!important}.tcs-mobile-ledger-help{display:block;font-size:9px;color:#64748b;line-height:1.6;margin-bottom:12px}
  .tcs-finance-details{margin-top:12px;padding:12px}.tcs-finance-details>summary{font-size:11px}.tcs-chart{padding:12px 0;gap:9px}.tcs-chart-row{font-size:10px;gap:6px;grid-template-columns:1fr 85px}.tcs-chart-row small{font-size:9px}
}
/* Period metrics and return receipt controls. */
.overview-range { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; margin-bottom:12px; }
.overview-range .field { flex:1 1 170px; margin:0; max-width:230px; }
.overview-range .button { margin-bottom:1px; }
.return-item { padding:16px 0; border-bottom:1px solid var(--border,#e2e8f0); display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.return-item > strong { grid-column:1/-1; }
@media(max-width:600px){ .overview-range .field { max-width:none; } .return-item { grid-template-columns:1fr; } }
/* Order actions and report controls fit narrow phone screens. */
.order-side-drawer { box-sizing:border-box; }
.drawer-body > *, .drawer-card-body, .courier-meta-item { min-width:0; }
.step-item, .step-label-wrap { min-width:0; max-width:100%; }
.step-label-wrap strong { white-space:normal; overflow-wrap:anywhere; }
.step-label-wrap small { max-width:100%; overflow-wrap:anywhere; }
.tcs-filters > .info-line { grid-column:1/-1; margin:0; }
@media(max-width:768px) {
  .order-side-drawer { height:100dvh; }
  .drawer-body { padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); }
  .drawer-header .drawer-title-group { min-width:0; }
  .drawer-header h2 { overflow-wrap:anywhere; }
  .drawer-card-header { flex-wrap:wrap; gap:6px; }
  .drawer-card-header small { overflow-wrap:anywhere; }
  .drawer-body .button, #modalBody > div > .button { min-height:44px; white-space:normal; text-align:center; line-height:1.4; }
  .card-action-bar, .courier-action-row { display:grid; grid-template-columns:1fr; width:100%; gap:8px; }
  .card-action-bar > .button, .courier-action-row > .button { width:100%; min-width:0; margin:0; }
  .drawer-body .detail-grid { grid-template-columns:minmax(90px,.9fr) minmax(0,1.3fr); gap:8px 12px; }
  .drawer-card-body, .courier-cn-section, .courier-meta-grid { padding:14px; }
  .tracking-stepper { gap:4px; padding:16px 8px; grid-template-columns:repeat(4,minmax(0,1fr)); }
  .step-label-wrap strong { font-size:10px; line-height:1.3; }
  .step-label-wrap small { font-size:9px; line-height:1.4; margin-top:3px; }
  .cn-display-box { flex-wrap:wrap; padding:12px; gap:10px; }
  .cn-display-box > div { min-width:0; max-width:100%; }
  .cn-code { overflow-wrap:anywhere; letter-spacing:.04em; }
  .courier-card-header { flex-wrap:wrap; padding:14px; }
  .tcs-filters { grid-template-columns:1fr auto; }
  .tcs-filters .field:has(select[name=tcsReference]), .tcs-filters .field:has(input[type=checkbox]) { grid-column:1/-1; }
  .tcs-filters .button, .tcs-filters select, .tcs-status-filter select { min-height:44px; font-size:12px; }
  .tcs-mobile-ledger th:nth-child(1) { width:34%; }
  .tcs-mobile-ledger th:nth-child(2) { width:22%; }
  .tcs-mobile-ledger th:nth-child(3), .tcs-mobile-ledger th:nth-child(4) { width:22%; }
  .tcs-mobile-ledger th, .tcs-mobile-ledger tbody tr td, .tcs-mobile-ledger tfoot td { padding:10px 5px!important; font-size:11px; overflow-wrap:anywhere; }
  .tcs-mobile-ledger .tcs-order-link { font-size:12px; min-height:44px; }
  .tcs-compact-ref > small { display:block; font-size:10px; overflow-wrap:anywhere; color:#64748b; }
  .tcs-mobile-ledger .tcs-amount strong { font-size:11px; white-space:normal; }
  .tcs-mobile-ledger .tcs-status-dot { font-size:10px; }
  .tcs-mobile-ledger .tcs-compact-status > small { font-size:9px; }
  .tcs-status-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .tcs-status-metrics .tcs-metric>small { font-size:10px; }
  .tcs-mobile-ledger-help { font-size:11px; }
  #modalBody .button { max-width:100%; white-space:normal; }
}
@media(max-width:380px) {
  .drawer-header { padding:12px; }
  .drawer-body { padding:12px 10px 24px; }
  .drawer-body .detail-grid { grid-template-columns:minmax(0,1fr); gap:3px; }
  .drawer-body .detail-grid dd { margin-bottom:8px; }
  .courier-meta-grid { grid-template-columns:minmax(0,1fr); }
}


/* ============================================================
   BUSINESS ECOM — STRUCTURED ORDER FORM & CATALOG STYLING
   ============================================================ */
dialog#modal.modal-wide {
  max-width: 820px;
  width: 95vw;
}

.manual-order-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.order-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.section-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark, #0f172a);
  letter-spacing: 0.2px;
}

.catalog-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.catalog-search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border-base, #cbd5e1);
  border-radius: var(--radius-sm, 8px);
  background: #ffffff;
  outline: none;
  min-height: 44px;
  box-sizing: border-box;
}

.catalog-search-input:focus {
  border-color: var(--primary, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.catalog-freshness-info {
  font-size: 11px;
  color: #64748b;
}

.catalog-search-dropdown {
  background: #ffffff;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.catalog-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.catalog-result-row:last-child {
  border-bottom: none;
}

.catalog-result-row:hover {
  background: #f8fafc;
}

.catalog-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.catalog-result-info strong {
  font-size: 13px;
  color: #0f172a;
}

.catalog-result-info small {
  font-size: 11px;
  color: #64748b;
}

.catalog-result-price {
  font-weight: 700;
  font-size: 13px;
  color: #0f766e;
  white-space: nowrap;
}

.catalog-stock-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 3px;
}

.catalog-stock-pill.stock-in {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.catalog-stock-pill.stock-out {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.search-loading-row, .search-empty-row, .search-error-row {
  padding: 14px;
  font-size: 13px;
  text-align: center;
  color: #64748b;
}

.search-error-row {
  color: #dc2626;
}

.order-lines-container {
  overflow-x: auto;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border-light, #e2e8f0);
  background: #ffffff;
}

.empty-lines-placeholder {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.line-qty-input {
  width: 60px;
  padding: 6px 8px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  min-height: 36px;
}

.order-finance-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.adjustment-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm, 8px);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-inline label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.field-inline select, .field-inline input {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  min-height: 38px;
  background: #ffffff;
}

.bill-totals-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm, 8px);
}

.bill-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #334155;
}

.bill-total-row.grand-total {
  font-size: 16px;
  font-weight: 800;
  color: #0f766e;
  border-top: 1.5px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 4px;
}

.collection-notice-details {
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm, 8px);
  padding: 12px 14px;
  background: #fafaf9;
}

.notice-summary {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  padding: 4px 0;
}

.notice-info-text {
  font-size: 11px;
  color: #64748b;
  margin: 8px 0 0;
  line-height: 1.4;
}

/* Dashboard Collapsible Details & Quick Nav */
.overview-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.dashboard-disclosure {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-card, 14px);
  background: #ffffff;
  margin-top: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.dashboard-disclosure-summary {
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  background: #f8fafc;
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.dashboard-disclosure[open] .dashboard-disclosure-summary {
  border-bottom-color: #e2e8f0;
}

.dashboard-disclosure > section, .dashboard-disclosure > div {
  padding: 16px;
}

@media(max-width: 600px) {
  .adjustment-controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .field-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .field-inline select, .field-inline input {
    width: 100%;
    min-height: 44px;
  }
  .overview-quick-nav .button {
    flex: 1 1 100%;
    min-height: 44px;
  }
}


/* Centralized Payment & STR Management Styles */
.payments-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; }
.subnav-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; color: #475569; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.15s ease; }
.subnav-btn:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }
.subnav-btn.active { background: #0f766e; color: #fff; border-color: #0f766e; box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2); }
.payments-header-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; justify-content: space-between; }
.payments-filters-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: #f8fafc; padding: 14px 18px; border-radius: 14px; border: 1px solid #e2e8f0; margin-bottom: 18px; }
.payments-filters-bar input, .payments-filters-bar select { min-width: 140px; padding: 8px 12px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; font-size: 13px; }
.financial-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.kpi-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.kpi-card-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; }
.kpi-card-icon { font-size: 18px; background: #f1f5f9; padding: 6px; border-radius: 10px; }
.kpi-card-value { font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-card-note { font-size: 11px; color: #94a3b8; margin-top: 6px; }
.kpi-card.highlight { border-color: #0d9488; background: #f0fdfa; }
.kpi-card.highlight .kpi-card-value { color: #0f766e; }
.kpi-card.warning { border-color: #f59e0b; background: #fffbeb; }
.kpi-card.warning .kpi-card-value { color: #b45309; }
.kpi-card.danger { border-color: #ef4444; background: #fef2f2; }
.kpi-card.danger .kpi-card-value { color: #b91c1c; }
.audit-timeline-mini { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; border-left: 2px solid #e2e8f0; padding-left: 12px; }
.audit-timeline-mini-item { font-size: 12px; line-height: 1.4; color: #334155; }
.audit-timeline-mini-item small { display: block; color: #94a3b8; font-size: 10px; }

/* Payments Dashboard Mobile Typography (10px) & Optimized Grid */
@media (max-width: 768px) {
  .payments-subnav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }
  .subnav-btn {
    font-size: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .payments-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }
  .payments-header-actions .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .payments-header-actions .button,
  .payments-header-actions button {
    font-size: 10px;
    padding: 6px 10px;
    min-height: 34px;
  }
  .payments-header-actions .date-badge {
    font-size: 10px;
    padding: 6px 10px;
  }
  .payments-header-actions .date-badge small {
    font-size: 10px;
  }
  .payments-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    font-size: 10px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  .payments-filters-bar strong {
    font-size: 10px;
  }
  .payments-filters-bar input,
  .payments-filters-bar select {
    font-size: 10px;
    padding: 6px 8px;
    min-width: 90px;
    min-height: 32px;
  }
  .financial-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }
  .financial-kpi-grid .stat,
  .financial-kpi-grid .kpi-card {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 10px;
  }
  .financial-kpi-grid .stat-label,
  .financial-kpi-grid .kpi-card-label {
    font-size: 10px;
    line-height: 1.2;
    margin-bottom: 4px;
  }
  .financial-kpi-grid .stat-label span:first-child,
  .financial-kpi-grid .stat-label span {
    font-size: 10px;
  }
  .financial-kpi-grid .stat strong,
  .financial-kpi-grid .kpi-card-value {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 2px;
  }
  .financial-kpi-grid .stat small,
  .financial-kpi-grid .kpi-card-note {
    font-size: 10px;
    line-height: 1.2;
    margin-top: 2px;
  }
  .financial-kpi-grid .stat-symbol,
  .financial-kpi-grid .kpi-card-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
    padding: 2px;
    border-radius: 6px;
  }
  .financial-kpi-grid ~ .card .table,
  .payments-filters-bar ~ div .card .table {
    font-size: 10px;
  }
  .financial-kpi-grid ~ .card .table th,
  .financial-kpi-grid ~ .card .table td,
  .payments-filters-bar ~ div .card .table th,
  .payments-filters-bar ~ div .card .table td {
    padding: 6px 8px;
    font-size: 10px;
  }
}
.return-product-results { display:grid; gap:8px; margin:10px 0; max-height:260px; overflow:auto; }
.return-search-result { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:10px; border:1px solid var(--border,#e2e8f0); border-radius:10px; }
.return-product-line { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:12px; margin:10px 0; border:1px solid var(--border,#e2e8f0); border-radius:12px; }
.return-product-line > strong { grid-column:1/-1; }
.return-product-line input { min-width:0; width:100%; }
.scanner-panel { padding:10px; margin:12px 0; border-radius:12px; background:#f1f5f9; }
.scanner-panel[hidden] { display:none; }
.scanner-video { display:block; width:100%; max-height:230px; object-fit:cover; border-radius:10px; background:#111827; }


/* --- Excel-style dense TCS Table & Financial Strip --- */
.tcs-excel-wrap {
  width: 100%;
  max-height: 580px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  margin-top: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tcs-excel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}
.tcs-excel-table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  padding: 6px 8px;
  text-align: left;
  z-index: 2;
  user-select: none;
}
.tcs-excel-table th.col-amount,
.tcs-excel-table td.col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tcs-excel-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  color: #1e293b;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tcs-excel-table tbody tr:hover {
  background: #f8fafc;
}
.tcs-excel-table tfoot td {
  position: sticky;
  bottom: 0;
  background: #e2e8f0;
  font-weight: 700;
  border-top: 2px solid #94a3b8;
  border-right: 1px solid #cbd5e1;
  padding: 6px 8px;
  z-index: 2;
}

.tcs-compact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  margin: 12px 0;
}
.tcs-strip-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tcs-strip-item small {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tcs-strip-item strong {
  font-size: 13px;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

/* --- Returns Unified Scanner UI --- */
.return-scanner-top {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
  margin-bottom: 16px;
}
.scanner-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.scanner-top-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.scanner-top-input-row input {
  flex: 1;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 13px;
}
.scanner-feedback {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.scanner-choice-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scanner-choice-buttons {
  display: flex;
  gap: 8px;
}
.upfront-posting-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin: 10px 0;
}
.erp-mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 10px 0;
}
.erp-mapping-table th, .erp-mapping-table td {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  text-align: left;
}
.erp-mapping-table th {
  background: #f1f5f9;
  font-weight: 600;
}


/* ==========================================================================
   PORTAL SELECTOR & SHOP-TO-SHOP TRANSFERS STYLES
   ========================================================================== */

.portal-selector-screen {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 10%, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: #f8fafc;
}

.portal-selector-shell {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.portal-header {
  text-align: center;
}

.portal-header .wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  text-decoration: none;
}

.portal-header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 10px 0;
  color: #ffffff;
}

.portal-sub {
  color: #94a3b8;
  font-size: 15px;
  max-width: 580px;
  margin: 0 auto;
}

.portal-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.portal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 28px;
  color: #0f172a;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 2px solid transparent;
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.4);
  border-color: #38bdf8;
}

.portal-card.transfer-card:hover {
  border-color: #34d399;
}

.portal-card-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #0369a1;
}

.portal-card-badge.transfer-badge {
  background: #dcfce7;
  color: #15803d;
}

.portal-card-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.portal-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: #0f172a;
}

.portal-card p {
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px 0;
  flex-grow: 1;
}

.portal-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 13px;
  color: #334155;
  font-weight: 500;
}

.portal-action-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
  border-radius: 8px;
}

.portal-action-btn.transfer-btn {
  background: #059669;
  border-color: #059669;
}

.portal-action-btn.transfer-btn:hover {
  background: #047857;
}

.portal-footer {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.portal-footer .quiet-button {
  color: #cbd5e1;
}

/* Active Portal Tag in Topbar */
.active-portal-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.switch-portal-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
  cursor: pointer;
  padding: 3px 8px;
  transition: all 0.15s ease;
  margin-left: 4px;
}

.switch-portal-btn:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0284c7;
}

/* Route Preview Badge */
.route-preview-badge {
  display: inline-flex;
  align-items: center;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #b45309;
  font-family: monospace;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
}

/* Source Pill in Order Desk */
.pill.source-portal {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.pill.source-whatsapp {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* Mobile Responsiveness for Portal Selector */
@media (max-width: 640px) {
  .portal-selector-screen {
    padding: 20px 12px;
  }
  .portal-header h1 {
    font-size: 24px;
  }
  .portal-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .portal-card {
    padding: 24px 20px;
  }
  .active-portal-tag {
    font-size: 11px;
    padding: 3px 6px;
    gap: 4px;
  }
  .switch-portal-btn {
    font-size: 11px;
    padding: 2px 6px;
  }
}

@media (max-width:640px) {
  .portal-card { padding:18px; }
  .portal-card h2 { font-size:20px; margin-bottom:8px; }
  .portal-card p { font-size:13px; margin-bottom:12px; }
  .portal-card-icon { font-size:28px; margin-bottom:8px; }
  .portal-header { margin-bottom:18px; }
  .switch-portal-btn { min-height:44px; }
}

.portal-footer .quiet-button { background:transparent; border:1px solid #94a3b8; color:#e2e8f0; min-height:44px; padding:8px 12px; }
.transfers-desk-container .tools select { min-height:44px; border:1px solid #cbd5e1; border-radius:8px; padding:8px; background:#fff; }
@media (max-width:640px) { .topbar-actions .date-badge { display:none; } .topbar-actions { gap:6px; min-width:0; } #activePortalName { white-space:nowrap; } }
:root { --report-border: var(--border, #dfe6ed); }
.tcs-coverage { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; padding:14px 16px; margin:12px 0; border:1px solid var(--report-border); border-radius:12px; }
.tcs-coverage span { font-size:.85rem; color:var(--text-muted, #64748b); }
.tcs-match-candidate { padding:14px 0; border-bottom:1px solid var(--report-border); }
.tcs-match-candidate p { overflow-wrap:anywhere; margin:6px 0; }
.shop-orders-panel { scroll-margin-top:20px; }
.tcs-filters .field { min-width:160px; flex:1; }
@media(max-width:600px) { .tcs-coverage { align-items:flex-start; flex-direction:column; } .tcs-filters { display:flex; flex-wrap:wrap; } .payments-subnav { flex-wrap:wrap; } .tcs-match-candidate button { min-height:44px; } }

.overdue-transit { background:#fee2e2; color:#991b1b; border:1px solid #ef4444; padding:8px; border-radius:8px; }
.dashboard-content > .card, .dashboard-content > .grid-columns, .dashboard-content > .stats-primary-grid, .dashboard-content > .stats-secondary-grid { margin-bottom: 20px; }
.dashboard-content .stats-secondary-grid { grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); }
.dashboard-content .card > dl { padding: 18px; }
.overview-range > details { min-width: 180px; }
@media(max-width:600px) { .dashboard-content .stats-secondary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .overview-range { align-items:stretch; } .overview-range > .button { flex:1 1 45%; } }
.order-transit-overdue td { background:#fff1f2; }
.order-transit-overdue td:first-child { border-left:4px solid #dc2626; }
.order-transit-current td { background:#f0fdf4; }
.order-transit-current td:first-child { border-left:4px solid #16a34a; }
@media(max-width:1000px) { .dashboard-content .table-wrap td::before { display:none!important; content:none!important; } .dashboard-content .table-wrap td { gap:12px; } }
/* Compact operations workspace: 320px phones keep tables and totals together. */
.amount-display { font-variant-numeric:tabular-nums; white-space:nowrap; }
.tcs-ledger-totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:10px 0; }
.tcs-ledger-totals > div { min-width:0; padding:12px; border:1px solid #dbe8e2; border-radius:10px; background:#f3faf7; }
.tcs-ledger-totals small,.tcs-ledger-totals span { display:block; font-size:10px; color:#536b61; line-height:1.35; }
.tcs-ledger-totals strong { display:block; font-size:19px; line-height:1.5; font-variant-numeric:tabular-nums; }
.tcs-ledger-totals > p { grid-column:1/-1; margin:0; }
.tcs-ledger-scroll { width:100%; overflow-x:auto; }
.tcs-ledger-table { width:100%; table-layout:fixed; border-collapse:collapse; font-size:12px; }
.tcs-ledger-table th,.tcs-ledger-table td { padding:9px 6px; text-align:right; vertical-align:top; border-bottom:1px solid #e3e9e5; overflow-wrap:anywhere; }
.tcs-ledger-table th { color:#536b61; font-size:10px; background:#f8fbf9; }
.tcs-ledger-table th:first-child,.tcs-ledger-table td:first-child,.tcs-ledger-table th:nth-child(2),.tcs-ledger-table td:nth-child(2) { text-align:left; }
.tcs-ledger-table th:first-child { width:18%; }
.tcs-ledger-table th:nth-child(2) { width:18%; }
.tcs-ledger-table td small { display:block; font-size:9px; line-height:1.4; color:#63736b; margin-top:3px; }
.tcs-ledger-table .button { padding:0; font-size:inherit; min-height:28px; text-align:left; overflow-wrap:anywhere; }
.tcs-ledger-table .tcs-paid-note { color:#087348; }
.dashboard-content .all-time-courier-balance { border-color:#b9dcca; background:#effaf4; }

@media(max-width:600px) {
  .main-shell > main { padding:10px 7px 16px; }
  .topbar { padding:7px 8px; gap:4px; }
  .topbar .breadcrumb { display:none; }
  .page-heading { margin-bottom:9px; gap:6px; }
  .heading-text h1 { font-size:18px; }
  .overview-range { gap:5px; margin-bottom:8px; padding:7px; }
  .overview-range .field { margin-bottom:0; flex:1 1 45%; min-width:0; }
  .overview-range .field label { font-size:9px; margin-bottom:2px; }
  .overview-range input { min-height:30px; padding:4px; font-size:11px; }
  .overview-range > .button { flex:1 1 27%; min-height:28px; font-size:9px; padding:5px; }
  .overview-range > details { min-width:0; flex:1 1 45%; font-size:10px; }
  .overview-range > details summary { min-height:28px; padding:5px; }
  .dashboard-content > .card,.dashboard-content > .grid-columns,.dashboard-content > .stats-primary-grid,.dashboard-content > .stats-secondary-grid { margin-bottom:8px; }
  .dashboard-content .stats-primary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  .dashboard-content .pastel-stat-card { min-height:78px; padding:9px; border-radius:10px; box-shadow:none; }
  .dashboard-content .pastel-stat-card strong { font-size:21px; margin:2px 0; }
  .dashboard-content .pastel-stat-card small { font-size:8px; line-height:1.3; }
  .dashboard-content .stat-card-top { margin-bottom:2px; }
  .dashboard-content .stat-card-top span { font-size:10px; }
  .dashboard-content .stat-card-badge { width:21px; height:21px; border-radius:6px; font-size:11px; }
  .dashboard-content .stats-secondary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
  .dashboard-content .stat { min-width:0; padding:7px 6px; border-radius:9px; box-shadow:none; }
  .dashboard-content .stat-label { gap:2px; font-size:9px; margin-bottom:3px; line-height:1.25; }
  .dashboard-content .stat-symbol { width:16px; height:16px; min-width:16px; font-size:9px; }
  .dashboard-content .stat > strong { font-size:17px; line-height:1.2; overflow-wrap:anywhere; }
  .dashboard-content .stat > small { font-size:8px; line-height:1.25; margin-top:3px; }
  .dashboard-content .card { border-radius:10px; box-shadow:none; }
  .dashboard-content .card-header { padding:9px 8px; gap:4px; }
  .dashboard-content .card-header h2 { font-size:12px; }
  .dashboard-content .card-header small { font-size:8px; line-height:1.3; }
  .dashboard-content .info-line { font-size:9px; line-height:1.4; margin:5px 3px; }
  .dashboard-content .grid-columns { display:grid; grid-template-columns:1fr; gap:7px; }
  .dashboard-content .card > dl { padding:8px; }
  .dashboard-content .detail-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:5px 7px; font-size:10px; }
  .dashboard-content .detail-grid dd { text-align:right; margin:0; }
  .dashboard-content .table-wrap { overflow:auto; padding:0; }
  .dashboard-content .table-wrap table { display:table; width:100%; min-width:0; table-layout:fixed; font-size:9px; }
  .dashboard-content .table-wrap thead { display:table-header-group; }
  .dashboard-content .table-wrap tbody { display:table-row-group; }
  .dashboard-content .table-wrap tr { display:table-row; padding:0; border:0; box-shadow:none; border-radius:0; margin:0; }
  .dashboard-content .table-wrap th,.dashboard-content .table-wrap td { display:table-cell; padding:6px 3px; min-width:0; white-space:normal; overflow-wrap:anywhere; vertical-align:top; text-align:right; border-bottom:1px solid #e5ece8; }
  .dashboard-content .table-wrap th { font-size:8px; line-height:1.3; }
  .dashboard-content .table-wrap td:first-child,.dashboard-content .table-wrap th:first-child { text-align:left; }
  .dashboard-content .table-wrap td::before { display:none; content:none; }
  .dashboard-content .table-wrap .button { font-size:9px; padding:0; min-height:28px; }
  .dashboard-content .table-wrap small { display:block; font-size:8px; line-height:1.2; }
  .tcs-ledger-totals { gap:4px; margin:7px 0; }
  .tcs-ledger-totals > div { padding:6px 5px; border-radius:8px; }
  .tcs-ledger-totals small { font-size:8px; }
  .tcs-ledger-totals strong { font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
  .tcs-ledger-totals span { font-size:8px; line-height:1.2; }
  .tcs-ledger-totals > p { font-size:8px; line-height:1.35; }
  .tcs-ledger-card .card-header { padding:9px 7px; }
  .tcs-ledger-card .card-header h2 { font-size:13px; }
  .tcs-ledger-card .card-header small { font-size:8px; }
  .tcs-ledger-card .info-line { font-size:9px; padding:0 6px; margin:5px 0; }
  .tcs-ledger-table { font-size:9px; min-width:0; }
  .tcs-ledger-table th,.tcs-ledger-table td { padding:6px 3px; line-height:1.35; }
  .tcs-ledger-table th { font-size:8px; }
  .tcs-ledger-table td small { font-size:8px; }
  .tcs-ledger-table .button { font-size:9px; min-height:28px; }
  .tcs-coverage { gap:5px; padding:8px; margin:7px 0; border-radius:8px; flex-direction:row; }
  .tcs-coverage span,.tcs-coverage strong { font-size:10px; }
  .tcs-coverage .button { min-height:28px; padding:5px; font-size:9px; }
  .payments-subnav { gap:5px; margin-bottom:8px; }
  .payments-subnav .button { font-size:10px; min-height:30px; padding:5px 8px; }
}

/* ============================================================
   MOBILE ERGONOMICS & COMPACT EXCEL-STYLE ORDER DESK (320px–420px)
   ============================================================ */
@media (max-width: 480px) {
  /* Month controls equal weight and alignment */
  .overview-range .month-btn {
    flex: 1 1 calc(50% - 6px);
    min-height: 32px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    justify-content: center;
    padding: 6px 4px;
  }
  .overview-range .month-prev-btn,
  .overview-range .month-next-btn {
    min-width: 0;
  }

  /* Compact Order Desk Cards & Alignment */
  .table-wrap tbody tr {
    padding: 10px 8px;
    gap: 8px;
    border-radius: 8px;
  }
  .table-wrap tbody tr td.cell-order {
    padding-bottom: 6px;
  }
  .table-wrap tbody tr td.cell-order .order-meta-info strong {
    font-size: 13px;
  }
  .table-wrap tbody tr td.cell-order .order-meta-info small {
    font-size: 10px;
  }
  .table-wrap tbody tr td.cell-customer strong {
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .table-wrap tbody tr td.cell-customer small {
    font-size: 10px;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .table-wrap tbody tr td.cell-shop {
    padding: 5px 8px;
    font-size: 10px;
  }
  .table-wrap tbody tr td.cell-amount strong {
    font-size: 13px;
  }
  .table-wrap tbody tr td.cell-amount small {
    font-size: 10px;
  }
  .table-wrap tbody tr td.cell-status .status-badges-row {
    gap: 3px;
    flex-wrap: wrap;
  }
  .table-wrap tbody tr td.cell-status .pill {
    font-size: 10px;
    padding: 2px 6px;
    line-height: 1.2;
  }
  .table-wrap tbody tr td.cell-actions {
    padding-top: 4px;
    border-top: 1px dashed var(--border-light, #e2e8f0);
  }
  .table-wrap tbody tr td.cell-actions .button-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 4px;
    width: 100%;
  }
  .table-wrap tbody tr td.cell-actions .button {
    min-height: 30px;
    font-size: 10px;
    padding: 4px 6px;
    justify-content: center;
    text-align: center;
  }

  /* Order Drawer & Dialog Details on Narrow Screens */
  .order-side-drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .drawer-body {
    padding: 10px 8px 24px;
  }
  .drawer-body .drawer-card {
    padding: 10px 8px;
    margin-bottom: 8px;
    border-radius: 8px;
  }
  .drawer-body .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .drawer-body .detail-grid dt {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
  }
  .drawer-body .detail-grid dd {
    font-size: 11px;
    font-weight: 600;
    overflow-wrap: break-word;
    word-break: break-word;
    margin-bottom: 4px;
  }
  dialog#modal {
    width: calc(100vw - 12px);
    max-width: 480px;
    padding: 12px;
    margin: 6px auto;
    border-radius: 10px;
  }
  dialog#modal .modal-heading h2 {
    font-size: 15px;
    line-height: 1.3;
  }
  dialog#modal .form-group {
    margin-bottom: 8px;
  }
  dialog#modal .form-group label {
    font-size: 11px;
  }
  dialog#modal .input,
  dialog#modal select,
  dialog#modal textarea {
    font-size: 12px;
    padding: 6px 8px;
  }
  dialog#modal .modal-footer {
    padding-top: 8px;
    gap: 6px;
  }
  dialog#modal .modal-footer .button {
    font-size: 12px;
    min-height: 34px;
  }
}

/* WhatsApp Operations Desk & Address Proposals (WA-01 to WA-05) */
.address-proposal-banner {
  margin: 12px 0;
  padding: 12px 14px;
  background: #fefce8;
  border: 1px solid #facc15;
  border-radius: 8px;
  word-break: break-word;
}
.address-proposal-banner strong {
  display: block;
  font-size: 13px;
  color: #854d0e;
  margin-bottom: 4px;
}
.status-confirmed {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac !important;
}
.status-warning {
  background: #fef9c3 !important;
  color: #854d0e !important;
  border: 1px solid #fde047 !important;
}
.status-danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5 !important;
}
.button-row.compact-gap {
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .address-proposal-banner {
    padding: 10px;
    font-size: 12px;
  }
  .address-proposal-banner .button-row {
    flex-direction: column;
    width: 100%;
  }
  .address-proposal-banner .button-row .button {
    width: 100%;
  }
}

/* Compact operations workspace: explicit rows, contained scrolling, quiet copy. */
.main-shell, #pageContent, .card, .settings-grid > *, .report-pair > * { min-width: 0; }
.main-shell > main { max-width: 1680px; padding: 20px 24px 36px; }
.page-heading { margin-bottom: 16px; gap: 12px; }
.heading-text h1 { font-size: 24px; letter-spacing: -.6px; }
#pageContent > .card { margin-bottom: 14px; }
.card { box-shadow: none; border-radius: 10px; }
.card-header { padding: 14px 16px; gap: 12px; }
.card-header h2 { font-size: 15px; }
.card-header small:empty { display:none; }
.card-header:has(> .button) { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.button-row { min-width:0; flex-wrap:wrap; }
.button, td, th, .detail-grid dd, .detail-grid dt { overflow-wrap:anywhere; }
.detail-grid dd { min-width:0; }
.button { max-width:100%; }
.report-summary { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border-light);border-radius:10px;background:#fff;margin-bottom:16px; }
.report-summary > div { padding:16px 20px; border-right:1px solid var(--border-light);min-width:0; }
.report-summary > div:last-child { border-right:0; }
.report-summary small { display:block;font-size:12px;color:var(--text-muted); }
.report-summary strong { display:block;margin-top:5px;font-size:clamp(19px,2vw,28px);font-weight:750;line-height:1.3;overflow-wrap:anywhere;font-variant-numeric:tabular-nums; }
.report-tabs { margin-bottom:14px; }
.report-pair { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px; }
.report-pair .card { margin:0; }
.report-sheet.table-wrap { display:block;max-width:100%;overflow:auto;overscroll-behavior-inline:contain;border:0;border-radius:0; }
.report-sheet.table-wrap table { display:table;width:100%;min-width:440px;border-collapse:collapse;table-layout:auto;font-variant-numeric:tabular-nums; }
.report-sheet.table-wrap thead { display:table-header-group; }
.report-sheet.table-wrap tbody { display:table-row-group; }
.report-sheet.table-wrap tr { display:table-row;padding:0;background:none;border:0;box-shadow:none; }
.report-sheet.table-wrap th, .report-sheet.table-wrap td { display:table-cell;position:static;float:none;width:auto;max-width:360px;padding:11px 14px;border:0;border-bottom:1px solid var(--border-light);border-radius:0;font-size:12px;vertical-align:middle;white-space:normal;overflow-wrap:anywhere;text-align:left; }
.report-sheet.table-wrap th { background:#f4f7fa;color:#536377;font-weight:650;font-size:11px;letter-spacing:0;text-transform:none;white-space:nowrap; }
.report-sheet.table-wrap td::before { content:none;display:none; }
.report-sheet.table-wrap td strong { font-size:12px; }
.report-sheet.table-wrap td small { font-size:11px;max-width:34ch; }
.report-sheet.table-wrap td .button-row { gap:5px; }
.report-sheet.table-wrap td .button { min-height:32px;font-size:11px;padding:5px 9px; }
.report-pair .report-sheet table { min-width:260px; }
.report-notes { margin:14px 0;color:var(--text-muted);font-size:12px; }
.report-notes summary { cursor:pointer;padding:8px 0;font-weight:600; }
.report-notes p { max-width:85ch;line-height:1.6; }
.report-dashboard .all-time-courier-balance { margin-top:16px; }
.report-dashboard .tcs-ledger-totals { padding:12px 16px; }
.overview-range { gap:8px;align-items:center;padding:12px;border:1px solid var(--border-light);background:#fff;border-radius:10px; }
.overview-range .field { flex:0 1 175px;min-width:0; }
.overview-range .field > label { display:none; }
.overview-range .month-btn { flex:0 1 auto;min-width:128px; }
.overview-range > details { min-width:0; }
.overview-range > details[open] { flex-basis:100%;display:flex;flex-wrap:wrap;gap:8px; }
.overview-range > details summary { font-size:12px;cursor:pointer; }
.settings-workspace .settings-grid { grid-template-columns:minmax(0,1fr);gap:12px;margin-bottom:12px; }
.settings-workspace .settings-grid > .card { display:grid;grid-template-columns:minmax(140px,.8fr) minmax(200px,1.5fr) minmax(160px,1fr);align-items:start;margin:0; }
.settings-workspace .settings-grid .card-header { border:0;padding:18px 16px; }
.settings-workspace .settings-grid .card-header small { display:none; }
.settings-workspace .settings-grid .card-body { padding:16px;margin:0; }
.settings-workspace .settings-grid .detail-grid { margin:16px;grid-template-columns:minmax(95px,.8fr) minmax(0,1fr);gap:6px 12px; }
.settings-workspace .settings-grid .card-body .detail-grid { margin:0; }
.settings-workspace .settings-actions { display:flex;flex-wrap:wrap;gap:6px;padding:16px;align-content:start; }
.settings-workspace .settings-actions .button { font-size:12px;min-height:34px; }
.settings-workspace .settings-grid > .card > .notice { grid-column:2 / -1;margin:0 16px 12px; }
.whatsapp-workspace { display:grid;grid-template-columns:minmax(240px,.75fr) minmax(0,2fr);gap:14px;align-items:start; }
.whatsapp-workspace > .notice, .whatsapp-workspace > .card:nth-last-child(-n+2) { grid-column:1/-1; }
.whatsapp-workspace > .card { margin:0!important; }
.whatsapp-workspace > .card > .button-row, .whatsapp-workspace > .card > p, .wa-workflow-form { margin:14px 16px; }
.wa-qr { display:block;width:min(288px,100%);height:auto;aspect-ratio:1;margin:16px auto;background:#fff;object-fit:contain; }
.wa-phone { font-variant-numeric:tabular-nums;font-weight:700; }
.wa-workflow-form .field { margin:10px 0; }
.wa-message { white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6; }
.wa-chat-log { display:flex;flex-direction:column;gap:10px;max-height:45vh;overflow:auto;margin-bottom:16px; }
.wa-chat-message { width:85%;padding:12px;background:#f1f5f9;border-radius:10px;overflow-wrap:anywhere; }
.wa-chat-message.out { align-self:flex-end;background:#ecfdf5; }
.wa-chat-message p { white-space:pre-wrap;font-size:13px;margin:0 0 6px; }
.wa-chat-message small { font-size:10px;color:var(--text-muted); }
.store-report .report-sheet table { min-width:850px; }
.order-side-drawer .eyebrow, #modalForm > .modal-heading .eyebrow { display:none; }
.order-side-drawer .drawer-card > .drawer-card-subtitle { display:none; }
.drawer-header { padding:14px 18px; }
.drawer-header h2 { font-size:17px;overflow-wrap:anywhere; }
.drawer-body .drawer-card { padding:14px;margin-bottom:10px; }
.drawer-body .detail-grid { gap:5px 10px; }
.drawer-body .detail-grid dt, .drawer-body .detail-grid dd { font-size:12px;line-height:1.5; }
.table-wrap td .order-meta-info, .table-wrap td.cell-customer { min-width:0;overflow-wrap:anywhere; }
@media(min-width:901px){
  .table-wrap td.cell-customer { max-width:220px; }
  .table-wrap td.cell-customer small { max-width:28ch;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
}
@media(max-width:1000px){
  .settings-workspace .settings-grid > .card { grid-template-columns:minmax(120px,.6fr) minmax(0,1.4fr); }
  .settings-workspace .settings-actions { grid-column:2;padding-top:0; }
}
@media(max-width:700px){
  .main-shell > main { padding:16px 12px 110px; }
  .report-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-summary > div { padding:12px;border-bottom:1px solid var(--border-light); }
  .report-summary > div:nth-child(2) { border-right:0; }
  .report-summary > div:nth-last-child(-n+2) { border-bottom:0; }
  .report-pair, .whatsapp-workspace { grid-template-columns:minmax(0,1fr); }
  .whatsapp-workspace > .card { grid-column:1; }
  .report-tabs { flex-wrap:nowrap;overflow:auto;max-width:100%;padding-bottom:5px; }
  .report-tabs .button { flex:0 0 auto;white-space:nowrap; }
  .overview-range .month-btn { flex:1 1 40%;min-height:38px; }
  .overview-range .field { flex-basis:100%;max-width:none; }
  .settings-workspace .settings-grid > .card { grid-template-columns:minmax(0,1fr); }
  .settings-workspace .settings-grid .card-header { padding:14px 14px 0; }
  .settings-workspace .settings-actions { grid-column:1;padding:0 14px 14px; }
  .settings-workspace .settings-grid .detail-grid { margin:14px; }
  .settings-workspace .settings-grid > .card > .notice { grid-column:1; }
  .report-sheet.table-wrap { padding:0; }
  .report-sheet.table-wrap td, .report-sheet.table-wrap th { padding:10px 12px; }
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after { scroll-behavior:auto!important;transition:none!important;animation:none!important; }}

.report-pagination { display:flex;justify-content:flex-end;gap:8px;align-items:center;margin:12px 0; }
.portal-selector-screen { background:#f3f6fa;min-height:100dvh;padding:24px; }
.portal-selector-shell { max-width:820px;width:100%;margin:auto; }
.portal-header { text-align:left;margin-bottom:24px; }
.portal-header .wordmark { justify-content:flex-start;color:#0f172a;margin-bottom:28px; }
.portal-header h1 { font-size:28px;color:#0f172a;letter-spacing:-.6px;margin:0; }
.portal-cards-grid { gap:16px; }
.portal-card, .portal-card.transfer-card { padding:24px;text-align:left;background:#fff;border:1px solid #dce4ed;border-radius:12px;box-shadow:none;transform:none; }
.portal-card::before, .portal-card::after { display:none; }
.portal-card .portal-card-icon { font-size:28px;margin:0 0 16px;background:#eff6f3;width:52px;height:52px;border-radius:12px;display:grid;place-items:center; }
.portal-card h2 { color:#0f172a;font-size:22px;margin:0 0 8px; }
.portal-card p { color:#64748b;min-height:0;margin:0 0 24px;font-size:13px; }
.portal-card .portal-action-btn { width:100%;margin:0;min-height:42px;border-radius:7px; }
.portal-footer { color:#64748b;margin-top:24px; }
.portal-footer .quiet-button { color:#334155; }
@media(max-width:600px){.portal-selector-screen{padding:24px 16px;}.portal-cards-grid{grid-template-columns:minmax(0,1fr);}.portal-card,.portal-card.transfer-card{padding:20px;}.portal-header h1{font-size:24px;}}

.whatsapp-workspace .empty { padding:20px 16px; }
.whatsapp-workspace .empty-icon { width:36px;height:36px;font-size:18px;margin-bottom:6px; }
.whatsapp-workspace .empty h3 { font-size:14px;margin:4px 0; }
.whatsapp-workspace .empty p { margin:6px 0;font-size:12px; }
.drawer-card > .drawer-card { border:0;padding:0;box-shadow:none; }
.report-pagination small { margin-right:auto; }

@media (min-width: 769px) {
  .order-report.report-sheet.table-wrap { max-height: 65vh; overflow: auto; }
  .order-report.report-sheet.table-wrap table { min-width: 1000px; }
  .order-report.report-sheet.table-wrap th { position: sticky; top: 0; z-index: 2; }
  .order-report.report-sheet.table-wrap th:first-child,
  .order-report.report-sheet.table-wrap td:first-child {
    position: sticky; left: 0; min-width: 130px; width: 150px; background: #fff; z-index: 1; border-right: 1px solid var(--border-light);
  }
  .order-report.report-sheet.table-wrap th:first-child { z-index: 3; background: #f4f7fa; }
  .order-report.report-sheet.table-wrap td { padding: 8px 12px; }
  .order-report .table-item-thumb,
  .order-report .table-item-placeholder { width: 32px; height: 32px; min-width: 32px; font-size: 11px; border-radius: 6px; }
  .order-report .cell-customer small { max-width: 24ch; }
  .order-report .cell-actions .button-row { display: flex !important; gap: 5px !important; }
  .order-report .cell-actions .button { width: auto !important; min-height: 32px !important; }
  .order-report.report-sheet.table-wrap td.cell-order { padding-bottom: 8px; }
  .order-report.report-sheet.table-wrap td.cell-shop { background: #fff; border-radius: 0; }
}

@media (max-width: 768px) {
  .order-report.report-sheet.table-wrap {
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .order-report.report-sheet.table-wrap table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .order-report.report-sheet.table-wrap thead {
    display: none !important;
  }
  .order-report.report-sheet.table-wrap tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
  }
  .order-report.report-sheet.table-wrap tbody tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #ffffff !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 14px !important;
    padding: 14px !important;
    box-shadow: var(--shadow-sm) !important;
    box-sizing: border-box !important;
    position: static !important;
    overflow: hidden !important;
    gap: 10px !important;
  }
  .order-report.report-sheet.table-wrap tbody tr td,
  .order-report.report-sheet.table-wrap th:first-child,
  .order-report.report-sheet.table-wrap td:first-child {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border: 0 !important;
    border-right: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: auto !important;
    padding: 0 !important;
  }
  .order-report.report-sheet.table-wrap td.cell-order {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid var(--border-light) !important;
    width: 100% !important;
  }
  .order-report.report-sheet.table-wrap td.cell-order .table-item-cell {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .order-report.report-sheet.table-wrap td.cell-order .table-item-thumb,
  .order-report.report-sheet.table-wrap td.cell-order .table-item-placeholder {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 10px !important;
  }
  .order-report.report-sheet.table-wrap td.cell-order .order-meta-info {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
  }
  .order-report.report-sheet.table-wrap td.cell-order .order-meta-info strong {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    letter-spacing: -0.3px !important;
    line-height: 1.2 !important;
  }
  .order-report.report-sheet.table-wrap td.cell-order .order-meta-info small {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    white-space: nowrap !important;
    margin-top: 2px !important;
  }
  .order-report.report-sheet.table-wrap td.cell-customer {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 2px 0 !important;
  }
  .order-report.report-sheet.table-wrap td.cell-customer strong {
    font-size: 14px !important;
    font-weight: 750 !important;
    color: #0f172a !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }
  .order-report.report-sheet.table-wrap td.cell-customer small {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
  }
  .order-report.report-sheet.table-wrap td.cell-shop {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #f8fafc !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .order-report.report-sheet.table-wrap td.cell-shop strong {
    font-size: 13px !important;
  }
  .order-report.report-sheet.table-wrap td.cell-shop small {
    font-size: 11px !important;
    color: var(--text-muted) !important;
  }
  .order-report.report-sheet.table-wrap td.cell-amount {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 2px 0 !important;
  }
  .order-report.report-sheet.table-wrap td.cell-amount strong {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: var(--brand-dark) !important;
    white-space: nowrap !important;
  }
  .order-report.report-sheet.table-wrap td.cell-amount small {
    font-size: 11px !important;
    color: var(--text-muted) !important;
  }
  .order-report.report-sheet.table-wrap td.cell-status {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
    padding: 2px 0 !important;
  }
  .order-report.report-sheet.table-wrap td.cell-status .button-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .order-report.report-sheet.table-wrap td.cell-actions {
    display: block !important;
    width: 100% !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border-light) !important;
    margin-top: 2px !important;
  }
  .order-report .cell-actions .button-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .order-report .cell-actions .button {
    width: 100% !important;
    min-height: 40px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

@media (max-width: 360px) {
  .order-report .cell-actions .button-row {
    grid-template-columns: 1fr !important;
  }
  .order-report.report-sheet.table-wrap td.cell-order .order-meta-info strong {
    font-size: 14px !important;
  }
}

@media (max-width: 600px) {
  .main-shell > main { min-width: 0; width: 100%; padding: 8px 6px 96px; }
  #pageContent, .dashboard-content, .settings-workspace, .settings-workspace .settings-grid,
  .settings-workspace .settings-grid > .card { min-width: 0; max-width: 100%; }
  .settings-workspace .settings-grid > .card { grid-template-columns: minmax(0,1fr); }
  .settings-workspace .settings-grid .card-header { padding: 9px 9px 0; }
  .settings-workspace .settings-grid .card-body { min-width: 0; padding: 8px 9px; }
  .settings-workspace .settings-grid .detail-grid { margin: 8px 9px; grid-template-columns: minmax(76px,.65fr) minmax(0,1fr); gap: 3px 7px; }
  .settings-workspace .settings-actions { grid-column: 1; padding: 0 9px 9px; gap: 4px; }
  .settings-workspace .settings-actions .button { min-width: 0; font-size: 10px; padding: 6px; }
  .dashboard-content .card { min-width: 0; }
  .dashboard-content .card-header { padding: 8px 9px; }
  .report-dashboard .tcs-ledger-totals { padding: 6px; }
}
@media (max-width: 480px) {
  .tcs-ledger-scroll { overflow-x: hidden; }
  .tcs-ledger-table, .tcs-ledger-table tbody, .tcs-ledger-table tr { display: block; width: 100%; min-width: 0; }
  .tcs-ledger-table thead { display: none; }
  .tcs-ledger-table tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; padding: 6px; border-bottom: 1px solid #dbe8e2; }
  .tcs-ledger-table td { display: block; width: auto; min-width: 0; padding: 2px; border: 0; text-align: left; overflow-wrap: anywhere; font-size: 10px; }
  .tcs-ledger-table td:first-child { grid-column: span 2; }
  .tcs-ledger-table td::before { content: attr(data-label); display: block; color: #536b61; font-size: 8px; font-weight: 600; }
  .tcs-ledger-table td .button { font-size: 10px; min-height: 22px; }
}
