/* <style> */
/* TG4339 colour palette: every hard-coded colour used 2+ times in the page CSS, defined once (same values in both themes). */
:root{--p-065f46:#065f46;--p-067647:#067647;--p-0a0a0a:#0a0a0a;--p-0f172a:#0f172a;--p-10b981:#10b981;--p-111827:#111827;--p-141416:#141416;--p-15803d:#15803d;--p-166534:#166534;--p-16a34a:#16a34a;--p-1a1a1a:#1a1a1a;--p-1a202c:#1a202c;--p-1a2a3b:#1a2a3b;--p-1a3b2a:#1a3b2a;--p-1d1d1d:#1d1d1d;--p-1e3a5f:#1e3a5f;--p-1e40af:#1e40af;--p-1f1f1f:#1f1f1f;--p-1f2937:#1f2937;--p-22c55e:#22c55e;--p-243042:#243042;--p-2563eb:#2563eb;--p-2d3748:#2d3748;--p-3730a3:#3730a3;--p-374151:#374151;--p-3b1a1a:#3b1a1a;--p-3b2f1a:#3b2f1a;--p-3f3f46:#3f3f46;--p-4352d6:#4352d6;--p-475569:#475569;--p-4ade80:#4ade80;--p-4b5563:#4b5563;--p-4f5fe0:#4f5fe0;--p-5262e5:#5262e5;--p-6b7280:#6b7280;--p-6ee7b7:#6ee7b7;--p-71717a:#71717a;--p-78350f:#78350f;--p-7f1d1d:#7f1d1d;--p-92400e:#92400e;--p-93c5fd:#93c5fd;--p-991b1b:#991b1b;--p-9ca3af:#9ca3af;--p-a1a1aa:#a1a1aa;--p-a5b4fc:#a5b4fc;--p-b42318:#b42318;--p-b45309:#b45309;--p-b54708:#b54708;--p-bbf7d0:#bbf7d0;--p-bfdbfe:#bfdbfe;--p-c7d2fe:#c7d2fe;--p-cbd5e1:#cbd5e1;--p-d1d5db:#d1d5db;--p-d4d4d8:#d4d4d8;--p-dbeafe:#dbeafe;--p-dc2626:#dc2626;--p-dcfce7:#dcfce7;--p-e5e5e5:#e5e5e5;--p-e5e7eb:#e5e7eb;--p-e7e7e9:#e7e7e9;--p-ebebeb:#ebebeb;--p-ecfdf3:#ecfdf3;--p-eef0f2:#eef0f2;--p-eef0f3:#eef0f3;--p-eef2ff:#eef2ff;--p-ef4444:#ef4444;--p-eff6ff:#eff6ff;--p-f1f1f2:#f1f1f2;--p-f1f5f9:#f1f5f9;--p-f3f4f6:#f3f4f6;--p-f4f4f5:#f4f4f5;--p-f5f5f5:#f5f5f5;--p-f87171:#f87171;--p-f8f9fa:#f8f9fa;--p-f9fafb:#f9fafb;--p-fafafa:#fafafa;--p-fbbf24:#fbbf24;--p-fca5a5:#fca5a5;--p-fcd34d:#fcd34d;--p-fde68a:#fde68a;--p-fecaca:#fecaca;--p-fedf89:#fedf89;--p-fee2e2:#fee2e2;--p-fef2f2:#fef2f2;--p-fef3c7:#fef3c7;--p-fffaeb:#fffaeb;--p-ffffff:#ffffff}

.section .tab-group { position: static !important; }
.section > div:first-child { position: static !important; }
input[type="number"] { text-align: left !important; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
* { margin: 0; padding: 0; box-sizing: border-box; }
/* fb2 2026-09-27: removed global :root/* colour transitions (2,500+ elements animated on every theme toggle = laggy + load flash). */
:root.dark { color-scheme: dark; }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }
/* fcstyle 2026-09-27: colour/radius tokens (light + dark) now come from /admin-tokens.css. Portal-only vars (--bg-primary, --bg-main) stay below. */
/* Dark mode: force table cell text to use theme color */
:root.dark .table td,
:root.dark .data-table td,
:root.dark #invoices-table td,
:root.dark #ff-income-tbody td,
:root.dark #ff-outgoing-tbody td,
:root.dark #ff-peter-reimb-tbody td,
:root.dark #ff-pnl-tbody td {
color: var(--text-primary);
}
:root.dark .table td a[style*="color:#334155"],
:root.dark #invoices-table a[style*="color:#334155"] {
color: var(--text-primary) !important;
}
:root.dark svg[style*="color:#64748b"] {
color: var(--text-secondary) !important;
}
:root.dark .status-badge[style*="background: #e8f5e9"] {
background: var(--p-065f46) !important;
color: var(--p-6ee7b7) !important;
}
:root.dark .status-badge[style*="background: #e3f2fd"] {
background: var(--p-1e3a5f) !important;
color: var(--p-93c5fd) !important;
}
:root.dark .status-badge[style*="background: #fff8e1"] {
background: var(--p-78350f) !important;
color: var(--p-fcd34d) !important;
}
:root.dark #invoices-table td span[style*="color:#2e7d32"] {
color: var(--p-6ee7b7) !important;
}
:root.dark #invoices-table td span[style*="color:#1565c0"] {
color: var(--p-93c5fd) !important;
}
:root.dark #invoices-table td svg[stroke="#2e7d32"] {
stroke: var(--p-6ee7b7);
}
:root.dark #invoices-table td svg[stroke="#1565c0"] {
stroke: var(--p-93c5fd);
}
:root.dark span[style*="color:#6b7280"] {
color: var(--text-secondary) !important;
}
:root.dark span[style*="background:#f3f4f6"][style*="color:#6b7280"] {
background: var(--bg-hover) !important;
color: var(--text-secondary) !important;
}
:root.dark td[style*="color:#22c55e"] { color: var(--p-4ade80) !important; }
:root.dark td[style*="color:#ef4444"] { color: var(--p-f87171) !important; }
:root.dark td[style*="color:#f59e0b"] { color: var(--p-fbbf24) !important; }
:root.dark .card[style*="border-top"] div[style*="color:var(--text-muted)"] { color: var(--text-muted); }
:root.dark .alert-row.alert-danger { background: var(--p-3b1a1a); color: var(--p-fca5a5); border-color: var(--p-7f1d1d); }
:root.dark .alert-row.alert-warning { background: var(--p-3b2f1a); color: var(--p-fcd34d); border-color: var(--p-78350f); }
:root.dark .alert-row.alert-success { background: var(--p-1a3b2a); color: var(--p-6ee7b7); border-color: var(--p-065f46); }
:root.dark .alert-row.alert-info { background: var(--p-1a2a3b); color: var(--p-93c5fd); border-color: var(--p-1e3a5f); }
:root.dark .btn { background: var(--p-4b5563); color: var(--p-f9fafb); }
:root.dark .btn:hover { opacity: 0.9; }
:root.dark .btn-success { background: var(--success); color: #fff; }
:root.dark .btn-danger { background: var(--danger); color: #fff; }
:root.dark .btn-sm { color: var(--p-f9fafb); }
:root.dark select, :root.dark input[type="text"], :root.dark input[type="number"], :root.dark input[type="date"], :root.dark textarea {
background: var(--p-374151); color: var(--p-f9fafb); border-color: var(--p-4b5563);
}
:root.dark .client-selector { background: var(--bg-card); }
:root.dark .client-selector select { background: var(--p-374151); color: var(--p-f9fafb); border-color: var(--p-4b5563); }
:root.dark .draft-banner { background: var(--p-78350f); color: var(--p-fcd34d); }
:root.dark .status-paused { background: var(--p-78350f); color: var(--p-fbbf24); }
:root.dark .status-inactive { background: var(--p-7f1d1d); color: var(--p-fca5a5); }
:root.dark .metric-change.down { background: var(--p-3b1a1a); }
:root.dark .metric-change.up { background: var(--p-1a3b2a); }
:root.dark .stage-step.completed { background: var(--p-1a3b2a); border-color: var(--success); color: var(--success); }
:root.dark .stage-step.current { background: var(--p-1a2a3b); border-color: var(--info); color: var(--info); }
:root.dark .stage-step.pending { background: var(--bg-card); }
:root.dark .category-badge-bundle { background: var(--p-1e3a5f) !important; color: var(--p-93c5fd) !important; }
:root.dark .category-badge-product { background: var(--p-374151) !important; color: var(--p-d1d5db) !important; }
:root.dark .category-badge-packaging { background: #831843 !important; color: #f9a8d4 !important; }
.export-btn-group { display: inline-flex; gap: 4px; margin-left: 8px; }
.export-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; font-size: 11px; font-weight: 500; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text-secondary); cursor: pointer; font-family: Inter, sans-serif; transition: all 0.15s; white-space: nowrap; }
.export-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }
.export-btn svg { flex-shrink: 0; }
:root.dark .export-btn { background: var(--p-374151); color: var(--p-d1d5db); border-color: var(--p-4b5563); }
:root.dark .export-btn:hover { background: var(--p-4b5563); color: var(--p-f9fafb); border-color: var(--accent); }
.missing-data-card {
display: flex;
align-items: flex-start;
gap: 14px;
padding: 16px 18px;
background: var(--bg-card);
border: 1px solid var(--border);
border-left: 4px solid var(--warning);
border-radius: var(--radius);
box-shadow: var(--shadow);
transition: box-shadow 0.15s ease;
}
.missing-data-card:hover { box-shadow: var(--shadow-hover); }
.missing-data-card .mda-icon { flex-shrink: 0; margin-top: 2px; }
.missing-data-card .mda-body { flex: 1; min-width: 0; }
.missing-data-card .mda-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.missing-data-card .mda-link {
display: inline-flex; align-items: center; gap: 5px;
font-size: 12px; font-weight: 600; color: var(--warning);
cursor: pointer; text-decoration: none; border: none; background: none; padding: 0;
}
.missing-data-card .mda-link:hover { text-decoration: underline; }
:root.dark .missing-data-card { border-left-color: var(--p-fbbf24); }
:root.dark .missing-data-card .mda-link { color: var(--p-fbbf24); }
.sh-item {
display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
background: var(--bg-body); min-width: 0;
}
.sh-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.sh-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.sh-dot {
width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
margin-bottom: 2px;
}
.sh-dot-green { background: var(--p-22c55e); box-shadow: 0 0 4px rgba(34,197,94,0.4); }
.sh-dot-red { background: var(--p-ef4444); box-shadow: 0 0 4px rgba(239,68,68,0.4); }
.sh-dot-yellow { background: #f59e0b; box-shadow: 0 0 4px rgba(245,158,11,0.4); }
.sh-dot-neutral { background: var(--text-muted); opacity: 0.4; }
:root.dark .sh-item { background: var(--bg-secondary); }
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.table th {
  padding: 13px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--p-374151);
  text-transform: none;
  letter-spacing: normal;
  background: var(--p-f9fafb);
  border-bottom: 1px solid var(--p-e5e7eb);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: transparent; transition: background 0.15s; }
.table td, .data-table td, #crm-table td, #crm-table-body td, .peter-table td {
color: var(--text-primary) !important;
font-size: 13px;
white-space: nowrap;
}
.table th, .data-table th {
position: static !important;
white-space: nowrap;
}
#crm-table td[style*="color:var(--success)"], #crm-table td[style*="color:var(--danger)"],
#crm-table td[style*="color: var(--success)"], #crm-table td[style*="color: var(--danger)"] {
color: inherit !important;
}
#crm-table select, #crm-table-body select, .peter-table select {
border: 1px solid var(--border);
border-radius: 8px;
padding: 6px 10px;
font-family: 'Inter', sans-serif;
font-size: 13px;
background: var(--bg-card) url("data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%239ca3af" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>") no-repeat right 8px center;
color: var(--text-primary);
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding-right: 28px;
cursor: pointer;
}
#crm-table input[type="date"], #crm-table-body input[type="date"], .peter-table input[type="date"] {
border: 1px solid var(--border);
border-radius: 8px;
padding: 6px 10px;
font-family: 'Inter', sans-serif;
font-size: 13px;
background: var(--bg-card);
color: var(--text-primary);
cursor: pointer;
}
.inv-pill { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; white-space: nowrap; }
.inv-pill-healthy { background: var(--p-dcfce7); color: var(--p-166534); }
.inv-pill-low { background: var(--p-fef3c7); color: var(--p-92400e); }
.inv-pill-critical { background: var(--p-fee2e2); color: var(--p-991b1b); }
.inv-pill-oos { background: var(--p-7f1d1d); color: var(--p-fecaca); }
.inv-pill-draft { background: var(--bg-hover); color: var(--text-muted); }
.inv-pill-submitted { background: var(--p-dbeafe); color: var(--p-1e40af); }
.inv-pill-confirmed { background: #fed7aa; color: #9a3412; }
.inv-pill-transit { background: #e9d5ff; color: #6b21a8; }
.inv-pill-delivered { background: var(--p-dcfce7); color: var(--p-166534); }
.inv-pill-cancelled { background: var(--p-fee2e2); color: var(--p-991b1b); }
:root.dark .inv-pill-healthy { background: var(--p-065f46); color: var(--p-6ee7b7); }
:root.dark .inv-pill-low { background: var(--p-78350f); color: var(--p-fcd34d); }
:root.dark .inv-pill-critical { background: var(--p-7f1d1d); color: var(--p-fca5a5); }
:root.dark .inv-pill-oos { background: #450a0a; color: var(--p-fca5a5); }
:root.dark .inv-pill-draft { background: var(--p-374151); color: var(--p-9ca3af); }
:root.dark .inv-pill-submitted { background: var(--p-1e3a5f); color: var(--p-93c5fd); }
:root.dark .inv-pill-confirmed { background: #7c2d12; color: #fdba74; }
:root.dark .inv-pill-transit { background: #4c1d95; color: #c4b5fd; }
:root.dark .inv-pill-delivered { background: var(--p-065f46); color: var(--p-6ee7b7); }
:root.dark .inv-pill-cancelled { background: var(--p-7f1d1d); color: var(--p-fca5a5); }
.inv-bundle-row { background: transparent; }
:root.dark .inv-bundle-row { background: transparent; }
.inv-client-header { background: var(--bg-card); cursor: pointer; }
.inv-client-header:hover { background: var(--bg-hover); }
.inv-client-header td { font-weight: 600; padding: 10px 12px !important; }
.inv-totals-row { font-weight: 600; border-top: 2px solid var(--border); }
.inv-totals-row td { padding: 8px 12px !important; }
.inv-product-img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.discovery-brand-row { background: var(--bg-card); font-weight: 600; cursor: pointer; }
.discovery-brand-row:hover { background: var(--bg-card); }
.discovery-brand-row td { padding: 10px 12px; }
.discovery-toggle { cursor: pointer; display: inline-block; transition: transform 0.2s ease; user-select: none; font-size: 12px; color: var(--text-muted); width: 20px; text-align: center; }
.discovery-toggle.expanded { transform: rotate(90deg); }
.discovery-product-row td { padding: 6px 12px; font-size: 12px; text-align: left; }
.discovery-product-row:hover { background: transparent !important; }
:root.dark .discovery-brand-row { background: var(--bg-card); }
:root.dark .discovery-brand-row:hover { background: var(--bg-card); }
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
background: var(--bg-body);
color: var(--text-primary);
height: 100vh;
display: flex;
font-size: 14px;
overflow: hidden;
line-height: 1.5;
}

/* Toggle switch for email templates */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--p-d1d5db); border-radius: 24px; transition: .3s; }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-switch input:checked + .toggle-slider { background: var(--p-22c55e); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
/* DNS record row */
.dns-record-row { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 8px; padding: 12px 16px; }
.dns-record-row .dns-type { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.dns-record-row .dns-host { font-size: 13px; font-weight: 500; color: var(--text-primary); font-family: 'SF Mono', Monaco, Consolas, monospace; word-break: break-all; }
.dns-record-row .dns-value { font-size: 12px; color: var(--text-secondary); font-family: 'SF Mono', Monaco, Consolas, monospace; word-break: break-all; margin-top: 2px; }
.dns-record-row .dns-status-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.sidebar::-webkit-scrollbar { display:none; }
.sidebar {
width: 240px;
background: var(--bg-sidebar);
scrollbar-width: none;
-ms-overflow-style: none;
border-right: 1px solid var(--border-light);
display: flex;
flex-direction: column;
overflow-y: auto;
position: relative;
}
.sidebar-version-container {
position: sticky;
bottom: 0;
left: 0;
right: 0;
z-index: 5;
pointer-events: none;
}
.sidebar-version-gradient {
height: 60px;
background: linear-gradient(to bottom, transparent, var(--bg-sidebar) 70%);
}
.sidebar-version-badge {
background: var(--bg-sidebar);
padding: 8px 20px 12px;
font-size: 11px;
color: var(--text-muted);
font-weight: 500;
}
.logo {
padding: 18px 20px 32px 20px;
text-align: left;
display: flex;
align-items: center;
min-height: 60px;
box-sizing: border-box;
}
.logo svg { display: block; width: 100%; height: auto; }
.logo h1 { font-size: 18px; font-weight: 700; margin-bottom: 0; color: var(--text-primary); letter-spacing: -0.3px; }
.logo .subtitle { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.nav-section-label {
padding: 18px 24px 6px;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--text-muted);
}
.nav-item {
padding: 10px 16px;
cursor: pointer;
transition: all 0.15s ease;
display: flex;
align-items: center;
gap: 10px;
font-weight: 500;
color: var(--text-secondary);
border-radius: 10px;
margin: 2px 12px;
font-size: 14px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--p-ebebeb); color: var(--text-primary); font-weight: 600; }
:root.dark .nav-item.active { background: var(--p-2d3748); color: var(--p-ffffff); }
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; min-height: 0; background: var(--bg-body) !important; }
.header {
padding: 24px 0 16px;
background: var(--bg-light);
border-bottom: 1px solid var(--border-light);
display: flex;
justify-content: space-between;
align-items: center;
}
.header h2 { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.draft-banner {
background: #fff3cd;
color: #856404;
padding: 6px 14px;
border-radius: 6px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
#dark-mode-toggle:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.client-hover-card {
position: fixed;
z-index: 1000;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 12px;
padding: 16px;
min-width: 300px;
box-shadow: 0 8px 32px rgba(0,0,0,0.12);
pointer-events: none;
opacity: 0;
transform: translateY(10px);
transition: opacity 0.2s ease, transform 0.2s ease;
}
.client-hover-card.visible {
opacity: 1;
transform: translateY(0);
}
.client-hover-card h4 {
margin: 0 0 12px 0;
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
}
.client-hover-card .hover-metric {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
font-size: 13px;
}
.client-hover-card .hover-metric-label {
color: var(--text-secondary);
}
.client-hover-card .hover-metric-value {
color: var(--text-primary);
font-weight: 600;
}
.client-hover-card .hover-stages {
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid var(--border-light);
}
.client-hover-card .hover-stages-title {
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 6px;
}
.client-hover-card .hover-stage-item {
display: flex;
justify-content: space-between;
font-size: 12px;
margin-bottom: 4px;
}
.content { flex: 1; padding: 0 40px 24px; overflow-y: auto; overflow-x: hidden; background: var(--bg-light); min-width: 0; max-width: 100%; min-height: 0; }
.welcome-section { margin-bottom: 24px; }
.welcome-text { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; letter-spacing: -0.5px; }
.welcome-subtitle { font-size: 16px; color: var(--text-muted); font-weight: 400; }
.metrics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 16px;
margin-bottom: 24px;
}
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 24px;
transition: all 0.2s ease;
box-shadow: var(--shadow);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card h3 {
color: var(--text-secondary);
margin-bottom: 14px;
font-size: 13px;
font-weight: 500;
display: flex;
align-items: center;
gap: 8px;
letter-spacing: 0.01em;
}
.metric { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; line-height: 1; letter-spacing: -0.5px; }
.metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.metric-change { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; }
.metric-change.up { color: var(--accent-dark); background: var(--accent-light); }
.metric-change.down { color: var(--danger); background: var(--p-fef2f2); }
.metric-change.flat { color: var(--text-muted); background: var(--bg-hover); }
.btn {
background: var(--primary); color: white; border: none; padding: 10px 20px;
border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 13px;
transition: all 0.15s ease; margin-right: 6px;
display: inline-flex; align-items: center; gap: 6px;
}
.btn svg, .btn img { vertical-align: middle; flex-shrink: 0; }
.btn:hover { opacity: 0.85; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.section { display: none; max-width: 100%; box-sizing: border-box; min-width: 0; padding: 0 0 24px 0; margin-top: 0; background: var(--bg-primary, #fff); }
.section.active { display: block; }
.section .card { min-width: 0; overflow: hidden; word-break: break-word; overflow-wrap: break-word; }
/* Fix 1: Supplier product name ellipsis */
#supp-products-table td:nth-child(4) { max-width: 250px; overflow: hidden;  white-space: nowrap; }
#supp-mapping-table td:nth-child(3) { max-width: 250px; overflow: hidden;  white-space: nowrap; }
/* Fix 1: Supplier tab scrolling */
#suppliers .tab-content { overflow-y: auto; max-height: calc(100vh - 180px); }
/* Fix 3: Replacements tab - reduce inner spacing */
#returns > div { padding-top: 0 !important; }
#returns .welcome-section { margin-bottom: 4px; }
/* Fix 4: PO Lifecycle tab compact spacing */
#po-lifecycle > .card:first-child { margin-bottom: 10px; }
#po-lifecycle #po-alerts-panel { margin-bottom: 10px; }
#po-lifecycle #po-table-container { margin-top: 0; }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.data-table th { background: var(--p-f9fafb); color: var(--p-374151); font-weight: 600; font-size: 14px; text-transform: none; letter-spacing: normal; }
.data-table tr:hover { background: transparent; }
.table-container { overflow-x: auto; width: 100%; }
.table {
width: 100%; border-collapse: collapse; margin-top: 15px;
background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
}
.table th, .table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.table th { background: var(--p-f9fafb); color: var(--p-374151); font-weight: 600; font-size: 14px; text-transform: none; letter-spacing: normal; position: static; }
.table tr:hover { background: transparent; }
.table-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 12px;
overflow: hidden;
}
.table-card .table { margin-top: 0; }
.table-card .table th { background: var(--bg-body); }
.table-card .table th:first-child { padding-left: 16px; }
.table-card .table td:first-child { padding-left: 16px; }
.table-card .table th:last-child { padding-right: 16px; }
.table-card .table td:last-child { padding-right: 16px; }

.table select, #crm-table-body select, .discovery-brand-row select, .crm-table select {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
font-size: 13px;
border: 1px solid var(--border);
border-radius: 8px;
padding: 6px 10px;
background: var(--bg-card);
color: var(--text-primary, var(--text));
cursor: pointer;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
padding-right: 28px;
}
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-active { background: var(--accent-light); color: var(--accent-dark); }
.status-paused { background: var(--p-fef3c7); color: #d97706; }
.status-inactive { background: var(--p-fef2f2); color: var(--danger); }
.status-archived { background: var(--bg-hover); color: var(--text-muted); }
.info-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 18px; }
.info-card h4 { margin-bottom: 12px; color: var(--text-primary); font-size: 16px; font-weight: 600; }
.info-item { margin-bottom: 8px; color: var(--text-secondary); font-size: 13px; }
.info-item strong { color: var(--text-primary); }
.engine-card {
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
background: var(--bg-card);
transition: all 0.15s;
}
.engine-card:hover { box-shadow: var(--shadow-hover); }
.engine-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); }
.engine-status { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 8px; }
.engine-dot { width: 8px; height: 8px; border-radius: 50%; }
.engine-dot.green { background: var(--success); }
.engine-dot.yellow { background: var(--warning); }
.engine-dot.red { background: var(--danger); }
.engine-dot.gray { background: #ccc; }
.mini-metric { font-size: 20px; font-weight: 700; margin: 4px 0; }
.mini-label { font-size: 11px; color: var(--text-muted); }
.alert-row {
display: flex; align-items: flex-start; gap: 12px;
padding: 14px 16px; border-radius: 10px; margin-bottom: 8px; font-size: 13px; line-height: 1.5;
}
.alert-row.alert-danger { background: var(--p-fef2f2); color: var(--p-991b1b); border: 1px solid var(--p-fecaca); }
.alert-row.alert-warning { background: #fffbeb; color: var(--p-92400e); border: 1px solid var(--p-fde68a); }
.alert-row.alert-success { background: #f0fdf4; color: var(--p-166534); border: 1px solid var(--p-bbf7d0); }
.alert-row.alert-info { background: var(--p-eff6ff); color: var(--p-1e40af); border: 1px solid var(--p-bfdbfe); }
.alert-row strong { font-weight: 400; }
.progress-bar { width: 100%; height: 6px; background: var(--border-light); border-radius: 3px; margin: 8px 0; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.lifecycle-stage {
display: flex; align-items: center; gap: 0; margin: 15px 0;
}
.stage-step {
flex: 1; text-align: center; padding: 10px 8px;
font-size: 11px; font-weight: 600; position: relative;
border: 2px solid var(--border); background: var(--bg-light);
}
.stage-step:first-child { border-radius: 8px 0 0 8px; }
.stage-step:last-child { border-radius: 0 8px 8px 0; }
.stage-step.completed { background: #e8f5e9; border-color: var(--success); color: var(--success); }
.stage-step.current { background: #e3f2fd; border-color: var(--info); color: var(--info); }
.stage-step.pending { background: var(--bg-light); border-color: var(--border); color: var(--text-muted); }
.client-selector {
margin-bottom: 20px; padding: 12px;
background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border);
}
.client-selector select {
padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px;
background: var(--bg-light); color: var(--text-primary); font-size: 14px;
}
.loading { text-align: center; padding: 40px; color: var(--text-secondary); }
.current-version { background: var(--bg-card); border: 2px solid var(--success); border-radius: 12px; padding: 22px; margin-bottom: 25px; }
.current-version h3 { color: var(--text-primary); font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.version-status { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.version-date { color: var(--text-secondary); font-size: 13px; }
.version-description h4 { color: var(--text-primary); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.version-description p { color: var(--text-secondary); line-height: 1.5; }
.version-history h3 { color: var(--text-primary); font-size: 16px; font-weight: 600; margin-bottom: 18px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.changelog-entry-expandable { margin-bottom:8px; 
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 10px;
margin-bottom: 10px;
overflow: hidden;
}
.changelog-entry-expandable:last-child { margin-bottom: 0; }
.changelog-summary {
display: flex;
align-items: center;
gap: 10px;
padding: 14px 16px;
cursor: pointer;
transition: background 0.15s ease;
font-size: 14px;
}
.changelog-summary:hover {
background: var(--bg-hover);
}
.changelog-arrow {
font-size: 10px;
color: var(--text-muted);
width: 14px;
text-align: center;
transition: transform 0.2s ease;
display: inline-block;
}
.changelog-entry-expandable.expanded .changelog-arrow {
transform: rotate(90deg);
}
.version-title {
flex: 1;
font-weight: 600;
color: var(--text-primary);
}
.changelog-summary .version-date {
font-size: 12px;
color: var(--text-muted);
margin-right: 8px;
}
.changelog-details {
display: none;
padding: 4px 16px 16px 40px;
border-top: 1px solid var(--border-light);
}
.changelog-entry-expandable.expanded .changelog-details {
display: block;
}
.changelog-details ul {
margin: 8px 0 0 0;
padding-left: 16px;
}
.changelog-details li {
color: var(--text-secondary);
font-size: 13px;
line-height: 1.6;
margin-bottom: 5px;
}
.changelog-details li:last-child {
margin-bottom: 0;
}
.changelog-entry { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; padding: 14px 16px; }
.changelog-entry:last-child { margin-bottom: 0; }
.changelog-entry h4 { color: var(--text-primary); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.version-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.changelog-entry p { margin-bottom: 6px; color: var(--text-secondary); line-height: 1.5; font-size: 13px; }
.tab-group { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
.section h1 { margin-bottom: 4px; }
.section > .card-wrapper { margin-top: 8px; }
.tab-btn {
padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
border: 1px solid transparent; background: transparent; color: var(--text-secondary);
border-radius: 18px; transition: all 0.15s;
}
.tab-btn.active { color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.06); border-radius: 18px; font-weight: 600; }
.tab-btn:hover { color: var(--text-primary); }
.tab-btn { white-space: nowrap; flex-shrink: 0; }
.tab-content { display: none; }
.tab-content.active { display: block !important; }
.agent-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1024px) { .agent-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .agent-cards-grid { grid-template-columns: 1fr; } }
.agent-card {
background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
padding: 20px; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
display: flex; flex-direction: column; gap: 10px; position: relative;
}
.agent-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.agent-card-header { display: flex; align-items: center; gap: 12px; }
.agent-card-icon {
width: 44px; height: 44px; border-radius: 10px; background: var(--bg-body);
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.agent-card-name { font-weight: 700; font-size: 16px; color: var(--text-primary); }
.agent-card-role { font-size: 12px; color: var(--accent); font-weight: 500; }
.agent-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.agent-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.agent-card-status { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.agent-card-status .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.agent-card-freq { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.agent-card-detail {
display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
font-size: 12px; color: var(--text-secondary); line-height: 1.6;
}
.agent-card-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agent-card-detail-grid > div > .detail-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }
.agent-card-detail-grid > div > .detail-value { font-size: 12px; color: var(--text-primary); }
.agent-card.expanded { box-shadow: var(--shadow-hover); }
.agent-card-expand-hint { font-size: 11px; color: var(--text-muted); text-align: center; padding-top: 4px; }
.editable-cell { cursor: text; transition: background 0.15s; }
.editable-cell:hover { background: var(--bg-hover); }
:root.dark .editable-cell:hover { background: var(--p-374151); }
.editable-cell[contenteditable="true"] { background: var(--bg-card); outline: 2px solid var(--info); border-radius: 4px; padding: 8px 10px; }
.activity-timeline { display: flex; flex-direction: column; gap: 0; }
.activity-item {
display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
width: 32px; height: 32px; border-radius: 50%; display: flex;
align-items: center; justify-content: center; flex-shrink: 0;
font-size: 14px; color: white; margin-top: 2px;
}
.activity-icon.billing { background: var(--info); }
.activity-icon.package { background: var(--success); }
.activity-icon.arrow { background: var(--warning); }
.activity-icon.warning { background: var(--danger); }
.activity-icon.gear { background: var(--text-muted); }
.activity-content { flex: 1; }
.activity-description { color: var(--text-primary); font-size: 13px; line-height: 1.5; margin-bottom: 4px; }
.activity-timestamp { color: var(--text-muted); font-size: 11px; font-weight: 500; }
.hamburger-menu {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 8px;
border-radius: 6px;
transition: background 0.15s;
}
.hamburger-menu:hover { background: var(--bg-hover); }
.hamburger-menu svg { stroke: var(--text-primary); }
@media screen and (max-width: 767px) {
body { font-size: 13px; }

/* Toggle switch for email templates */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--p-d1d5db); border-radius: 24px; transition: .3s; }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-switch input:checked + .toggle-slider { background: var(--p-22c55e); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
/* DNS record row */
.dns-record-row { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 8px; padding: 12px 16px; }
.dns-record-row .dns-type { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.dns-record-row .dns-host { font-size: 13px; font-weight: 500; color: var(--text-primary); font-family: 'SF Mono', Monaco, Consolas, monospace; word-break: break-all; }
.dns-record-row .dns-value { font-size: 12px; color: var(--text-secondary); font-family: 'SF Mono', Monaco, Consolas, monospace; word-break: break-all; margin-top: 2px; }
.dns-record-row .dns-status-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.sidebar::-webkit-scrollbar { display:none; }
.sidebar {
position: fixed;
left: -240px;
top: 0;
height: 100vh;
z-index: 1000;
transition: left 0.3s ease;
box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}
.sidebar.open { left: 0; }
.sidebar-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 999;
}
.sidebar-overlay.open { display: block; }
.header {
padding: 12px 16px;
position: relative;
}
.header h2 { font-size: 14px; }
.hamburger-menu { display: block; }
.content { padding: 0 12px 16px; }
.welcome-text { font-size: 20px; }
.welcome-subtitle { font-size: 13px; }
.metrics-grid {
grid-template-columns: 1fr;
gap: 12px;
margin-bottom: 20px;
}
.card { padding: 14px; border-radius: 10px; }
.card h3 { font-size: 12px; }
.metric { font-size: 20px !important; }
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-card { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
.table { min-width: 600px; font-size: 12px; }
.table th, .table td { padding: 8px 6px; }
.data-table { min-width: 500px; font-size: 12px; }
.data-table th, .data-table td { padding: 8px 6px; }
#supp-grid, #ci-grid { grid-template-columns: 1fr !important; }
.supplier-compare { grid-template-columns: 1fr !important; }
.tab-group { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding-bottom: 4px; }
.tab-btn { flex-shrink: 0; padding: 8px 12px; font-size: 11px; }
.modal-content { width: 95% !important; margin: 5% auto !important; max-height: 90vh; overflow-y: auto; }
#order-lightbox > div { padding: 24px 20px !important; }
.activity-icon { width: 28px; height: 28px; font-size: 12px; }
.activity-description { font-size: 12px; }
.activity-timestamp { font-size: 10px; }
}
@media screen and (max-width: 374px) {
.content { padding: 0 8px 12px; }
.card { padding: 12px; }
.welcome-text { font-size: 18px; }
.tab-btn { padding: 6px 10px; font-size: 10px; }
}
@media screen and (min-width: 768px) and (max-width: 1023px) {
.metrics-grid { grid-template-columns: repeat(2, 1fr); }
.content { padding: 0 20px 20px; }
.data-table { font-size: 12px; }
.data-table th, .data-table td { padding: 10px 8px; }
}
@media screen and (max-width: 1023px) {
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#crm-table { min-width: 1400px; }
}
.client-totals-row td { background: var(--bg-card) !important; }
.peter-client-group-header td {
background: transparent;
font-weight: 600; font-size: 13px;
padding: 10px 12px 6px 12px;
border-top: 2px solid var(--border);
border-bottom: none;
color: var(--text-primary);
}
:root.dark .peter-client-group-header td { background: transparent; }
#peter-sm-table th { text-align: left; font-size: 14px; padding: 13px 16px; background: var(--p-f9fafb); color: var(--p-374151); font-weight: 600; text-transform: none; letter-spacing: normal; border-bottom: 1px solid var(--p-e5e7eb); white-space: nowrap; }
#peter-sm-table td { text-align: left; font-size: 13px; padding: 10px 14px; color: var(--text-primary); border-bottom: 1px solid var(--border-light); }
#peter-sm-table tbody tr:hover { background: var(--bg-hover); }
#peter-sourcing-table th { text-align: left; font-size: 14px; padding: 13px 16px; background: var(--p-f9fafb); color: var(--p-374151); font-weight: 600; text-transform: none; letter-spacing: normal; border-bottom: 1px solid var(--p-e5e7eb); }
#peter-sourcing-table td { text-align: left; font-size: 13px; padding: 10px 14px; color: var(--text-primary); border-bottom: 1px solid var(--border-light); white-space: nowrap; }
#peter-sourcing-table td:nth-child(2) { max-width: 220px; overflow: hidden;  }
#crm-table td:nth-child(2), .inv-table td:nth-child(2), .supp-table td:nth-child(2) { max-width: 220px; overflow: hidden;  }
#peter-sourcing-table th { white-space: nowrap; }
.peter-lang-toggle {
display: inline-flex;
align-items: center;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 20px;
padding: 2px;
font-family: 'Inter', sans-serif;
font-size: 12px;
font-weight: 500;
cursor: pointer;
user-select: none;
gap: 0;
}
.peter-lang-toggle .lang-opt {
padding: 4px 12px;
border-radius: 16px;
color: var(--text-muted);
transition: all 0.2s ease;
white-space: nowrap;
}
.peter-lang-toggle .lang-opt.active {
background: var(--accent);
color: #fff;
font-weight: 600;
}
.peter-lang-toggle .lang-opt:not(.active):hover {
color: var(--text-primary);
}
.peter-costopt-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.peter-costopt-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; padding: 20px; }
.peter-costopt-card .card-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.peter-costopt-card .card-value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.peter-costopt-card .card-value.green { color: var(--success); }
.peter-costopt-card .card-value.warning { color: var(--warning); }
.peter-costopt-row-green { background: rgba(34,197,94,0.04); }
.peter-costopt-row-yellow { background: rgba(234,179,8,0.06); }
.peter-costopt-row-red { background: rgba(239,68,68,0.04); }
.peter-costopt-motivational { background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(59,130,246,0.06)); border: 1px solid var(--border-light); border-radius: 10px; padding: 14px 20px; margin-bottom: 16px; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.peter-costopt-history { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; margin-top: 20px; overflow: hidden; }
.peter-costopt-history-header { padding: 14px 20px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text-primary); }
.peter-costopt-history-header:hover { background: var(--bg-hover); }
.peter-costopt-history-body { padding: 0 20px 16px; }
.peter-priority-high { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--p-ef4444); background: var(--p-fef2f2); }
.peter-priority-med { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; color: #eab308; background: #fefce8; }
.peter-priority-low { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--text-secondary); background: var(--bg-secondary); }
#peter-sourcing-table tbody tr:hover { background: var(--bg-hover); }
#peter-sourcing-table tbody tr:not(.peter-client-group-header):not(.peter-client-group-spacer) td:first-child { padding-left: 16px; }
#peter-sourcing-table select { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--bg-card); color: var(--text-primary); cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 28px; }
#peter-sourcing-table input[type="date"] { font-family: 'Inter', sans-serif; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--bg-card); color: var(--text-primary); }
.peter-currency-cell { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.peter-currency-cell .prefix { color: var(--text-muted); font-weight: 500; font-size: 11px; pointer-events: none; user-select: none; }
.peter-currency-cell .cell-value { cursor: text; min-width: 40px; padding: 2px 4px; border-radius: 4px; }
.peter-currency-cell .cell-value:hover { background: rgba(34,197,94,0.05); }
.peter-currency-cell .cell-value[contenteditable="true"] { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg-card); }
.btn-peter-sourced {
background: var(--accent); color: white; border-radius: 6px;
padding: 6px 14px; font-size: 12px; font-weight: 500;
border: none; cursor: pointer; font-family: inherit;
transition: opacity 0.15s, transform 0.1s;
}
.btn-peter-sourced:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-peter-return {
background: transparent; border: 1px solid var(--danger);
color: var(--danger); border-radius: 6px;
padding: 6px 14px; font-size: 12px; font-weight: 500;
cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.btn-peter-return:hover { background: var(--danger); color: white; }
/* Split Test Columns */
.st-peter-col { background: rgba(59,130,246,0.06) !important; }
.st-xiaofu-col { background: rgba(234,179,8,0.06) !important; }
.st-peter-hdr { background: rgba(59,130,246,0.12) !important; color: var(--p-2563eb) !important; }
.st-xiaofu-hdr { background: rgba(234,179,8,0.12) !important; color: var(--p-b45309) !important; }
.st-winner-badge { display:inline-block;padding:2px 8px;border-radius:10px;font-size:10px;font-weight:600;letter-spacing:0.3px; }
.st-winner-peter { background:rgba(59,130,246,0.15);color:var(--p-2563eb); }
.st-winner-xiaofu { background:rgba(234,179,8,0.15);color:var(--p-b45309); }
.st-winner-tie { background:rgba(107,114,128,0.15);color:var(--p-6b7280); }
.st-mark-done { padding:4px 10px;border-radius:6px;font-size:11px;font-weight:500;cursor:pointer;border:1px solid var(--border);background:var(--bg-card);color:var(--text-secondary); }
.st-mark-done:hover { background:var(--accent);color:#fff;border-color:var(--accent); }
.st-mark-done.done { background:var(--p-10b981);color:#fff;border-color:var(--p-10b981);cursor:default; }
/* Peter Help Guide Modal */
.peter-help-btn { display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;border:1.5px solid var(--border);background:var(--bg-card);color:var(--text-muted);cursor:pointer;font-size:14px;font-weight:600;transition:all 0.15s;margin-left:8px;flex-shrink:0; }
.peter-help-btn:hover { border-color:var(--accent);color:var(--accent);background:rgba(99,102,241,0.06); }
.peter-help-overlay { position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:9999;display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:all 0.2s; }
.peter-help-overlay.active { opacity:1;visibility:visible; }
.peter-help-modal { background:var(--bg-card);border-radius:16px;width:640px;max-width:92vw;max-height:85vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,0.2);padding:0;transform:translateY(10px);transition:transform 0.2s; }
.peter-help-overlay.active .peter-help-modal { transform:translateY(0); }
.peter-help-modal-header { padding:24px 28px 16px;border-bottom:1px solid var(--border-light);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:var(--bg-card);z-index:1;border-radius:16px 16px 0 0; }
.peter-help-modal-header h2 { font-size:18px;font-weight:700;color:var(--text-primary);margin:0;display:flex;align-items:center;gap:10px; }
.peter-help-modal-close { width:32px;height:32px;border-radius:8px;border:none;background:var(--bg-hover);color:var(--text-muted);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;transition:all 0.15s; }
.peter-help-modal-close:hover { background:var(--danger);color:white; }
.peter-help-modal-body { padding:20px 28px 28px; }
.peter-help-section { margin-bottom:20px; }
.peter-help-section:last-child { margin-bottom:0; }
.peter-help-section h3 { font-size:14px;font-weight:600;color:var(--accent);margin:0 0 8px;display:flex;align-items:center;gap:6px; }
.peter-help-section p, .peter-help-section li { font-size:13px;color:var(--text-primary);line-height:1.65;margin:0; }
.peter-help-section ul { padding-left:18px;margin:4px 0 0; }
.peter-help-section li { margin-bottom:4px; }
.peter-help-tip { background:var(--bg-hover);border:1px solid var(--border);border-radius:10px;padding:12px 16px;margin-top:12px;font-size:12px;color:var(--text-primary);line-height:1.6; }
.peter-help-tip strong { color:var(--text-primary); }
.peter-help-field-grid { display:grid;grid-template-columns:140px 1fr;gap:6px 12px;margin-top:8px;font-size:12px; }
.peter-help-field-label { font-weight:600;color:var(--text-primary); }
.peter-help-field-desc { color:var(--text-primary); }
.btn-bundle-mapped {
background: var(--accent); color: white; border-radius: 6px;
padding: 5px 12px; font-size: 11px; font-weight: 500;
border: none; cursor: pointer; font-family: inherit;
transition: opacity 0.15s, transform 0.1s; white-space: nowrap;
}
.btn-bundle-mapped:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-bundle-unmap {
background: transparent; border: 1px solid var(--danger);
color: var(--danger); border-radius: 6px;
padding: 5px 12px; font-size: 11px; font-weight: 500;
cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap;
}
.btn-bundle-unmap:hover { background: var(--danger); color: white; }
#orders-purchase-orders td { white-space: nowrap; }
/* ── Unified Login Styling ── */
@keyframes loginFadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.unified-login {
position:fixed; inset:0; z-index:10000;
display:flex; align-items:center; justify-content:center; flex-direction:column;
background: var(--bg-body);
font-family:'Inter','Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,sans-serif;
min-height:100vh;
}
.unified-login .login-card {
width:100%; max-width:400px; padding:48px 40px 36px;
background:transparent; backdrop-filter:none; -webkit-backdrop-filter:none;
border:none; border-radius:16px;
box-shadow:none;
animation: loginFadeIn 0.6s ease-out both;
}
.unified-login .login-logo { text-align:center; margin-bottom:36px; display:flex; justify-content:center; }
.unified-login .login-logo .logo-main {
font-size:28px; font-weight:700; color:var(--text-primary); letter-spacing:-0.5px;
font-family:'Plus Jakarta Sans','Inter',sans-serif;
}
.unified-login .login-logo .logo-sub { font-weight:300; color:var(--p-6b7280); }
.unified-login .login-label {
display:block; font-size:13px; font-weight:500;
color:var(--text-secondary); margin-bottom:6px; text-align:left;
}
.unified-login .login-input {
width:100%; padding:12px 16px; font-size:14px;
background:var(--bg-card); border:1px solid var(--border);
border-radius:12px; color:var(--text-primary); outline:none; transition:all 0.2s ease;
font-family:inherit; box-sizing:border-box;
}
.unified-login .login-input::placeholder { color:var(--p-9ca3af); }
.unified-login .login-input:focus {
border-color:#6b9ee8; background:var(--bg-card);
box-shadow:0 0 0 3px rgba(107,158,232,0.15);
}
.unified-login .login-field { margin-bottom:20px; }
.unified-login .login-remember {
display:none; align-items:center; gap:8px; margin-bottom:24px;
font-size:13px; color:var(--p-6b7280); cursor:pointer;
}
.unified-login .login-remember input[type=checkbox] {
accent-color:var(--accent); width:16px; height:16px; cursor:pointer;
}
.unified-login .login-btn {
width:100%; padding:14px; font-size:16px; font-weight:600;
background:var(--primary); color:var(--bg-card); border:none; border-radius:14px;
cursor:pointer; transition:all 0.2s ease; font-family:inherit;
}
.unified-login .login-btn:hover { background:var(--primary-light); transform:translateY(-1px); box-shadow:0 4px 16px rgba(0,0,0,0.2); }
.unified-login .login-btn:active { transform:translateY(0); }
.unified-login .login-error-toast {
display:none; padding:12px 16px; font-size:13px;
background:var(--p-fef2f2); border:1px solid var(--p-fecaca);
color:var(--p-dc2626); border-radius:10px; margin-bottom:20px; text-align:left;
}
.unified-login .login-forgot {
display:block; text-align:center; margin-top:20px;
font-size:12px; color:var(--p-9ca3af); text-decoration:none;
}
.unified-login .login-forgot:hover { color:var(--p-6b7280); }
.forgot-overlay {
  display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.4);
  z-index:10001;align-items:center;justify-content:center;
}
.forgot-overlay.active { display:flex; }
.forgot-card {
  background:#fff;border-radius:12px;padding:32px;width:100%;max-width:400px;margin:20px;
  box-shadow:0 8px 32px rgba(0,0,0,.12);
}
.forgot-card h3 { font-size:18px;font-weight:600;color:var(--p-1a1a1a);margin-bottom:8px; }
.forgot-card p { font-size:13px;color:var(--p-6b7280);margin-bottom:20px;line-height:1.5; }
.forgot-card .fg { margin-bottom:16px; }
.forgot-card .fg label { display:block;font-size:12px;font-weight:500;color:var(--p-6b7280);margin-bottom:6px; }
.forgot-card .fg input { width:100%;padding:10px 14px;border:1px solid var(--p-e5e7eb);border-radius:8px;font-size:13px;font-family:Inter,sans-serif;color:var(--p-1a1a1a); }
.forgot-card .fg input:focus { outline:none;border-color:var(--p-1a1a1a); }
.forgot-card .forgot-btn { width:100%;padding:12px;background:var(--p-1d1d1d);color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:600;font-family:Inter,sans-serif;cursor:pointer;transition:background .15s; }
.forgot-card .forgot-btn:hover { background:#333; }
.forgot-card .forgot-btn:disabled { opacity:.5;cursor:not-allowed; }
.forgot-card .forgot-cancel { display:block;text-align:center;font-size:13px;color:var(--p-6b7280);margin-top:16px;cursor:pointer;background:none;border:none;font-family:Inter,sans-serif;width:100%; }
.forgot-card .forgot-cancel:hover { color:var(--p-1a1a1a); }
.forgot-card .forgot-msg { font-size:12px;margin-top:12px;text-align:center;display:none; }
.forgot-card .forgot-msg.error { color:var(--p-dc2626);display:block; }
.forgot-card .forgot-msg.success { color:var(--p-16a34a);display:block; }
:root.dark .forgot-card { background:var(--bg-card);border:1px solid var(--border); }
:root.dark .forgot-card h3 { color:var(--text-primary); }
:root.dark .forgot-card p { color:var(--text-secondary); }
:root.dark .forgot-card .fg input { background:var(--p-374151);color:var(--p-f9fafb);border-color:var(--p-4b5563); }

.unified-login .login-footer { display:none;
text-align:center; margin-top:32px; font-size:11px; color:var(--p-d1d5db);
animation: loginFadeIn 0.8s ease-out 0.3s both;
}
@media screen and (max-width:380px) {
.unified-login .login-card { max-width:100%; margin:0 16px; padding:36px 24px 28px; border-radius:12px; }
.unified-login .login-logo .logo-main { font-size:24px; }
}
#login-screen, #app-container { display: none !important; }
.has-token #app-container { display: flex !important; }
.has-token #login-screen { display: none !important; }
.no-token #login-screen { display: flex !important; }
.no-token #app-container { display: none !important; }
/* ── Mobile responsiveness enhancements ── */
/* Touch-friendly minimum sizes */
@media screen and (max-width: 767px) {
.btn, .btn-sm, .tab-btn, button { min-height: 44px; min-width: 44px; }
.nav-item { min-height: 44px; display: flex; align-items: center; }
input, select, textarea { min-height: 44px; font-size: 16px !important; }
/* Peter tables responsive */
#peter-sm-table, #peter-sourcing-table { min-width: 600px; font-size: 12px; }
#orders-purchase-orders { min-width: 700px; }
/* Prevent horizontal body overflow */
html, body { overflow-x: hidden; }
.content { overflow-x: hidden; }
/* Stack header controls */
.header { flex-wrap: wrap; gap: 8px; }
.header-controls { width: 100%; justify-content: flex-end; }
/* Finance view buttons wrap */
div[style*="display:flex"][style*="gap"] { flex-wrap: wrap !important; }
}
/* Extra-small screens (≤480px) */
@media screen and (max-width: 480px) {
body { font-size: 12px; }
.content { padding: 0 12px 12px; }
.card { padding: 12px; }
.welcome-text { font-size: 18px; }
.welcome-subtitle { font-size: 13px; }
.header h2 { font-size: 13px; }
.tab-btn { padding: 8px 10px; font-size: 11px; }
.modal-content { width: 98% !important; margin: 2% auto !important; padding: 12px !important; }
.table, .data-table { font-size: 11px; }
.table th, .table td, .data-table th, .data-table td { padding: 6px 4px; }
.metrics-grid { gap: 8px; }
}
/* ── Enhanced Mobile Optimisation (2026-03-18) ── */
/* iOS text size adjust fix */
html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
/* Make ALL tables scrollable on mobile via parent overflow */
@media screen and (max-width: 767px) {
/* Cards containing tables should scroll */
.card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Inline tables in modals */
.modal table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Ensure no horizontal body overflow */
html, body { max-width: 100vw; }
/* Touch-friendly: links and interactive elements */
a, .clickable, [onclick] { min-height: 44px; }
/* Prevent zoom on input focus (iOS) */
input[type="text"], input[type="email"], input[type="password"], 
input[type="number"], input[type="search"], input[type="tel"],
input[type="url"], select, textarea {
font-size: 16px !important;
}
/* Login page: full-width on mobile */
.unified-login .login-card { 
max-width: 100% !important; 
margin: 0 12px !important; 
padding: 32px 20px 24px !important;
}
.unified-login .login-input {
min-height: 48px;
font-size: 16px !important;
padding: 12px 16px;
}
.unified-login .login-btn, .unified-login button[type="submit"] {
min-height: 48px;
font-size: 16px;
}
/* Sticky header on mobile for context */
.header {
position: sticky;
top: 0;
z-index: 50;
background: var(--bg-light);
}
}
@media screen and (max-width: 374px) {
.unified-login .login-card {
margin: 0 8px !important;
padding: 24px 16px 20px !important;
}
}

/* Orders tab spacing fix */
#orders .metrics-grid { margin-bottom: 20px; }
#orders .card { margin-bottom: 20px; }
#orders .tab-content { margin-top: 12px; }
#orders .tab-group { margin-bottom: 12px; }
#orders #po-lifecycle-action-bar { margin-top: 8px; }
#orders h3 { margin-top: 12px; margin-bottom: 8px; }
/* Consistent spacing for all sections */
.section .metrics-grid { margin-bottom: 12px; }
.section > .card { margin-bottom: 20px; }

/* Fix 5: All finance numbers black */
#profit .metric, #profit .card .metric,
#finance-pl .metric, #finance-pl .card .metric,
#fin-pl .metric, #fin-pl .card .metric,
#profit td, #finance-pl td, #fin-pl td {
  color: var(--text-primary) !important;
}
#profit span[style*="color:#22c55e"], #profit span[style*="color:#ef4444"],
#profit span[style*="color:var(--success)"], #profit span[style*="color:var(--danger)"],
#finance-pl span[style*="color:#22c55e"], #finance-pl span[style*="color:#ef4444"],
#finance-pl span[style*="color:var(--success)"], #finance-pl span[style*="color:var(--danger)"],
#fin-pl span[style*="color:#22c55e"], #fin-pl span[style*="color:#ef4444"],
#fin-pl span[style*="color:var(--success)"], #fin-pl span[style*="color:var(--danger)"] {
  color: var(--text-primary) !important;
}
/* Peter lang toggle in header */
#peter-lang-toggle-header {
  margin-right: 4px;
}

/* New Replacement button should be black not green */
#returns .btn-success, #returns [style*="background:#22c55e"],
#returns [style*="background:var(--accent)"] {
}

/* === ALFIE CLEAN CSS FIX v2 === */
/* Consistent spacing: content starts 16px below header, no excessive gaps */

.section .tab-group { margin-bottom: 12px; }
.section > .card { margin-bottom: 16px; }
#returns > div:first-child { margin-top: 0; }

/* Consistent section spacing */
.content > .section { padding-top: 16px; }
.header { padding: 24px 0 16px; }
#profit .tab-group { margin-bottom: 12px; }
#profit > div:first-child { margin-bottom: 0; }

/* Match content padding for sections outside .content */
.main-content > .section:not(.content .section) { padding-left: 40px; padding-right: 40px; }
/* ===== DARK MODE COMPREHENSIVE AUDIT FIX - 2026-03-19 ===== */

/* 1. Define missing CSS variables for both modes */
:root {
--bg-primary: var(--p-ffffff);
--bg-main: var(--p-f9fafb);
}
:root.dark {
--bg-primary: var(--p-1f2937);
--bg-main: var(--p-111827);
}

/* 2. Clara & Flo sections have hardcoded background:#fff - override */
:root.dark #clara,
:root.dark #email-flows {
background: var(--bg-primary) !important;
}

/* 3. Invoice preview - hardcoded white bg and #1a1a1a text */
:root.dark #invoice-preview-content {
background: var(--p-1f2937) !important;
color: var(--p-f9fafb) !important;
border-color: var(--p-374151) !important;
}
:root.dark #invoice-preview-content div[style*="color:#1a1a1a"],
:root.dark #invoice-preview-content span[style*="color:#1a1a1a"] {
color: var(--p-f9fafb) !important;
}
:root.dark #invoice-preview-content span[style*="color:#9ca3af"] {
color: var(--p-9ca3af) !important;
}
:root.dark #invoice-preview-content span[style*="color:#6b7280"] {
color: var(--text-secondary) !important;
}
:root.dark #invoice-preview-content th[style*="background:#f9fafb"] {
background: var(--p-374151) !important;
color: var(--p-d1d5db) !important;
border-color: var(--p-4b5563) !important;
}
:root.dark #invoice-preview-content td {
color: var(--p-f9fafb) !important;
border-color: var(--p-374151) !important;
}
:root.dark #invoice-preview-content div[style*="border-top:2px solid #1a1a1a"] {
border-color: var(--p-d1d5db) !important;
}
:root.dark #invoice-preview-content div[style*="background:#f9fafb"] {
background: var(--p-374151) !important;
}
:root.dark #invoice-preview-content div[style*="color:#1a1a1a"] {
color: var(--p-f9fafb) !important;
}

/* 4. Invite accept screen - hardcoded #ffffff bg */
:root.dark #invite-accept-screen {
background: var(--bg-body) !important;
}
:root.dark #invite-accept-screen > div {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
}
:root.dark #invite-accept-screen input {
background: var(--p-374151) !important;
color: var(--p-f9fafb) !important;
border-color: var(--p-4b5563) !important;
}
:root.dark #invite-accept-screen button {
background: var(--accent) !important;
}

/* 5. Planned status badges - hardcoded #fff3cd / #856404 */
:root.dark .status-badge[style*="background: #fff3cd"] {
background: var(--p-78350f) !important;
color: var(--p-fcd34d) !important;
}

/* 6. #fc-out hardcoded color:#111 */
:root.dark #fc-out {
color: var(--text-primary) !important;
}

/* 7. Editable cell contenteditable - hardcoded bg:#fff */
:root.dark .editable-cell[contenteditable="true"] {
background: var(--p-374151) !important;
color: var(--p-f9fafb) !important;
}

/* 8. Flo wizard steps - hardcoded bg:#111 for active step */
:root.dark .ef-step[style*="background:#111"] {
background: var(--accent) !important;
}
:root.dark .ef-step.active {
background: var(--accent) !important;
color: #fff !important;
}

/* 9. Flo wizard buttons - hardcoded bg:#111 */
:root.dark button[style*="background:#111"] {
background: var(--accent) !important;
}
:root.dark button[style*="background:#0f172a"] {
background: var(--p-374151) !important;
}

/* 10. Login page dark mode */
:root.dark .unified-login {
background: var(--bg-body) !important;
}
:root.dark .unified-login .login-card {
background: var(--bg-card) !important;
border-color: var(--border) !important;
}
:root.dark .unified-login .login-input {
background: var(--p-374151) !important;
color: var(--p-f9fafb) !important;
border-color: var(--p-4b5563) !important;
}
:root.dark .unified-login .login-input::placeholder {
color: var(--p-6b7280) !important;
}
:root.dark .unified-login .login-btn {
background: var(--accent) !important;
color: #fff !important;
}
:root.dark .unified-login .login-btn:hover {
background: var(--accent-dark) !important;
}
:root.dark .unified-login .login-logo .logo-sub {
color: var(--text-secondary) !important;
}
:root.dark .unified-login .login-forgot {
color: var(--text-muted) !important;
}
:root.dark .unified-login .login-remember {
color: var(--text-secondary) !important;
}

/* 11. Modals - ensure dark backgrounds */
:root.dark .modal-content,
:root.dark [class*="modal"] > div[style*="background:white"],
:root.dark [class*="modal"] > div[style*="background:#fff"] {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
border-color: var(--border) !important;
}

/* 12. Tab buttons - ensure visible in dark mode (pill style) */
:root.dark .tab-btn {
color: var(--text-secondary);
border-color: transparent;
background: transparent;
}
:root.dark .tab-btn.active {
color: var(--text-primary);
background: var(--bg-card);
border-color: var(--border);
}
:root.dark .tab-btn:hover {
color: var(--text-primary);
}

/* 13. Section backgrounds - the fallback #fff in .section */
:root.dark .section {
background: var(--bg-primary) !important;
}

/* 14. Card styling in dark mode */
:root.dark .card {
background: var(--bg-card);
border-color: var(--border);
}

/* 15. Table headers */
:root.dark .table th,
:root.dark .data-table th {
background: var(--bg-body);
color: var(--text-secondary);
border-color: var(--border);
}

/* 16. PO form modal + supplier modals */
:root.dark #po-create-modal,
:root.dark #po-qc-modal {
background: rgba(0,0,0,0.7);
}
:root.dark #po-create-modal > div,
:root.dark #po-qc-modal > div {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
}

/* 17. Changelog section */
:root.dark #changelog .card {
#changelog-content { margin-top: 0; padding-top: 0; }
#changelog .card { padding: 16px; }
background: var(--bg-card);
}

/* 18. App management section */
:root.dark #app-management {
background: var(--bg-primary) !important;
}

/* 19. Flo email stats boxes with bg-main */
:root.dark div[style*="background:var(--bg-main)"] {
background: var(--bg-main) !important;
}

/* 20. Transition section hardcoded colors */
:root.dark #transition .card {
background: var(--bg-card);
color: var(--text-primary);
}

/* 21. Yun topup modal */
:root.dark #yun-topup-modal {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
}

/* 22. PO document viewer dark mode */
:root.dark #po-doc-container {
background: var(--bg-card) !important;
color: var(--text-primary) !important;
}
:root.dark #po-doc-content {
color: var(--text-primary) !important;
}
:root.dark #po-doc-content h2,
:root.dark #po-doc-content h3 {
color: var(--text-primary) !important;
}

/* 23. Finance P&L cards generated by core.js */
:root.dark #fc-out div[style*="background:var(--bg-card)"] {
background: var(--bg-card) !important;
border-color: var(--border) !important;
}
:root.dark #fc-out th {
background: var(--bg-body) !important;
color: var(--text-secondary) !important;
border-color: var(--border) !important;
}
:root.dark #fc-out td {
color: var(--text-primary) !important;
border-color: var(--border-light) !important;
}

/* 24. Approve button in Yun topup */
:root.dark button[style*="background:#0f172a"] {
background: var(--accent) !important;
}

/* 25. Mark as Processing button dark mode */
:root.dark button[style*="background:#1D1D1D"] {
background: #60a5fa !important;
}

/* 26. Login error/success toasts in unified-login */
:root.dark .unified-login .login-error-toast {
background: var(--p-3b1a1a) !important;
color: var(--p-fca5a5) !important;
border-color: var(--p-7f1d1d) !important;
}

/* 27. Peter priority badges */
:root.dark .peter-priority-high {
background: var(--p-3b1a1a) !important;
color: var(--p-f87171) !important;
}
:root.dark .peter-priority-med {
background: var(--p-3b2f1a) !important;
color: var(--p-fbbf24) !important;
}
:root.dark .peter-priority-low {
background: var(--bg-hover) !important;
color: var(--text-muted) !important;
}

/* 28. Editable cell hover */
:root.dark .editable-cell:hover {
background: var(--p-1e3a5f) !important;
}

/* 29. Warning banner in finance (fffbeb) */
:root.dark div[style*="background:#fffbeb"],
:root.dark div[style*="background:var(--bg-body)"][style*="border:1px solid"] {
border-color: var(--border) !important;
}

/* 30. Dim pill unmapped button */
:root.dark .dim-pill[data-val="missing"] {
background: var(--p-78350f) !important;
color: var(--p-fcd34d) !important;
border-color: var(--p-fbbf24) !important;
}

/* 32. Inventory status pills dark mode */
:root.dark .inv-pill-healthy { background: var(--p-065f46) !important; color: var(--p-6ee7b7) !important; }
:root.dark .inv-pill-submitted { background: var(--p-1e3a5f) !important; color: var(--p-93c5fd) !important; }
:root.dark .inv-pill-delivered { background: var(--p-065f46) !important; color: var(--p-6ee7b7) !important; }
:root.dark .inv-pill-oos { background: var(--p-7f1d1d) !important; color: var(--p-fecaca) !important; }

/* 33. Sourcing table header colors */
:root.dark .st-peter-hdr { background: rgba(59,130,246,0.25) !important; color: var(--p-93c5fd) !important; }
:root.dark .st-xiaofu-hdr { background: rgba(234,179,8,0.25) !important; color: var(--p-fcd34d) !important; }
:root.dark .st-winner-peter { background: rgba(59,130,246,0.25) !important; color: var(--p-93c5fd) !important; }
:root.dark .st-winner-xiaofu { background: rgba(234,179,8,0.25) !important; color: var(--p-fcd34d) !important; }

/* 34. Engine dot gray */
:root.dark .engine-dot.gray { background: var(--p-6b7280) !important; }

/* 35. PO doc icon circles in dark */
:root.dark div[style*="background:#0f172a"][style*="border-radius:10px"] {
background: var(--bg-hover) !important;
}

/* 36. Discovery/transition info boxes */
:root.dark div[style*="background: #f0f9ff"],
:root.dark div[style*="background:#f0f9ff"] {
background: var(--p-1e3a5f) !important;
color: var(--p-93c5fd) !important;
}
:root.dark div[style*="background: #fefbeb"],
:root.dark div[style*="background:#fefbeb"] {
background: var(--p-3b2f1a) !important;
color: var(--p-fcd34d) !important;
}

/* 37. Invite screen paragraph */
:root.dark p[style*="color:#94a3b8"] {
color: var(--text-muted) !important;
}
/* 31. PO Flo wizard icon circles - keep branded colors but ensure dark bg contrast */
:root.dark .ef-step {
background: var(--bg-hover) !important;
color: var(--text-secondary) !important;
}
:root.dark .ef-step.active {
background: var(--accent) !important;
color: #fff !important;
}
/* ===== END DARK MODE AUDIT FIX ===== */

/* ===== SKELETON LOADING ANIMATIONS ===== */
@keyframes skeleton-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary, var(--p-f3f4f6)) 25%, var(--bg-hover, var(--p-e5e7eb)) 37%, var(--bg-secondary, var(--p-f3f4f6)) 63%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: 4px;
}
:root.dark .skeleton {
  background: linear-gradient(90deg, var(--bg-secondary, var(--p-1a202c)) 25%, var(--bg-hover, var(--p-374151)) 37%, var(--bg-secondary, var(--p-1a202c)) 63%);
  background-size: 800px 100%;
}
.skeleton-row {
  width: 100%;
  height: 20px;
  margin: 8px 0;
  border-radius: 4px;
}
.skeleton-card {
  height: 80px;
  border-radius: var(--radius, 8px);
  margin-bottom: 12px;
}
.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
}
.skeleton-table .skeleton-row:first-child {
  height: 14px;
  width: 60%;
  margin-bottom: 12px;
}
.skeleton-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
/* ===== END SKELETON ===== */

.has-token .sidebar { display: flex !important; }
.has-token .main-content { display: flex !important; }
.has-token #login-screen { display: none !important; }
.no-token .sidebar { display: none !important; }
.no-token .main-content { display: none !important; }
.no-token #login-screen { display: flex !important; }

:root.dark #order-lightbox > div { background: var(--bg-card); color: var(--text-primary); }
:root.dark .table th { color: var(--text-muted); border-color: var(--border); }
:root.dark .table td { border-color: var(--border); }
:root.dark .card { background: var(--bg-card); border-color: var(--border); }
:root.dark .metrics-grid .card h3 { color: var(--text-secondary); }
:root.dark input, :root.dark select { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); position: fixed; z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .content { padding: 16px !important; }
  .metrics-grid { grid-template-columns: 1fr 1fr !important; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 6px; }
}
@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block !important; }
}

.content { display: block !important; }
@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

    /* Trend tooltip - position:fixed to avoid clipping by overflow:hidden parents */
    .trend-tip { position:relative; cursor:default; }
    .trend-tip:hover .trend-tip-text { visibility:visible; opacity:1; }
    .trend-tip-text { visibility:hidden; opacity:0; position:fixed; background:var(--p-1d1d1d); color:#fff; padding:6px 10px; border-radius:6px; font-size:11px; font-weight:400; white-space:normal; max-width:220px; z-index:9999; text-align:center; pointer-events:none; transition:opacity 0.15s; text-transform:none; letter-spacing:normal; }
    .trend-tip-text::after { content:''; position:absolute; top:100%; left:50%; margin-left:-4px; border:4px solid transparent; border-top-color:var(--p-1a1a1a); }

    /* Fix tooltip clipping: ensure parent containers don't clip tooltips */
    .metrics-grid { overflow: visible; }
    .metrics-grid .card { overflow: visible; }
    .card h3.trend-tip { overflow: visible; }
    .table-card { overflow: visible; }
    .table-container { overflow: visible; }

    /* === Shopify Embedded / Narrow Viewport Compact Mode === */
    @media screen and (max-width: 850px) and (min-width: 768px) {
      .content { padding: 0 20px 20px; }
      .welcome-text { font-size: 20px; }
      .welcome-subtitle { font-size: 13px; }
      .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
        margin-bottom: 16px;
      }
      .card { padding: 16px; }
      .card h3 { font-size: 11px; margin-bottom: 8px; }
      .metric { font-size: 20px !important; white-space: nowrap; }
      .metric-label { font-size: 11px; margin-bottom: 8px; }
      .metric-change { font-size: 11px; padding: 2px 8px; }
      .mini-metric { font-size: 18px; }
    }

    /* More aggressive compaction when inside Shopify iframe */
    .embedded .content { padding: 0 16px 16px; }
    .embedded .welcome-text { font-size: 20px; }
    .embedded .metrics-grid {
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 8px;
      margin-bottom: 14px;
    }
    .embedded .card { padding: 14px; }
    .embedded .card h3 { font-size: 11px; margin-bottom: 6px; }
    .embedded .metric { font-size: 20px !important; white-space: nowrap; overflow: hidden;  }
    .embedded .metric-label { font-size: 11px; margin-bottom: 6px; }
    .embedded .metric-change { font-size: 10px; padding: 2px 6px; }
    .embedded .mini-metric { font-size: 16px; }
    .embedded .tab-btn { padding: 7px 12px; font-size: 11px; }
    .embedded .sidebar { width: 200px; }
    .embedded .table { font-size: 12px; }
    .embedded .table th, .embedded .table td { padding: 8px 6px; }
    /* === END Shopify Embedded Compact Mode === */

    
/* FIX 3: Stable column widths on pagination */
#orders-table { table-layout: fixed; width: 100%; min-width: 1150px; }
#orders-table th, #orders-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 12px 14px;
}
#orders-table td { vertical-align: middle; }
#orders-table th:nth-child(9) { white-space: normal; overflow: visible; }
#orders-table td:nth-child(9) { white-space: normal; overflow: visible; }

/* === T-PILL: FF UI polish - pill-shaped #1D1D1D buttons (Austin msg62642 2026-06-29) === */
/* Scope: action buttons only. Inputs, cards, KPI tiles, status pills, swatches untouched. */
/* Base .btn family - pill always */
.btn,
.btn-sm,
button.btn,
button.btn-sm,
.bp,
.btn-peter-sourced,
.btn-peter-return,
.btn-bundle-mapped,
.btn-bundle-unmap,
.btn-success,
.btn-danger,
.btn-info,
.btn-outline {
  border-radius: 999px !important;
}
/* Primary action buttons -> #1D1D1D background (semantic variants excluded) */
.btn:not(.btn-success):not(.btn-danger):not(.btn-info):not(.btn-outline):not(.btn-peter-return):not(.btn-bundle-unmap),
button.btn:not(.btn-success):not(.btn-danger):not(.btn-info):not(.btn-outline):not(.btn-peter-return):not(.btn-bundle-unmap),
.btn-sm:not(.btn-success):not(.btn-danger):not(.btn-info):not(.btn-outline):not(.btn-peter-return):not(.btn-bundle-unmap),
.bp,
.btn-peter-sourced,
.btn-bundle-mapped {
  background: var(--p-1d1d1d) !important;
  color: #fff !important;
}
/* Inline-styled primary buttons - swap to #1D1D1D + pill */
button[style*="background:#000"],
button[style*="background:#111"],
button[style*="background:#0f172a"],
button[style*="background:#0E1A2B"],
button[style*="background:#0e1a2b"],
button[style*="background:#1a1a1a"],
button[style*="background:var(--accent)"],
button[style*="background:var(--primary)"],
button[style*="background:var(--text-primary)"],
a[style*="background:#000"][href]:not([role]),
a[style*="background:#1D1D1D"] {
  background: var(--p-1d1d1d) !important;
  border-radius: 999px !important;
  color: #fff !important;
}
/* Inline-styled buttons that ALREADY use #1D1D1D - just ensure pill */
button[style*="background:#1D1D1D"],
button[style*="background:#1d1d1d"] {
  border-radius: 999px !important;
}
/* Dark-mode parity: keep #1D1D1D, dont let dark theme override */
:root.dark .btn:not(.btn-success):not(.btn-danger):not(.btn-info):not(.btn-outline):not(.btn-peter-return):not(.btn-bundle-unmap),
:root.dark button.btn:not(.btn-success):not(.btn-danger):not(.btn-info):not(.btn-outline):not(.btn-peter-return):not(.btn-bundle-unmap),
:root.dark .btn-sm:not(.btn-success):not(.btn-danger):not(.btn-info):not(.btn-outline):not(.btn-peter-return):not(.btn-bundle-unmap) {
  background: var(--p-1d1d1d) !important;
  color: #fff !important;
}
/* Login screen logo: match admin.freedomclub.com (width:180px) */
.unified-login .login-logo img,
.unified-login .login-logo .logo-main img {
  max-width: 180px !important;
  width: 180px !important;
  height: auto !important;
}
/* === T-PILL: end === */


/* <style> */
/* M2419_BARANIM: Overview daily orders grow-in (as the freedomfulfilment.com preview) */
#order-bar-chart.ffb-in .ffb{transform-origin:bottom;animation:ffbGrow .8s cubic-bezier(.22,.61,.36,1) both}
#order-bar-chart.ffb-in > div > span{animation:ffbFade .5s ease .35s both}
@keyframes ffbGrow{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes ffbFade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion: reduce){#order-bar-chart.ffb-in .ffb,#order-bar-chart.ffb-in > div > span{animation:none}}

/* <style id="m58-app"> */

@keyframes m58fade{from{opacity:0}}
@keyframes m58in{from{opacity:0;transform:translateY(10px)}}
@keyframes m58out{to{opacity:0;transform:translateY(-6px)}}
@keyframes m58xi{from{opacity:0}}
@media (prefers-reduced-motion:no-preference){
html.m58-boot .sidebar,html.m58-boot .main-content{animation:m58fade .45s ease-out both}
html.m58-boot .content > .section.active{animation:m58in .55s cubic-bezier(.2,.7,.2,1) .06s both}
html.m58-nav .content{view-transition-name:m58main}
html.m58-nav::view-transition-old(root),html.m58-nav::view-transition-new(root){animation:none}
html.m58-nav::view-transition-group(m58main){animation-duration:.3s}
html.m58-nav::view-transition-old(m58main){animation:m58out .15s ease-in both}
html.m58-nav::view-transition-new(m58main){animation:m58in .3s cubic-bezier(.2,.7,.2,1) .07s both}
.section.m2535-in{animation:m58in .3s cubic-bezier(.2,.7,.2,1) both !important}
html.m58-theme::view-transition-old(root){animation:none}
html.m58-theme::view-transition-new(root){animation:m58xi .45s cubic-bezier(.4,0,.2,1) both}
html.m58-theme-fb,html.m58-theme-fb *{transition:background-color .45s ease,color .45s ease,border-color .45s ease !important}
}
#m2535-card .m2535-card-a{align-items:center}
#m2535-card .m2535-card-a .first{margin-right:0;background:transparent;color:var(--text-primary);border-color:var(--m25-line,var(--p-e7e7e9))}
#m2535-card .m58-skip{margin-right:auto;background:none;border:0;padding:6px 2px;font:500 12px Inter,-apple-system,sans-serif;color:var(--m25-muted,var(--p-71717a));cursor:pointer;min-height:0 !important;min-width:0 !important;height:auto}
#m2535-card .m58-skip:hover{color:var(--text-primary)}
#ff-bug-report-btn svg{stroke-width:2}

/* <style id="m89-app"> */

/* P6 accent: Freedom Group blue (site option B lit accent #A5B4FC family). Fill #4F5FE0 light / #5262E5 dark (white text AA 5.2 / 5.0);
   ink #4352D6 light (AA on white) / #A5B4FC dark (7.5:1 on cards). Status colours are separate and unchanged. */
:root{--accent:var(--p-4f5fe0);--m89-accent:var(--p-4f5fe0);--m89-ink:var(--p-4352d6);--m89-dim:rgba(24,24,28,.42)}
:root.dark{--accent:var(--p-5262e5);--m89-accent:var(--p-5262e5);--m89-ink:var(--p-a5b4fc);--m89-dim:rgba(0,0,0,.58)}
.toggle-switch input:checked + .toggle-slider{background:var(--accent) !important}
:root.dark .unified-login .login-btn:hover{background:var(--p-4352d6) !important}
.header-icon-btn:focus-visible,.m2535-pill:focus-visible,.m2535-x:focus-visible,.m58-skip:focus-visible,.sidebar a:focus-visible,#billing-content a:focus-visible{outline:2px solid var(--m89-ink) !important;outline-offset:2px}
.unified-login .login-input:focus{border-color:var(--m89-accent) !important;box-shadow:0 0 0 3px rgba(79,95,224,.18) !important}
@keyframes m89fade{from{opacity:0}}
@keyframes m89in{from{opacity:0;transform:translateY(6px)}}
/* P1 one-column sidebar: no section labels, one unlabeled hairline before the account items */
.sidebar nav .nav-section-label{display:none !important}
.sidebar nav{padding-top:2px}
.sidebar nav .m89-sep{height:1px;background:var(--border-light);margin:12px 24px;border:0}
:root.dark .sidebar nav .m89-sep{background:var(--border)}
.sidebar.collapsed nav .m89-sep{margin:10px 16px}
/* P2 tour buttons: text + chevron on one line, vertically centred */
#m2535-card .m2535-card-a{display:flex;align-items:center}
#m2535-card .m2535-card-a button{display:inline-flex !important;align-items:center !important;justify-content:center;gap:6px;line-height:1 !important;white-space:nowrap;vertical-align:middle}
#m2535-card .m2535-card-a button svg{display:block;width:14px;height:14px;flex:0 0 auto;margin:0}
#m2535-card .m2535-card-a .m2535-pill.sm{height:34px;min-height:34px !important}
#m2535-card .m2535-card-a .m2535-pill.sm:not(.first){padding:0 12px 0 16px}
#m2535-card .m2535-card-a .m2535-pill.sm.first{padding:0 16px 0 12px}
#m2535-card .m58-skip{height:34px !important}
/* P3 soft grey dim behind every tour/help popup; only the popup and the spotlight stay bright */
#m2535-spot{box-shadow:0 0 0 2px rgba(255,255,255,.92),0 0 0 9999px var(--m89-dim) !important;animation:m89fade .22s ease-out both}
#m2535-spot.none{box-shadow:0 0 0 9999px var(--m89-dim) !important}
.m2535-back{background:var(--m89-dim) !important}
#order-lightbox{background:var(--m89-dim) !important}
.m89-dim{position:fixed;inset:0;z-index:1199;background:var(--m89-dim);animation:m89fade .2s ease-out both}
/* M2689b: the same soft grey dim on the older welcome popup, the page guide, the status help and the ! report modal */
.welcome-popup-overlay,.peter-help-overlay,#ff-bug-modal{background:var(--m89-dim) !important}
/* M2689c: dark mode primary pills were #1D1D1D on a #1f1f1f card (Next / Take the tour invisible); invert them like the dark badge */
:root.dark .m2535-pill:not(.first){background:var(--p-f4f4f5);border-color:var(--p-f4f4f5);color:#111}
:root.dark #m2535-card .m2535-card-a .first{background:transparent;color:var(--p-f4f4f5);border-color:#3a3b40}
/* P5 invoice order context */
#billing-content tr.m89-row{cursor:pointer}
#billing-content tr.m89-row:hover > td,#billing-content tr.m89-row.open > td{background:var(--bg-hover)}
.m89-more{display:inline-flex !important;align-items:center;gap:6px;border:1px solid var(--border);background:var(--bg-card);color:var(--text-primary);border-radius:999px;height:30px;min-height:30px !important;padding:0 10px 0 12px;font:500 12px Inter,-apple-system,sans-serif;cursor:pointer;white-space:nowrap;line-height:1}
.m89-more svg{width:13px;height:13px;display:block;transition:transform .2s}
tr.open .m89-more svg{transform:rotate(180deg)}
.m89-more:focus-visible,.m89-ord summary:focus-visible{outline:2px solid var(--m89-ink);outline-offset:2px}
#billing-content tr.m89-det > td{padding:0 !important;background:var(--bg-light);border-bottom:1px solid var(--border-light)}
.m89-det-in{position:sticky;left:0;box-sizing:border-box;width:min(100%,calc(100vw - 32px));max-width:860px;padding:18px 20px 20px;animation:m89in .3s cubic-bezier(.2,.7,.2,1) both;white-space:normal;text-align:left}
.m89-load{margin:0;font-size:13px;color:var(--text-muted)}
.m89-sum{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.m89-sum > div{background:var(--bg-card);border:1px solid var(--border);border-radius:12px;padding:12px 14px;min-width:0}
.m89-sum span{display:block;font-size:11px;color:var(--text-muted);font-weight:500;margin-bottom:4px}
.m89-sum b{display:block;font-size:16px;font-weight:650;color:var(--text-primary);letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.m89-sum small{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;font-size:12px;color:var(--text-secondary)}
.m89-ord{margin:12px 0;border:1px solid var(--border);border-radius:12px;background:var(--bg-card);overflow:hidden}
.m89-ord summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;cursor:pointer;font-size:13px;font-weight:600;color:var(--m89-ink)}
.m89-ord summary::-webkit-details-marker{display:none}
.m89-ord summary svg{width:14px;height:14px;display:block;transition:transform .2s;flex:0 0 auto}
.m89-ord[open] summary svg{transform:rotate(180deg)}
.m89-list{max-height:340px;overflow:auto;border-top:1px solid var(--border-light);animation:m89fade .25s ease-out both}
.m89-o{display:grid;grid-template-columns:minmax(92px,auto) minmax(0,1fr) auto;gap:12px;align-items:center;padding:8px 14px;font-size:13px;border-bottom:1px solid var(--border-light)}
.m89-o:last-child{border-bottom:0}
.m89-o b{font-weight:600;color:var(--text-primary);font-variant-numeric:tabular-nums}
.m89-o span{color:var(--text-secondary);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m89-o em{font-style:normal;font-size:11px;color:var(--text-muted);margin-left:6px;font-weight:500}
.m89-st{font-style:normal;display:inline-block;padding:2px 9px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap}
.m89-st.ok{background:var(--p-dcfce7);color:var(--p-15803d)}.m89-st.tr{background:var(--p-dbeafe);color:#1d4ed8}.m89-st.pr{background:var(--p-fef3c7);color:var(--p-b45309)}.m89-st.ex{background:var(--p-fee2e2);color:#b91c1c}.m89-st.mu{background:var(--bg-hover);color:var(--text-secondary)}
:root.dark .m89-st.ok{background:rgba(16,185,129,.16);color:var(--p-6ee7b7)}:root.dark .m89-st.tr{background:rgba(59,130,246,.18);color:var(--p-93c5fd)}:root.dark .m89-st.pr{background:rgba(245,158,11,.16);color:var(--p-fcd34d)}:root.dark .m89-st.ex{background:rgba(239,68,68,.16);color:var(--p-fca5a5)}
.m89-fees{border:1px solid var(--border);border-radius:12px;background:var(--bg-card);padding:4px 14px}
.m89-fh{font-size:11px;color:var(--text-muted);font-weight:500;padding:10px 0 2px}
.m89-fl{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:10px 0;border-bottom:1px solid var(--border-light);font-size:13px;color:var(--text-secondary)}
.m89-fl b{font-weight:600;color:var(--text-primary);font-variant-numeric:tabular-nums;white-space:nowrap}
.m89-fl.tot{border-bottom:0;color:var(--text-primary);font-weight:700}
.m89-fl.tot b{font-weight:700;font-size:14px}
@media (max-width:640px){
.m89-sum{grid-template-columns:1fr 1fr}.m89-sum > div:first-child{grid-column:1 / -1}
.m89-det-in{padding:14px 12px 16px}
.m89-o{grid-template-columns:minmax(78px,auto) minmax(0,1fr);row-gap:4px}.m89-o .m89-st{grid-column:2;justify-self:start}
}
@media (prefers-reduced-motion:reduce){#m2535-spot,.m89-dim,.m89-det-in,.m89-list{animation:none !important}}

/* <style id="ff-look-v2-portal-20261026"> */

/* ==== FF look v2 for the client portal (TG4325). Source: admin <style id="ff-look-v2-20261026"> + STYLE-GUIDE.md.
   White cards, white top bar, one soft grey (#f7f8fa) sidebar, #f9fafb table headers, hairline #e5e7eb borders, no shadows.
   Type scale 10/11/12/13/14/16/18/20/24/28px, weights 400/500/600/700, buttons are pills.
   Status colours (green/amber/red pills, savings green) are NOT touched: no colour is set on any status element.
   The extra :not(#ff-nolook) only lifts specificity above the shared canonical table rules; it matches every page. ==== */
html.ff-look-v2:not(.dark){
  --v2-soft:#f7f8fa; --v2-th:var(--p-f9fafb); --v2-line:var(--p-e5e7eb); --v2-ink:var(--p-111827); --v2-muted:var(--p-6b7280);
  --bg-sidebar:var(--v2-soft); --border:var(--v2-line); --border-light:var(--v2-line); --shadow:none; --shadow-hover:none;
}
html.ff-look-v2:not(.dark) body{-webkit-font-smoothing:antialiased;}
/* shell: soft grey sidebar, white top bar */
html.ff-look-v2:not(.dark) .sidebar{background:var(--v2-soft) !important;border-right:1px solid var(--v2-line) !important;}
html.ff-look-v2:not(.dark) .nav-item{border-radius:8px;font-size:14px;}
html.ff-look-v2:not(.dark) .nav-item:hover{background:var(--p-eef0f3);}
html.ff-look-v2:not(.dark) .nav-item.active{background:#fff;box-shadow:0 0 0 1px var(--v2-line);font-weight:600;}
html.ff-look-v2:not(.dark) .page-header{background:#fff !important;border-bottom:1px solid var(--v2-line) !important;}
/* greeting: 24px/600 */
html.ff-look-v2:not(.dark) #overview .welcome-text{font-size:24px !important;font-weight:600 !important;letter-spacing:-0.3px;line-height:1.25;}
html.ff-look-v2:not(.dark) #overview .welcome-subtitle,html.ff-look-v2:not(.dark) .welcome-subtitle{font-size:14px !important;}
/* cards: white, hairline, no shadow */
html.ff-look-v2:not(.dark) .card{border:1px solid var(--v2-line);box-shadow:none !important;border-radius:12px;}
html.ff-look-v2:not(.dark) .card h3{font-size:13px;font-weight:500;letter-spacing:0;}
html.ff-look-v2:not(.dark) .metric{font-size:28px;font-weight:600;letter-spacing:-0.5px;font-variant-numeric:tabular-nums;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-kpi b,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45 .m45-kpi b{font-size:28px !important;font-weight:600 !important;}
html.ff-look-v2:not(.dark) .m45-pitch h2{font-size:28px;font-weight:600;}
html.ff-look-v2:not(.dark) #ff-saved-card .ffs-total{font-size:28px;font-weight:600;}
/* tables: one header and one cell size on the scale (13px), soft grey header row, no capitals */
html.ff-look-v2:not(.dark):not(#ff-nolook):not(.ff-x) .section table:not(.ff-x) thead th,html.ff-look-v2:not(.dark):not(#ff-nolook):not(.ff-x) .section th:not(.ff-x){background:var(--v2-th) !important;color:var(--p-374151) !important;font-size:13px !important;font-weight:500 !important;text-transform:none !important;letter-spacing:0 !important;border-bottom:1px solid var(--v2-line) !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook):not(.ff-x) .section table:not(.ff-x) tbody td{font-size:13px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .section .pt-name,html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-title-cell,html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-rb-full,
html.ff-look-v2:not(.dark):not(#ff-nolook) .m25m-list li,html.ff-look-v2:not(.dark):not(#ff-nolook) .m25m-name,html.ff-look-v2:not(.dark):not(#ff-nolook) .m25m-n,html.ff-look-v2:not(.dark):not(#ff-nolook) .m25m-p,
html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-card p,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-steps li,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45 .m45-steps li,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-ol,
html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-wait,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-banner,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-tbl,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-empty,
html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-msg,html.ff-look-v2:not(.dark):not(#ff-nolook) .m339q-next li,html.ff-look-v2:not(.dark):not(#ff-nolook) .m61-learn li,html.ff-look-v2:not(.dark):not(#ff-nolook) .m61-drop,
html.ff-look-v2:not(.dark):not(#ff-nolook) #m2635-pre .m26-p,html.ff-look-v2:not(.dark):not(#ff-nolook) #m2635-pre .m26-lb,html.ff-look-v2:not(.dark):not(#ff-nolook) .m3269e-how li,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45 .m3269e-how li,
html.ff-look-v2:not(.dark):not(#ff-nolook) #tk-lb .tk-lb-blurb{font-size:13px !important;}
/* small text: nothing under 10px, no half sizes */
html.ff-look-v2:not(.dark):not(#ff-nolook) .m3843-rl,html.ff-look-v2:not(.dark):not(#ff-nolook) #insights #insights-list .m2798-ins tr td.m3843-c-date .m3843-rl{font-size:11px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-subtab-count{font-size:11px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) #order-bar-chart span{font-size:10px !important;}
html.ff-look-v2:not(.dark) .m25m-c span{font-size:10px;}
html.ff-look-v2:not(.dark) .header h2,html.ff-look-v2:not(.dark) .m89-fl.tot b{font-size:14px;}
/* buttons: never the browser default font, always pill-shaped, 12/12.5/13px */
:where(html.ff-look-v2) :where(button,input,select,textarea){font-family:inherit;}
:where(html.ff-look-v2) :where(button){font-size:13px;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-seg,html.ff-look-v2:not(.dark):not(#ff-nolook) .m2443-seg,html.ff-look-v2:not(.dark):not(#ff-nolook) .m2443-chips,html.ff-look-v2:not(.dark):not(#ff-nolook) #top-products-period{border-radius:999px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-seg button,html.ff-look-v2:not(.dark):not(#ff-nolook) .m2443-seg button,html.ff-look-v2:not(.dark):not(#ff-nolook) .m2443-chips .m2443-chip,html.ff-look-v2:not(.dark):not(#ff-nolook) #top-products-period .tp-period-btn{border-radius:999px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-pill{font-size:13px;font-weight:500;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-pill.sm{font-size:12px;}
html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-row-btn{font-weight:500;}
html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-page-icon,html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-subtab,html.ff-look-v2:not(.dark) .status-help-btn{border-radius:999px !important;}
html.ff-look-v2:not(.dark) .section button[style*="border-radius:8px"],html.ff-look-v2:not(.dark) .section button[style*="border-radius: 8px"],html.ff-look-v2:not(.dark) .section button[style*="border-radius:6px"],html.ff-look-v2:not(.dark) .section button[style*="border-radius:10px"],html.ff-look-v2:not(.dark) .section button[style*="border:none"][style*="background:none"]{border-radius:999px !important;}
html.ff-look-v2:not(.dark) .section button[style*="font-weight:600"]{font-weight:500 !important;}
html.ff-look-v2:not(.dark) #date-filter-btn,html.ff-look-v2:not(.dark) #billing-date-filter-btn{border-radius:999px !important;}
/* second pass after the trial audit: the last off-scale outliers */
html.ff-look-v2:not(.dark):not(#ff-nolook) #ff-saved-card th,html.ff-look-v2:not(.dark):not(#ff-nolook) #ff-saved-card td,html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-table thead th{font-size:13px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) #overview .card div[style*="min-height:100px"] .metric{font-size:20px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .m89-sum span,html.ff-look-v2:not(.dark):not(#ff-nolook) .m89-fh,html.ff-look-v2:not(.dark):not(#ff-nolook) .m25m-name small,html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-ni-f span,
html.ff-look-v2:not(.dark):not(#ff-nolook) .m3584-items .k,html.ff-look-v2:not(.dark):not(#ff-nolook) .m3859-th,html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-date,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-eyebrow{font-size:11px !important;}
html.ff-look-v2:not(.dark):not(#ff-nolook) .m2535-empty strong,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-empty strong{font-size:16px !important;}
html.ff-look-v2:not(.dark) #overview .welcome-section{margin-bottom:4px;}
/* phone */
@media (max-width:768px){
  html.ff-look-v2:not(.dark) #overview .welcome-text{font-size:20px !important;}
  html.ff-look-v2:not(.dark):not(#ff-nolook) #overview .metrics-grid .metric{font-size:20px !important;}
  html.ff-look-v2:not(.dark):not(#ff-nolook) .m45-kpi b,html.ff-look-v2:not(.dark):not(#ff-nolook) .m45 .m45-kpi b{font-size:20px !important;}
  html.ff-look-v2:not(.dark):not(#ff-nolook) #tasks .tk-row-btn{font-size:12px !important;}
  html.ff-look-v2:not(.dark):not(#ff-nolook) #overview .card div[style*="min-height:100px"] .metric{font-size:18px !important;}
  html.ff-look-v2:not(.dark):not(#ff-nolook) #ff-saved-card th,html.ff-look-v2:not(.dark):not(#ff-nolook) #ff-saved-card td{font-size:12px !important;}
}

/* ==== TG4339 dark look: same shapes and type scale as the light look above (generated from it), colours from the dark tokens
   (admin-tokens.css :root.dark). Sidebar = --bg-sidebar, top bar = page background, cards = --bg-card with a hairline --border,
   no shadows, table headers --bg-hover 13px/500 sentence case. No status colour is set (green/amber/red pills unchanged). ==== */
html.ff-look-v2.dark{--v2-soft:var(--bg-sidebar);--v2-th:var(--bg-hover);--v2-line:var(--border);--v2-ink:var(--text-primary);--v2-muted:var(--text-secondary);--shadow:none;--shadow-hover:none;}
html.ff-look-v2.dark .card{background:var(--bg-card);}
html.ff-look-v2.dark .card h3{color:var(--text-secondary);}
html.ff-look-v2.dark:not(#ff-nolook):not(.ff-x) .section table:not(.ff-x) thead th,html.ff-look-v2.dark:not(#ff-nolook):not(.ff-x) .section th:not(.ff-x){color:var(--text-secondary) !important;}
html.ff-look-v2.dark body{-webkit-font-smoothing:antialiased;}
html.ff-look-v2.dark .sidebar{background:var(--v2-soft) !important;border-right:1px solid var(--v2-line) !important;}
html.ff-look-v2.dark .nav-item{border-radius:8px;font-size:14px;}
html.ff-look-v2.dark .nav-item.active{background:var(--bg-card);box-shadow:0 0 0 1px var(--border);font-weight:600;}
html.ff-look-v2.dark .page-header{background:var(--bg-card) !important;border-bottom:1px solid var(--v2-line) !important;}
html.ff-look-v2.dark #overview .welcome-text{font-size:24px !important;font-weight:600 !important;letter-spacing:-0.3px;line-height:1.25;}
html.ff-look-v2.dark #overview .welcome-subtitle,html.ff-look-v2.dark .welcome-subtitle{font-size:14px !important;}
html.ff-look-v2.dark .card{border:1px solid var(--v2-line);box-shadow:none !important;border-radius:12px;}
html.ff-look-v2.dark .card h3{font-size:13px;font-weight:500;letter-spacing:0;}
html.ff-look-v2.dark .metric{font-size:28px;font-weight:600;letter-spacing:-0.5px;font-variant-numeric:tabular-nums;}
html.ff-look-v2.dark:not(#ff-nolook) .m45-kpi b,html.ff-look-v2.dark:not(#ff-nolook) .m45 .m45-kpi b{font-size:28px !important;font-weight:600 !important;}
html.ff-look-v2.dark .m45-pitch h2{font-size:28px;font-weight:600;}
html.ff-look-v2.dark #ff-saved-card .ffs-total{font-size:28px;font-weight:600;}
html.ff-look-v2.dark:not(#ff-nolook):not(.ff-x) .section table:not(.ff-x) thead th,html.ff-look-v2.dark:not(#ff-nolook):not(.ff-x) .section th:not(.ff-x){background:var(--v2-th) !important;font-size:13px !important;font-weight:500 !important;text-transform:none !important;letter-spacing:0 !important;border-bottom:1px solid var(--v2-line) !important;}
html.ff-look-v2.dark:not(#ff-nolook):not(.ff-x) .section table:not(.ff-x) tbody td{font-size:13px !important;}
html.ff-look-v2.dark:not(#ff-nolook) .section .pt-name,html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-title-cell,html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-rb-full,
html.ff-look-v2.dark:not(#ff-nolook) .m25m-list li,html.ff-look-v2.dark:not(#ff-nolook) .m25m-name,html.ff-look-v2.dark:not(#ff-nolook) .m25m-n,html.ff-look-v2.dark:not(#ff-nolook) .m25m-p,
html.ff-look-v2.dark:not(#ff-nolook) .m2535-card p,html.ff-look-v2.dark:not(#ff-nolook) .m45-steps li,html.ff-look-v2.dark:not(#ff-nolook) .m45 .m45-steps li,html.ff-look-v2.dark:not(#ff-nolook) .m45-ol,
html.ff-look-v2.dark:not(#ff-nolook) .m45-wait,html.ff-look-v2.dark:not(#ff-nolook) .m45-banner,html.ff-look-v2.dark:not(#ff-nolook) .m45-tbl,html.ff-look-v2.dark:not(#ff-nolook) .m45-empty,
html.ff-look-v2.dark:not(#ff-nolook) .m45-msg,html.ff-look-v2.dark:not(#ff-nolook) .m339q-next li,html.ff-look-v2.dark:not(#ff-nolook) .m61-learn li,html.ff-look-v2.dark:not(#ff-nolook) .m61-drop,
html.ff-look-v2.dark:not(#ff-nolook) #m2635-pre .m26-p,html.ff-look-v2.dark:not(#ff-nolook) #m2635-pre .m26-lb,html.ff-look-v2.dark:not(#ff-nolook) .m3269e-how li,html.ff-look-v2.dark:not(#ff-nolook) .m45 .m3269e-how li,
html.ff-look-v2.dark:not(#ff-nolook) #tk-lb .tk-lb-blurb{font-size:13px !important;}
html.ff-look-v2.dark:not(#ff-nolook) .m3843-rl,html.ff-look-v2.dark:not(#ff-nolook) #insights #insights-list .m2798-ins tr td.m3843-c-date .m3843-rl{font-size:11px !important;}
html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-subtab-count{font-size:11px !important;}
html.ff-look-v2.dark:not(#ff-nolook) #order-bar-chart span{font-size:10px !important;}
html.ff-look-v2.dark .m25m-c span{font-size:10px;}
html.ff-look-v2.dark .header h2,html.ff-look-v2.dark .m89-fl.tot b{font-size:14px;}
html.ff-look-v2.dark:not(#ff-nolook) .m2535-seg,html.ff-look-v2.dark:not(#ff-nolook) .m2443-seg,html.ff-look-v2.dark:not(#ff-nolook) .m2443-chips,html.ff-look-v2.dark:not(#ff-nolook) #top-products-period{border-radius:999px !important;}
html.ff-look-v2.dark:not(#ff-nolook) .m2535-seg button,html.ff-look-v2.dark:not(#ff-nolook) .m2443-seg button,html.ff-look-v2.dark:not(#ff-nolook) .m2443-chips .m2443-chip,html.ff-look-v2.dark:not(#ff-nolook) #top-products-period .tp-period-btn{border-radius:999px !important;}
html.ff-look-v2.dark:not(#ff-nolook) .m2535-pill{font-size:13px;font-weight:500;}
html.ff-look-v2.dark:not(#ff-nolook) .m2535-pill.sm{font-size:12px;}
html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-row-btn{font-weight:500;}
html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-page-icon,html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-subtab,html.ff-look-v2.dark .status-help-btn{border-radius:999px !important;}
html.ff-look-v2.dark .section button[style*="border-radius:8px"],html.ff-look-v2.dark .section button[style*="border-radius: 8px"],html.ff-look-v2.dark .section button[style*="border-radius:6px"],html.ff-look-v2.dark .section button[style*="border-radius:10px"],html.ff-look-v2.dark .section button[style*="border:none"][style*="background:none"]{border-radius:999px !important;}
html.ff-look-v2.dark .section button[style*="font-weight:600"]{font-weight:500 !important;}
html.ff-look-v2.dark #date-filter-btn,html.ff-look-v2.dark #billing-date-filter-btn{border-radius:999px !important;}
html.ff-look-v2.dark:not(#ff-nolook) #ff-saved-card th,html.ff-look-v2.dark:not(#ff-nolook) #ff-saved-card td,html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-table thead th{font-size:13px !important;}
html.ff-look-v2.dark:not(#ff-nolook) #overview .card div[style*="min-height:100px"] .metric{font-size:20px !important;}
html.ff-look-v2.dark:not(#ff-nolook) .m89-sum span,html.ff-look-v2.dark:not(#ff-nolook) .m89-fh,html.ff-look-v2.dark:not(#ff-nolook) .m25m-name small,html.ff-look-v2.dark:not(#ff-nolook) .m2535-ni-f span,
html.ff-look-v2.dark:not(#ff-nolook) .m3584-items .k,html.ff-look-v2.dark:not(#ff-nolook) .m3859-th,html.ff-look-v2.dark:not(#ff-nolook) .m2535-date,html.ff-look-v2.dark:not(#ff-nolook) .m45-eyebrow{font-size:11px !important;}
html.ff-look-v2.dark:not(#ff-nolook) .m2535-empty strong,html.ff-look-v2.dark:not(#ff-nolook) .m45-empty strong{font-size:16px !important;}
html.ff-look-v2.dark #overview .welcome-section{margin-bottom:4px;}
@media (max-width:768px){
  html.ff-look-v2.dark #overview .welcome-text{font-size:20px !important;}
  html.ff-look-v2.dark:not(#ff-nolook) #overview .metrics-grid .metric{font-size:20px !important;}
  html.ff-look-v2.dark:not(#ff-nolook) .m45-kpi b,html.ff-look-v2.dark:not(#ff-nolook) .m45 .m45-kpi b{font-size:20px !important;}
  html.ff-look-v2.dark:not(#ff-nolook) #tasks .tk-row-btn{font-size:12px !important;}
  html.ff-look-v2.dark:not(#ff-nolook) #overview .card div[style*="min-height:100px"] .metric{font-size:18px !important;}
  html.ff-look-v2.dark:not(#ff-nolook) #ff-saved-card th,html.ff-look-v2.dark:not(#ff-nolook) #ff-saved-card td{font-size:12px !important;}
}
